jsphuebner / esp-egycounter

GNU General Public License v2.0
13 stars 2 forks source link

tibber: raw meter data #1

Closed disaster123 closed 1 year ago

disaster123 commented 1 year ago

Do you know what kind of meter data i need? my meter uses binary SML - does it really needs the binary data for tibber send?

jsphuebner commented 1 year ago

Yes I think in that case you send the raw binary data I hope it's in the same MQTT topic as the ASCII data

disaster123 commented 1 year ago

i'm going to send it as hex... and see what happens - currently your tibbersend does not work for me - no idea why - it seems the connection to tibber mqtt does not work... but strangely the on_connect callback gets never called...

disaster123 commented 1 year ago

OK got the connection running but your script fails at:

localclient.subscribe(client.subscribe(config['meter']['rawtopic']))
DEBUG:__main__:Sending CONNECT (u0, p0, wr0, wq0, wf0, c1, k60) client_id=b'c4dee2d135a80'
DEBUG:__main__:Sending SUBSCRIBE (d0, m1) [(b'/sml2mqtt/stromzaehler/rawobis', 0)]
Traceback (most recent call last):
  File "tibbersend.py", line 89, in <module>
    localclient.subscribe(client.subscribe(config['meter']['rawtopic']))
  File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 1504, in subscribe
    raise ValueError("No topic specified, or incorrect topic type.")
ValueError: No topic specified, or incorrect topic type.

i'm not sure what this should do - i tried:

localclient.subscribe(config['meter']['rawtopic'])

which results in continious publish of the obis data - but still no metering shown in tibber app

disaster123 commented 1 year ago

mhm no idea what kind of data or encoding tibber uses for the binary obis / sml. The http://tibber-host.fritz.box/data.json?node_id=1 shows me the binary data and i hoped they use that as well for mqtt - but i can't get it to run - tibber app does not react on your tibbersend script...

disaster123 commented 1 year ago

mhm those binary sml obis messages are endless strings and have markers in it where the next msg starts... but i've no idea what kind of msg tibber uses here and if it encodes those messages in some kind... like base64, hex, ... i tried severeal ones but none worked...

disaster123 commented 1 year ago

contains the rawtopic in your case the same data as in http://tibber-bridge/data.json?node_id=1 ? Or is it parsed in some kind?

disaster123 commented 1 year ago

OK got it working - you need to parse the binary data to the same obis format you mentioned and you have

jsphuebner commented 1 year ago

Sorry, I committed buggy source code there. I reckon they send binary SML to some other topic then, maybe "sml_stream" instead of "obis_stream" Glad it works now.

mdkeil commented 10 months ago

@disaster123

https://github.com/jsphuebner/esp-egycounter/issues/2#issuecomment-1771474407

for the binary sml-stream MQTT topic.