Home Assistant

From Torben's Wiki

Install as docker container

from https://www.home-assistant.io/installation/raspberrypi/#install-home-assistant-container

sudo docker run -d \
  --name homeassistant \
  --privileged \
  --restart=unless-stopped \
  -e TZ=Europe/Berlin \
  -v /home/homeassistant/.homeassistant:/config \
  --network=host \
  ghcr.io/home-assistant/home-assistant:stable

to restart

sudo docker restart homeassistant

Update

to update docker container to latest version

# from https://www.home-assistant.io/installation/raspberrypi/#install-home-assistant-container

# if this returns "Image is up to date" then you can stop here
sudo docker pull ghcr.io/home-assistant/home-assistant:stable

# stop the running container
sudo docker stop homeassistant

# remove it from Docker's list of containers
sudo docker rm homeassistant

# finally, start a new one
sudo docker run -d \
  --name homeassistant \
  --restart=unless-stopped \
  --privileged \
  -e TZ=Europe/Berlin \
  -v /home/homeassistant/.homeassistant:/config \
  -v /run/dbus:/run/dbus:ro \
  --network=host \
  ghcr.io/home-assistant/home-assistant:stable

Custom Sensor

configuration.yaml:

homeassistant:
  customize: !include customize.yaml

customize.yaml:

sensor.tasmota_mt681_power_cur:
  device_class: "energy"
  unit_of_measurement: "W"
sensor.tasmota_mt681_total_in:
  device_class: "energy"
  state_class: "total_increasing"
  unit_of_measurement: "kWh"
sensor.tasmota_mt681_total_out:
  device_class: "energy"
  state_class: "total_increasing"
  unit_of_measurement: "kWh"