Page 1 of 1

P1 Smart Meter populated via API, incorrect readings displayed

Posted: Monday 22 October 2018 23:49
by joostvanderlinde
I readout one of my meters via IR and submit the values to the Domoticz API every 5 minutes.
For that purpose I have setup a dummy P1 Smart Meter in Domoticz (because that devices takes Consumption and Power in one go).

Example of the JSON:

Code: Select all

http://192.168.8.3:8080/json.htm?type=command&param=udevice&idx=202&nvalue=0&svalue=0;2349800;0;0;2745;0
This JSON gives the data with Consumption meterreading 2349.800kWh and actual Power of 2745W.

This USUALLY works ok, but more than once a day, it seems Domoticz is not able to process the data (I checked it more than once the API call has the correct JSON data!). Instead it either shows zero values (most of the time for Power) or very high values (most of the time for Consumption).
You can see this in the graphs as well:
Capture.PNG
Capture.PNG (72.63 KiB) Viewed 1378 times
Any clue, anyone??

Re: P1 Smart Meter populated via API, incorrect readings displayed

Posted: Friday 23 November 2018 21:31
by pfer10
I see something similar. Also what does you P1 smart meter look like in the GUI? I saw a another shot in the forums and it looked totally different.


Image


I have a zwave power meter and I trigger a dzevents when it is updated. If the power is negative (solar generating more than the house) I send it to the last field. If it is positive I send it to the next to last field. On my grpahs I don't get anything so I am surprised you get something. Maybe it is because I am sending 0 to all the other fields?

if device.WhActual < 0 then
P1Meter.updateP1(0,0,0,0,0,device.WhActual)
else
P1Meter.updateP1(0,0,0,0,device.WhActual,0)
end

Re: P1 Smart Meter populated via API, incorrect readings displayed

Posted: Friday 23 November 2018 22:16
by pfer10
I get this value every now and then for some reason.


Image

Re: P1 Smart Meter populated via API, incorrect readings displayed

Posted: Friday 23 November 2018 23:22
by gordonb3
I don't think this `actual power` field is really used. Graphs in fact show a calculated value from delta consumption divided by time frame to give you an average usage rather than whatever would be the snapshot usage from that particular moment. Are you certain that your API calls are firing when you think they are supposed to?

Re: P1 Smart Meter populated via API, incorrect readings displayed

Posted: Saturday 24 November 2018 1:44
by pfer10
I put tonumber() before passing it back to updateP1 and that seemed to take care of it. Would you happen to know why my graph only shows usage 1 and usage 2 like the above from the other poster? Also GUI on the energy tab looks different than others that have posted for a P1 Smart Meter.