Skip to content
Manos1966 edited this page Nov 20, 2024 · 29 revisions

Power Meter supports 6 different providers:

  • MQTT
  • SDM 1 phase (SDM120/220/230)
  • SDM 3 phase (SDM72/630)
  • HTTP(S)+JSON
  • SML/OBIS over serial connection
  • SMA HomeManager 2.0
  • HTTP(S)+SML, e.g., Tibber Pulse (via Tibber Bridge)

Note: Some user experience connection failure while trying to access a device on the same WiFi network.
If you experience this, please ensure that your WiFi router is configured to "allow WLAN devices in the network to communicate with each other". This is a typical problem (no communication between WiFi devices) if you run your OpenDTU-OnBattery on the Guest-WLAN of your Router.

Examples for HTTP(S) + JSON:

Shelly 3EM: Working configuration:

Discussion: #331

Bildschirmfoto 2023-08-19 um 20 36 59

Tasmota

Tasmota returns values and names based on the definitions you put in the script.
(In the script, you need to give your meter a name. Whatever, doesn’t matter, e.g try +1,3,s,0,9600,Wohnung )

The standard command http://192.168.xxx.xxx/cm?cmnd=status%208 (where 192.168.xxx.xxx is the IP Adress of your Tasmota) which, when entered in your Web Browser, will return the values that are available, for example:

{ "StatusSNS": { "Time": "2023-12-10T20:17:41", "Wohnung": { "server_id": "0a01415041010557ff7d", "total_kwh": 819.9, "export_total_kwh": 251.48, "aktuelle_Wirkleistung": 557, "freq": 50, "amp_p1": 0.98, "amp_p2": 0.45, "amp_p3": 1.46, "curr_w_p1": 184, "curr_w_p2": 82, "curr_w_p3": 289, "volt_p1": 240.8, "volt_p2": 240.9, "volt_p3": 241.3, "phase_angle_l2_l1": 238, "phase_angle_l3_l1": 118, "phase_angle_p1": 330, "phase_angle_p2": 325, "phase_angle_p3": 333 } } }

In this case, the value aktuelle_Wirkleistung is the one we need.

In order to extract the correct value, you need to notice the number of curly brackets { and the titles

Based on the example above: {"StatusSNS": {"Wohnung": {"aktuelle_Wirkleistung": 557

Subsequently the JSON Pfad you need to enter is:

StatusSNS/Wohnung/aktuelle_Wirkleistung

Power Meter Tasmota 01

Important for TASMOTA users

Some users have mentioned that their Tasmota report spikes from time to time https://github.com/helgeerbe/OpenDTU-OnBattery/discussions/851

There is a solution to it: Changing the descriptor to send with every change of values:

Tasmota Teleperiod is configurable between 10-300 Seconds. As Standart is 300: Tasmota sends every 5 Minutes. You can go as low as 10 Seconds.

If you need faster than 10 seconds, you have to change the descriptor, the information will be send with every change of values

1,77070100100700ff@1,P,W,P,18
the last entry is the number of digits + an optional flag to send the value as fast as possible code = 16 so 16+2 = 18 means 2 digits + fast send

Example:

If your line looks like this: 1,77070100100700ff@1,P,W,P,0

add 0+16=16 and change it to: 1,77070100100700ff@1,P,W,P,16

Examples for MQTT:

  • Tasmota and MQTT, push seperate values with rules #344

Power Meter uses the same MQTT Server you have defined under Settings-> MQTT Settings

Then, go to Settings -> Power Meter and you can define up to three topics.

There is an example in every line but keep in mind, these are inactive. If you need exactly the same, you have to re-type it yourself.

Capture

Important: For the time being, the MQTT Functionality is not as advanced as with HTTP(s)+JSON

The Topic you choose, must deliver a single value. No JSON Objects, no Strings can be used.

If you are not sure what Data your MQTT Server receives, monitor its log for a while. For example:

None of these Topics (List from MQTT Server) will work: Capture

The first three Topics below will work: Untitled

IF you have problems seeing the data you expect in Live View, it is useful to go to Info-> Console

Messages like this imply that your MQTT Server refused the connection

17:35:55.099 Connecting to MQTT..

17:35:56.209 PowerMeterClass: TotalPower: 0.00

17:35:58.109 Disconnected from MQTT.

17:35:58.168 Disconnect reason:TCP_DISCONNECTED

Tibber Pulse (via Tibber Bridge)

A member has built upon the "HTTP(S) + JSON" Power Meter to support the Tibber Pulse. The current power drawn from the grid is fetched using the local web server from the Tibber Bridge. No external requests through the Internet (Tibber API) required.

To ensure that the consumption values from the Tibber Pulse are always up-to-date and can be read out independently of an Internet connection, the local web server of the Tibber Bridge must be permanently activated. The Tibber Bridge serves raw SML messages at a particular HTTP URL.

Activate the Tibber Bridge web server permanently:

  1. Make a note of the password on the bridge (it is on the QR code), e.g. ABCD-AA11.
  2. Pull out the bridge, plug it in for approx. 1-2 seconds, pull it out and plug it in again.
  3. The ring should now light up green. (No worries, no settings will be lost!).
  4. Connect to the WLAN network 'TibberBridge', the password to be entered is the password noted above.
  5. Once the connection has been established, open http://10.133.70.1/params/ in your browser.
  6. The user name is 'admin' and the password is as noted at the beginning.
  7. Enter the value 'true' at the bottom of the 'webserver_force_enable' attribute and then 'Store params to flash'.
  8. Unplug and plug in again. The Tibber Bridge will now start up normally again.

As soon as the Tibber-Bridge web server has been activated, the credentials can be added in the power meter settings.

'http://{IP}/data.json?node_id=1' must be entered as the URL.

'{IP}' is to be replaced with the IP of the bridge, e.g. 'http://10.133.70.1/data.json?node_id=1'

Select authorization type Basic and enter admin as Username and the password obtained in step 1 above.

SDM & Serial SML

In your pin_mapping.json, see Device Profiles, you need to add a powermeter object like this:

[
  {
    "name": "My Board",
    ...
    "powermeter": {
        "rx": <num>,
        "tx": <num>,
        "dere": <num>
    },
    ...
  }
]

Set unused pins to -1.

The serial SML power meter requires the rx pin to be set, as serial data is received unsolicited and processed when it arrives.

The SDM power meter requires the rx and tx pins are set, as the SDM device is actively queried for data. The dere pin pin is optional and if set, this pin controls the driver enable and receiver enable pins of the RS485 transceiver (the SDM library handles this pin).

Note that using a second Victron MPPT will also conflict with the SDM power meter, and that conflict is not detected (yet).

Clone this wiki locally