HenrikSolver / picowhanport

Ett litet hack för att skicka data från HAN porten på en elmätare till en MQTT broker med hjälp av en raspberry pi pico w.
19 stars 6 forks source link

Potential further development: Split Topic into JSON #1

Open lillknurra opened 1 year ago

lillknurra commented 1 year ago

Hi, I'm able to get the data into Home Assistant, but it's not easy to make use of the data.

Would it be possible to parse the data into several topics in JSON format? From this: image To something like this: { "MeterID":"LGF5E360","1.0.0":"230408233550","1.8.0":"00029737.127","CRC16","0191" }

Or even splitting it further into separate topics...

Thanks, Petter

JL-EU commented 1 year ago

Hi, I'm also trying to get this going, haven't managed to read data from the meter yet. Did you manage to format the data? Thanks, Jacob

lillknurra commented 1 year ago

Hi, Yes I managed by reading the lines that are of interest- I'm using it in home Assistant and created sensors in mqtt.yaml looking like this: sensor:

HenrikSolver commented 7 months ago

I was thinking of this, but then the CRC should be verified before converting the package to JSON, and I thought it was simpler to send the package to "the other side" where verifying the checksum is done by a Go program that stores the data in a influx db.

vilhelmericson commented 6 months ago

Henrik's nice repository helped me a lot to get the values from my electricity meter's HAN port (Kamstrup Omnipower + Kamstrup HAN-P1) for Home Assistant using a Raspberry Pi Pico and MQTT. To do that, I needed to implement support for the steps that weren't part of Henrik's use case; verify the telegram based on the CRC checksum, parse the telegram and pack it as a JSON object and then publish it in the MQTT server. The implementation is in the attached zip file, values for all settings are set in config.py. Attached is also an example of how the JSON objects look. picowhanport_ha.zip telegram.json

HenrikSolver commented 6 months ago

Nice, and first thing on the new year :+1: . I will take a look and add it in one way or another.