Skip to content

OpenDTU-OnBattery

OpenDTU-OnBattery controls your inverter by the power at the grid connection — for example for zero export with the Dynamic Power Limiter. It reads that power directly from the WattWächter Tasmota: over HTTP through the Tasmota interface, without an MQTT broker and without an extra meter in the distribution board.

OpenDTU or OpenDTU-OnBattery?

The original OpenDTU only reads the inverter and has no input for a power meter. This guide is for the fork OpenDTU-OnBattery.

In short

URL http://192.168.178.50/cm?cmnd=status%2010 (your WattWächter's IP address)
JSON path StatusSNS/<meter name>/<power field> — e.g. StatusSNS/eHZ/Power; both names are in your meter script
Unit W
Sign positive = import, negative = export — what OpenDTU-OnBattery expects, do not change the sign

Prerequisites

  • The WattWächter Tasmota is set up, connected to your Wi-Fi and shows the current power in its web interface. This applies to the Gen.2 and to the Gen.1 in Wi-Fi mode.
  • Your meter script contains a line for the current power (OBIS 16.7.0). Some meters do not send this value — OpenDTU-OnBattery cannot regulate with them.
  • OpenDTU-OnBattery and the WattWächter are in the same network, and the WattWächter has a fixed IP address in the router (DHCP reservation).
  • Deep Sleep is off: a sleeping WattWächter does not answer requests.

The endpoint

The Tasmota command Status 10 returns all meter values as JSON. Over HTTP you call it like this — the space becomes %20 in the URL:

curl -s "http://192.168.178.50/cm?cmnd=status%2010"
{
  "StatusSNS": {
    "Time": "2026-10-07T21:57:29",
    "eHZ": {
      "E_in": 12345.678,
      "E_out": 42.123,
      "Power": -812
    }
  }
}

Open the URL in a browser once to see the names your script assigns.

Working out the JSON path

The path has three parts, separated by slashes:

StatusSNS/eHZ/Power
Part Where from?
StatusSNS always the same
Meter name (eHZ) sixth field of the script line that starts with +1,
Power field (Power) fourth field after the @ in the line for the current power

Using the script for the EMH eHZ as an example (excerpt):

>M 1
+1,3,s,0,9600,eHZ
1,77070100010800ff@1000,Bezug,kWh,E_in,3
1,77070100020800ff@1000,Einspeisung,kWh,E_out,3
1,77070100100700ff@1,Aktuelle Leistung,W,Power,0

Here the meter is called eHZ and the current power Power. Most scripts call the field Power, some meters use a different name (e.g. Power_cur) — what counts is what your script and the response above show.


Setting up OpenDTU-OnBattery

  1. In OpenDTU-OnBattery open Settings → Power Meter and switch on Enable Power Meter.
  2. Choose HTTP(S) + JSON as the Power Meter Type.
  3. Enter the values from the table.
  4. Check your entries under Test Configuration with Send HTTP(S) request(s) and process response(s) — OpenDTU-OnBattery then shows the power it read.
  5. Save. The power then appears in the live view.
Field Entry
Polling Interval 2 seconds
Individual HTTP(S) requests per value off
URL (value 1) http://192.168.178.50/cm?cmnd=status%2010
Authorization Type None — with a Tasmota web password: Basic, username admin
Timeout 1000 milliseconds
JSON Path StatusSNS/eHZ/Power (adapt to your script)
Unit W
Change Sign off

Value 2 and value 3 stay disabled: the current power already is the sum of all phases.

After that, set up the Dynamic Power Limiter in OpenDTU-OnBattery — it uses the power meter as its control value.


Troubleshooting

“Unable to access JSON key …”

The JSON path does not match the response. Open the URL in a browser and compare meter name and power field character by character — upper and lower case matter.

The response contains no power

Your meter does not send the current power, or the extended data output has not been unlocked yet — see Preparing the meter. If the line is missing entirely from the script for your meter, the meter does not provide the value.

No connection or timeout
  • Has the WattWächter been given a new IP address? Set a DHCP reservation in the router.
  • Does the URL contain %20 instead of a space?
  • Is Deep Sleep active?
HTTP 401

A web password is set in Tasmota. Set the Authorization Type to Basic and enter the username admin and the password.

The inverter regulates in the wrong direction

Change Sign has to be off as long as the WattWächter shows import as positive and export as negative.