Home Assistant

After configuring my Shelly Ones with Tasmota I needed a solid home automation system.

I already heard a lot about OpenHAB and honestly the Tasmota Smart Home Integrations Website is the most complete list of available home automations systems I found.

After a little research I came to settle with Home-Assistant (which I looked into already a year ago or so. But it developed a lot since then).

Result

First I want to show you how the end result looks before we go into the details.

Home-Assistant Web UI

I even got a daylight alarm which opens my shutter at the specified time in the morning.

I am very happy with this solution especially the configuration was quite convenient.

Configuration

As usual, my docker-compose config:

homeassistant:
  container_name: home-assistant
  image: homeassistant/home-assistant:stable
  volumes:
    - ./data/home-assistant:/config
  environment:
    - TZ=Europe/Berlin
  restart: always
  depends_on:
    - mqtt-broker
  ports:
    - 8123:8123

Well that’s it. Most other stuff can be done from the UI which is very cool. I already have a dedicated MQTT-server running for my smartmeter so it was no hassle to integrate the tasmotas into Home-Assistant.

I had to set “SetOption19 1” (auto-discovery for MQTT) and change the sleep command (to save energy) for Tasmota but that’s about it.

configuration.yaml

# FritzBox to track absence of devices/people
device_tracker:
  - platform: fritz
    host: 192.168.178.1
    username: admin
    password: !secret fritz_pw
    new_device_defaults:
      track_new_devices: false

# Kodi:
media_player:
  - platform: kodi
    host: 192.168.178.16
    port: 80
    username: kodi
    password: !secret fritz_pw

# Workday sensor
binary_sensor:
  - platform: workday
    country: DE

# time sensor
sensor:
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'

# exclude time sensors from event log
logbook:
  exclude:
    entities:
      - sensor.time
      - sensor.date
      - sensor.date_time

# advanced Shutter configuration with position
cover:
  - platform: mqtt
    name: "Shutter Florian"
    availability_topic: "tele/shutter-florian/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    position_topic: "stat/shutter-florian/RESULT"
    value_template: >
      {% if ('Shutter1' in value_json) and ('Position' in value_json.Shutter1) %}
        {{ value_json.Shutter1.Position }}
      {% else %}
        {% if is_state('cover.shutter_florian', 'unknown') %}
          50
        {% else %}
          {{ state_attr('cover.shutter_florian','current_position') }}
        {% endif %}
      {% endif %}      
    position_open: 100
    position_closed: 0
    set_position_topic: "cmnd/shutter-florian/ShutterPosition1"
    command_topic: "cmnd/shutter-florian/Backlog"
    payload_open: "ShutterOpen1"
    payload_close: "ShutterClose1"
    payload_stop: "ShutterStop1"
    retain: false
    optimistic: false
    qos: 1

Update:

Shutters are now natively supported between tasmota and home-assistant so the configuration from above is not needed anymore.