Closed vlcty closed 1 year ago
Hm. Strange output...
The "detect" code looks simplified:
for try_count in range(5):
data = ser.readline()
if data.endswith(b'\r\n'):
# found!
Think your Hichi is not configured correctly?!? Seems that this is a kind of binary data? Normally it should look like this:
You can try to ask here: https://www.photovoltaikforum.com/thread/145886-habe-lesk%C3%B6pfe-mit-usb-%C3%BCber/
I did not know that you can configure the hichi. I'm going to check that. But thanks for the sample how it should look like. It seems that my meter sends binary data.
If anybody comes across the same issue: I've an EMH eHZ-KW8E2A5L0EQ2P meter and a Hichi USB Version.
When I check the raw serial output with minicom -D /dev/ttyUSB0 -b 9600 -H
it can see the raw SML Message beginning with 1b 1b 1b 1b
which is the start sequence. So it's in fact binary representation. I'll try to come up with a patch for this software to detect it. Maybe it just needs a binary to ASCII converson before futher processing.
@dmaj started to implement raw SML Message parsing here: https://github.com/jedie/pysmartmeter/pull/31 But this implementation needed much work before i can merge this.
The Question is: How to switch the Hichi from binary to ASCII mode? Maybe it's possible to do this via Serial?
I don't think the USB or TTL versions of the Hichi adapter contain any logic that can be "switched" in any way. Meters send either OBIS protocol (readable text) or SML protocol (binary data), and pysmartmeter can only handle OBIS protocol.
The WIFI version of the Hichi has an ESP01s with Tasmota built in, which does the decoding for you.
Ah! Thanks for the explanation.
I add a info in readme in https://github.com/jedie/pysmartmeter/commit/8d3941997ded57bab1b4cc8556e1fa6cc2269838 and create a TODO ticket here: https://github.com/jedie/pysmartmeter/issues/37
Looking at https://wiki.volkszaehler.org/software/sml it doesn't look too difficult ;) Maybe a nice topic for a weekend sprint ;) And a implementation exists with https://pypi.org/project/pysml
I get the following error:
Apparently it can read something from the Hichi but can't process it? Running on a Raspi 3 with Archlinux ARM. Power meter is from EMH and it apparently sends a "reduced dataset". Maybe this causes the problem?