Skip to content

Home Assistant (WiFi)

In Wi-Fi mode the WattWächter WiFi/USB publishes its meter readings to your home network via MQTT. Home Assistant picks them up through its built-in Tasmota integration — the device is discovered automatically, with no USB cable at the Home Assistant server and no cloud. This guide applies to Gen.1 and Gen.2; the few differences are listed at the end of the page.

Two ways to Home Assistant

  • Via WiFi (this page) — the device stays at the meter, data arrives via MQTT. Works anywhere in the house.
  • Via USB — the device is plugged into the Home Assistant server's USB port, see Home Assistant (USB). Only practical if the server sits right next to the meter.

Use only one of the two, otherwise the meter shows up twice.

Prerequisites

  • WattWächter WiFi/USB is set up: connected to WiFi, reading script active, and the meter readings appear on the main page of its web interface
  • Home Assistant with an MQTT broker — on Home Assistant OS/Supervised the Mosquitto broker add-on, otherwise a broker of your own on the network
  • Gen.1 in Wi-Fi mode (factory default, see Select operating mode); on Gen.2 it is always active

Step 1 — MQTT broker in Home Assistant

If you do not have a broker yet:

  1. SettingsAdd-onsAdd-on Store → install and start Mosquitto broker
  2. SettingsDevices & Services — the MQTT integration is now suggested automatically; confirm with Configure
  3. Under SettingsPeopleUsers create a dedicated user for the WattWächter (e.g. wattwaechter). The Mosquitto add-on accepts every Home Assistant user as an MQTT login.

You will need the IP address of your Home Assistant server as the broker host in a moment.

Your own broker

With an external broker (e.g. Mosquitto on a Raspberry Pi), enter its IP and credentials both in Home Assistant's MQTT integration and in the WattWächter. If you maintain an ACL file there, the WattWächter needs write access to tasmota/discovery/#.


Step 2 — Set up MQTT on the WattWächter

Open the WattWächter's web interface (the IP address from the setup) and go to ConfigurationConfigure MQTT.

Field Entry
Host IP address of the Home Assistant server or of the broker
Port 1883
Client leave unchanged
User / Password the user created in step 1
Topic leave unchanged — this is the device's unique name on the MQTT network. Note it down, you will need it for checking.
Full Topic leave unchanged (%prefix%/%topic%/)

Save restarts the WattWächter and connects it to the broker.

Do not change the Full Topic

Home Assistant's Tasmota integration relies on the default structure %prefix%/%topic%/. With a different Full Topic the device is not discovered.

Check: On the main page under Information, MQTT Host shows your broker and MQTT Connected says yes. In ToolsConsole a line MQT: tele/<topic>/SENSOR = {…} with your meter readings appears every few minutes.


Step 3 — Tasmota integration in Home Assistant

  1. SettingsDevices & ServicesAdd Integration
  2. Search for Tasmota and select it
  3. Confirm the suggested discovery prefix tasmota/discovery with Submit

The WattWächter appears as a new device within seconds — automatic discovery is enabled in Tasmota by default (SetOption19 0).

If it does not, enter this once in the WattWächter's console (ToolsConsole):

SetOption19 0

Step 4 — Check the sensors

You will find the device under SettingsDevices & ServicesTasmota. It brings one sensor for every value in the reading script. The names are made up of the script's prefix and the label of the respective line — with the WattWächter scripts typically:

Sensor Meaning Source in the script
… E_in Total import (kWh) E_in
… E_out Total export (kWh) E_out
… Power Current active power (W), negative when exporting Power

Depending on the script there are more (power per phase, voltages, meter number …). The integration also creates a few status sensors of the device (WiFi signal, uptime …), which are disabled by default.

Values arrive every 5 minutes

Tasmota publishes the meter readings as telemetry, by default every 300 seconds. So it can take up to five minutes until the first value shows up. Shorten it under ConfigurationLoggingTelemetry period (minimum 10 s) — see FAQ → Adjusting the MQTT interval.


Step 5 — Add units and the Energy dashboard

Tasmota does not transmit units. Home Assistant knows the unit watt for the label Power by itself; the energy counters E_in and E_out, however, arrive without a unit and cannot be added to the Energy dashboard as they are.

The cleanest solution is two template sensors in configuration.yaml that take over the value and add unit, device class and state class. Replace sensor.tasmota_… with the entity IDs from step 4:

template:
  - sensor:
      - name: "Meter Import"
        unique_id: wattwaechter_import
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing
        state: "{{ states('sensor.tasmota_e_in') | float(0) | round(3) }}"
        availability: "{{ states('sensor.tasmota_e_in') not in ['unknown', 'unavailable'] }}"

      - name: "Meter Export"
        unique_id: wattwaechter_export
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing
        state: "{{ states('sensor.tasmota_e_out') | float(0) | round(3) }}"
        availability: "{{ states('sensor.tasmota_e_out') not in ['unknown', 'unavailable'] }}"

After Developer toolsYAMLReload template entities the two sensors are available.

Then: SettingsDashboardsEnergyElectricity gridAdd consumption = Meter Import; Add return = Meter Export. The dashboard fills with the first data after about two hours.

Import only?

Without a PV system the first sensor is enough; E_out then stays at 0 or is missing from the script.


Alternative: MQTT sensors by hand

If you prefer not to use the Tasmota integration — for example because the Full Topic has been changed for other reasons — you can read the values directly from the telemetry topic. Units and classes are defined right there, template sensors are not needed.

Insert <topic> from step 2 and <prefix> from the first line of your script's >M block (e.g. MT681, DD3 — the label after the baud rate):

mqtt:
  sensor:
    - name: "Meter Import"
      unique_id: wattwaechter_import
      state_topic: "tele/<topic>/SENSOR"
      value_template: "{{ value_json['<prefix>']['E_in'] }}"
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing

    - name: "Meter Export"
      unique_id: wattwaechter_export
      state_topic: "tele/<topic>/SENSOR"
      value_template: "{{ value_json['<prefix>']['E_out'] }}"
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing

    - name: "Meter Power"
      unique_id: wattwaechter_power
      state_topic: "tele/<topic>/SENSOR"
      value_template: "{{ value_json['<prefix>']['Power'] }}"
      unit_of_measurement: "W"
      device_class: power
      state_class: measurement

The WattWächter's console shows what the message looks like exactly (MQT: tele/<topic>/SENSOR = {"Time":"…","<prefix>":{"E_in":…,"E_out":…,"Power":…}}) — base your value_template paths on that.


Differences Gen.1 / Gen.2

Gen.1 Gen.2
Wi-Fi mode via jumpers, active ex works (operating mode) always active
MQTT setup identical identical
Encrypted MQTT (TLS) not available — use port 1883 on the home network possible, not needed for this guide
Factory reset see FAQ → Reset hold the function button for 7 seconds

Troubleshooting

Device does not appear in Home Assistant
  • Does MQTT Connected on the WattWächter's information page say yes? If not: check host, port and credentials; with Mosquitto the user has to exist in Home Assistant.
  • Is the Tasmota integration set up in Home Assistant (not just MQTT)?
  • Enter SetOption19 0 in the WattWächter's console — this re-sends the discovery message.
  • Full Topic must be %prefix%/%topic%/.
  • With your own broker and an ACL: write access to tasmota/discovery/# is missing.
Device is there, but the meter sensors are missing or unknown
  • Does the WattWächter's main page show values? If not, the problem is the reading script or the position at the meter — see Setup and FAQ.
  • Wait up to 5 minutes (telemetry interval) or enter TelePeriod 10 in the console to speed it up.
  • After changing the script, Home Assistant creates new sensors; old ones remain as unavailable and can be deleted.
Sensor cannot be selected in the Energy dashboard

The sensor lacks device_class: energy and state_class: total_increasing — see step 5.

Values in Home Assistant do not match the meter

The WattWächter transmits exactly what the script reads. Check the value on the WattWächter's main page; if it is already off there, the decimal factor in the script line is wrong — see Meter scripts.

Further reading: Tasmota docs → Home Assistant, Home Assistant → Tasmota integration, Tasmota → Smart Meter Interface.