HeishaMon icon indicating copy to clipboard operation
HeishaMon copied to clipboard

Value of S0-Meter does not fit to Heishamon Data

Open Skol6 opened this issue 1 year ago • 13 comments

Hi Folks,

I have installed 2 S0-Meter with the Heishamon. Weird thing is the values do not fit together:

S0 port 1: data on the display: 2692,22 data in heishamon (WattHourTotal): 31867 S0 port 2: data on the display: 215,72 data in heishamon (WattHourTotal): 0

Settings: image

Info from JSON: "s0":[{"S0 port":"1","Watt":"11","Watthour":"31868","WatthourTotal":"31868","PulseQuality":"100","AvgPulseWidth":"90"}, {"S0 port":"2","Watt":"0","Watthour":"0","WatthourTotal":"0","PulseQuality":"100","AvgPulseWidth":"0"}]}

Measuring device: Orno WE-521 - Meter constant 1000 imp/kWh #, Pulse length 90ms

Setting: Iobroker with MQTT image

The values for current watt seem to be plausible. Any ideas? What am I doing wrong?

Skol6 avatar Oct 02 '23 19:10 Skol6

Hi, The S0 only counts when heishamon is running. It can't read what the display says. But it should stay around the same if you start from the same number. You can set the start number on the heishamon by powering off heishamon, then send the real WatthourTotal number to the mqtt topic with retain option enabled and then power on heishamon. It will then read that stored mqtt value as the new real value.

Why the 2nd port isn't counting I can't tell. Probably it hasn't been active yet since heishamon started.

IgorYbema avatar Oct 02 '23 19:10 IgorYbema

Hi, thanks for the information. Great its working!!! So easy when you know what you are doing :) port":"1","Watt":"0","Watthour":"2693","WatthourTotal":"2693","PulseQuality":"100","AvgPulseWidth":"90"},{"S0 port":"2","Watt":"0","Watthour":"215","WatthourTotal":"215","PulseQuality":"100","AvgPulseWidth":"0"}]}

Now I only need to compare the values for a few days to see if the keep similar.

Skol6 avatar Oct 02 '23 20:10 Skol6

Hi, next question/problem: Heishamon values are running much faster than the values on the Orno WE-521. Comparison: value yesterday set to 2693 (Orno was 2692,22) Heishamon today: 4328 vs Orno 2693,87

How can this be? Regards

Skol6 avatar Oct 03 '23 18:10 Skol6

heishamon is in Watthour, your Orno shows kWh.

Heishamon: 4328 - 2693 = 1635wH = 1.635kWh Onro: 2693,87 - 2692,22 = 1,65kWh

So almost the same.

You must set value of heishamon to same value, so set it to 2693870 now.

IgorYbema avatar Oct 03 '23 18:10 IgorYbema

Oh no!! You are so right! Seems to be plausible and will be tested immediately. Thanks again. Merci! Vielen Dank. Das gibts ja nicht.

Skol6 avatar Oct 03 '23 20:10 Skol6

I also have a question regarding that as i also use the Orno meters. I knew the behavior, Heishamon only counts the pulses, sure. If the MQTT Server stays alive and Heishamon reboots, Heishamon will read the value and continue counting. No problem.

However if there is like a power outage and Heishamon + MQTT server is down, it starts from 0 if there is no additional tool which reads the last value from the database and pushes it to the MQTT server, before 0 is written to the database. (Feasable, but sounds unnecessary complicated to me)

Is it possible that Heishamon saves the Watthour values in a non-volatile memory area like it does with the Rules? At least every full KiloWattHour? (To reduce memory access, if that is a problem at all.)

If it counts from 0 after a power outage and the values are written to the database and at least I dont know how to manipulate wrong values inside the InfluxDB 1 on my raspberry to correct the graph which is created. But a deviation of only 1 Kilowhatthour would not be an issue at all.

Or did i get something wrong?

Bender2k avatar Oct 06 '23 22:10 Bender2k

I also have a question regarding that as i also use the Orno meters. I knew the behavior, Heishamon only counts the pulses, sure. If the MQTT Server stays alive and Heishamon reboots, Heishamon will read the value and continue counting. No problem.

However if there is like a power outage and Heishamon + MQTT server is down, it starts from 0 if there is no additional tool which reads the last value from the database and pushes it to the MQTT server, before 0 is written to the database. (Feasable, but sounds unnecessary complicated to me)

Is it possible that Heishamon saves the Watthour values in a non-volatile memory area like it does with the Rules? At least every full KiloWattHour? (To reduce memory access, if that is a problem at all.)

If it counts from 0 after a power outage and the values are written to the database and at least I dont know how to manipulate wrong values inside the InfluxDB 1 on my raspberry to correct the graph which is created. But a deviation of only 1 Kilowhatthour would not be an issue at all.

Or did i get something wrong?

This is indeed a general problem however saving any value older than the current one gives the same problem as it will 'go back' in time. Maybe you can create a check into your mqtt->influx routine that it never stores a value which is lower than the previous stored value?

Restoring the correct value to heishamon is explained above. I hope to add a feature to change the kWh value in the web interface later.

IgorYbema avatar Oct 11 '23 19:10 IgorYbema

This is indeed a general problem however saving any value older than the current one gives the same problem as it will 'go back' in time.

I fully understand! But as i said, it wont be a problem for the total consumption if 1kWh is missing. Even after 5 power outages, i can add the 5kWh after days or weeks manually without having a noticeable influence in the graph or calculations. Also i think Total Watthour is the only value within Heishamon at all who creates an issue like that.

Maybe you can create a check into your mqtt->influx routine that it never stores a value which is lower than the previous stored value?

If you would have planned a feature for Heishamon to take care, i would have waited. Thats why i just wanted to ask. :)

As i use NodeRed to write the MQTT values to InfluxDB, i think your idea will work, thank you for the idea! It's better to not write values at all and have gaps in the graph, than writing wrong values.

My first idea was, that after a power outage, NodeRed picks the value from the InfluxDB and pushes it to the MQTT server. But this does not work as Heishamon is booting faster than my NodeRed/MQTT and Heishamon will then no longer pickup the value from the MQTT server. Thats also not fail safe and the wrong approach in my eyes.

Thank you for your work and thank you for improvements!

Bender2k avatar Oct 11 '23 19:10 Bender2k

I forgot to mention that saving the current value to the flash of heishamon on a regular base isn't good for the flash itself. It can destroy the flash after too many writes. That's why we don't do that currently.

But thinking ahead. Maybe I just add a mqtt restore topic (next to the already mentioned method to restore over mqtt during boot) like /s0/WatthourTotal/1/restore and then the value which heishamon then always listens to and restores this value as the new value. You can then always restore the correct value using nodered when it thinks that it needs to overwrite it.

IgorYbema avatar Oct 11 '23 19:10 IgorYbema

Ok, the write argument is ofc a killer for this feature.

The topic is also a very good idea! NodeRed can then check the received value and if its below it can send the Database Value + the received one to the topic.

Additional idea: Add an option in "Settings" to block sending the WattHourTotal values until Heishamon could read a value greater than 0 from the MQTT server. :)

This option changes your already existing "read" mechanism after reboot just to an "read until" mechanism. Then you dont need the second topic.

It also avoids that wrong values are ever sent until the value was set. This makes is easier for someone with an easier setup who wants to correct the value by hand and eliminates the need for evaluation and blocking database transfer with NodeRed or any other tool.

Bender2k avatar Oct 11 '23 20:10 Bender2k

Moin moin, Ich bekomme die Werte nicht geändert. Was muss ich als Befehl in die Zeile (Mqtt-Explorer) schreiben?

haegele100 avatar Nov 04 '23 13:11 haegele100

Moin moin, Ich bekomme die Werte nicht geändert. Was muss ich als Befehl in die Zeile (Mqtt-Explorer) schreiben?

Du musst den Haken bei "retain" setzen.

Bender2k avatar Nov 04 '23 13:11 Bender2k

Moin moin, ich bekomme die Werte nicht geändert. Was muss ich als Befehl in die Zeile (Mqtt-Explorer) schreiben?

Du musst den Haken bei „retain“ setzen.

Habe ich gemacht. Er übernimmt dem Wert einfach nicht. Heishamon aus. Wert gesetzt. Heishamon wieder an. Geht nicht. Eventuell defekt? Muss ich in den Einstellungen Heishamon etwas ändern?

Thema erledigt! Schreibfehler im Mqtt-Explorer (panasonic_heat_pump/s0/WatthourTotal/1) h kleinschreiben

haegele100 avatar Nov 04 '23 13:11 haegele100