This layout was designed mobile-first.
- Home Assistant setup
Home Assistant Core installation on Raspberry Pi 4, with MySQL.
More details here.
These are some of my custom implementations using Home Assistant:
With custom component Alexa Media Player
, Home Assistant is able to control any thing that you're able to speak to Alexa.
This requires the use of input_boolean
helpers to control the state of the entity.
E.g. to control a plug...
# configuration.yaml
switch:
platform: template
switches:
6a_plug:
value_template: "{{ is_state('input_boolean.6a_plug_state', 'on') }}"
turn_on:
- service: input_boolean.turn_on
entity_id: input_boolean.16a_plug_state
- service: media_player.play_media
entity_id: media_player.new_room_echo
# Preferably set an Echo device that is rarely used as the echo device actually carries out the command in the foreground
data:
media_content_id: 'turn on 6a plug'
media_content_type: custom
turn_off:
- service: input_boolean.turn_off
entity_id: input_boolean.6a_plug_state
- service: media_player.play_media
entity_id: media_player.new_room_echo
data:
media_content_id: 'turn off 6a plug'
media_content_type: custom
Shows internet packet loss in %
, if any. Useful for real-time applications like gaming or VoIP calls.
# configuration.yaml
binary_sensor:
- platform: ping
name: Cloudflare DNS ping
host: 1.1.1.1
count: 1
scan_interval: 2
sensor:
- platform: history_stats
name: int_internet_health
entity_id: binary_sensor.cloudflare_dns_ping
state: "on"
type: ratio
end: "{{ now() }}"
duration: 00:05:00
- platform: template
sensors:
internet_health:
friendly_name: Internet Health
value_template: "{{ states('sensor.int_internet_health') | round }}"
icon_template: mdi:ethernet-cable
unit_of_measurement: '%'
Plays Lo-fi beats live stream from YouTube.
This requires screen
, mpv
and youtube-dl
/youtube-dlc
to be installed.
# configuration.yaml
switch:
platform: command_line
switches:
lofi_beats:
command_on: echo "lofi_on" | netcat localhost 7900
command_off: echo "lofi_off" | netcat localhost 7900
socat
runs in the background (systemd service file) and listens for commands.
Once a switch is turned on, this script is called that starts the playback...
hass_socket_script.sh
:
#!/bin/bash
read MESSAGE
if [[ $MESSAGE == 'lofi_on' ]]; then
screen -S lofi -dm /usr/bin/mpv --no-video $(/path/to/youtube-dlc -g -f 95 5qap5aO4i9A); fi
if [[ $MESSAGE == 'lofi_off' ]]; then screen -S lofi -X quit; fi
# Truncated. Full in ./hass_socket_script.sh
Controls the volume of ALSA - 3.5mm port on the Raspberry Pi. Requires alsamixer
to be installed.
This involves a input_number
helper, an automation and a series of shell commands.
# configuration.yaml
input_number:
pi_volume:
min: 0
max: 100
step: 5
automation:
- alias: Set soundbar volume
trigger:
- platform: state
entity_id: input_number.pi_volume
action:
- service_template: shell_command.pi_volume_{{ trigger.to_state.state | int }}
shell_command:
pi_volume_0: echo amixer_0 | netcat localhost 7900
pi_volume_5: echo amixer_5 | netcat localhost 7900
# Truncated. Full in ./config
Similar to above, the script calls the command amixer
to increase or decrease the volume...
hass_socket_script.sh
:
#!/bin/bash
if [[ $MESSAGE == 'amixer_0' ]]; then amixer -q cset numid=1 -- -10239; fi
if [[ $MESSAGE == 'amixer_5' ]]; then amixer -q cset numid=1 -- -7399; fi
# Truncated. Full in ./hass_socket_script.sh
All cards in this view are in a single vertical stack.
- CPU use
- System load
- Network in
- Network out
- HACS updates
This is the only view that contain badges.
Vertical stack 1
/drive
mount- ASUS laptop
always-on
server- Front gate camera
- Mesh router satellite
- Desk light
- ... Color temp card
- TV lamp
- ... RGB card
- Soundbar volume
Custom implementation that controls alsa volume, using input_boolean
, shell_command
and an automation.
- Night light
- TV lamp - Color flow
- Lo-Fi beats
- Lo-Fi beats 2
- Jazz radio
- AdGuard Home
- Bedroom AC
- Refresh Plex
- qBittorrent alt. speed mode
- 16A plug
Vertical stack 2
- Bedroom temperature
- Bedroom humidity
Indicates if there's any packet loss within the last hour.
- Automatically lists all active media players
Vertical stack 1
- Front gate camera
- Adaptive Lighting switches
Vertical stack 2
- Bedroom AC
- ... addl. controls
Vertical stack 1
Tracks states of specific TVs.
- CPU temp.
- Internet health
- Download speed (Speedtest.net)
- Upload speed (Speedtest.net)
Custom-made sensor that uses the official Speedtest.net CLI instead of the rather inaccurate speedtest-cli
.
- Current network in/out
- Today total traffic in/out
A combined card that graphs network usage within the last hour.
Custom-made sensor that gets network traffic from vnstat
.
Vertical stack 2
- qBittorrent active torrents
- qBittorrent upload/download speed
- SSD free %
/knox
free %/knox
free space
Vertical stack 1
- Node ping
- Internet ping
Graphs pings to local ISP node and Cloudflare DNS. This card is very helpful in isolating network issues.
- Radarr/Sonarr ongoing commands
- Radarr/Sonarr queue
Vertical stack 2
- Network devices list
Using the Netgear integration, this card shows all network-connected devices. Dynamically sorted such that the last updated device is always on top.
- Spotify media player
- Playlist shortcuts
- Soundbar source
- Bedroom Echo source
- Household Echo media players
- ... switches
- Do Not Disturb
- Repeat
- Shuffle
- Alexa Everywhere media player
Vertical stack 1
- Plex currently watching
- Tautulli current bandwidth
- Network in
- Network out
The four graph cards provide an overview of Plex/network activity in one place and indicates potential network issues.
Vertical stack 2
- Conditional cards...
- Header cards
- TV player cards
- Plex media players
auto-entities
by thomaslovenbutton-card
by RomRidercard-mod
by thomaslovenconfig-template-card
by iantrichcustom-header
by maykarlovelace-swipe-navigation
by maykarmini-graph-card
by kalkihmini-media-player
by kalkihrgb-light-card
by bokubsimple-thermostat
by nervetattooslider-entity-row
by thomaslovenvertical-stack-in-card
by ofekashery
- Screenshots may not be up-to-date.
int
are "internal" entities that are used inside templates.- Shutting down/Rebooting X200M involves a program named
Assistant Computer Control
that runs on the laptop.- A cURL request calls a IFTTT webhook which writes a specific phrase in a file inside OneDrive that the software is able to recognize and perform actions accordingly.
- The header that is used for separating cards is from soft-ui.
- to all authors above,
- and all the very helpful folks over at the Discord.