P1 SMART METER GRAPH VALUE NOT ALIGNED WITH TIME
Posted: Wednesday 31 January 2018 13:46
I have an issue regarding P1 smart meter used as dummy device.
I'm using domoticz in a old laptop with raspberry pi desktop as OS. I measure electric current from transducer connected to denkovi daenetip4 board. This board is automatically recognized by domoticz and I have ampere value adsorbed by the house and produced by photovoltaic cells on domoticz without problem.
Then I use this values to feed data to P1 smart meter.
The problem is that data shown in P1 smart meter are from my point of view wrong, I understood that in the graph power data is calculated from the energy but:
First question: why calculate power from energy if in the meter I have also power info?
Graph is updated every 5 minutes and the power is the AVG value of power related to the energy produced in that 5 minutes. The problem is that sometimes the script that update the meter looks to work earlier than my script and sometimes later... In fact if I setup a P1 smart meter and I feed to it 10wh every 1 minute I should have a constant power of 600 watt but really I have a value that changes between 480 and 720 watt. In fact the energy usage in 5 minutes should be always 50wh but sometimes is 40 or 60.
My script is setup as time script and it runs once a minute:
commandArray = {}
EE1, EE2, EE3, EE4, PP1, PP2 = string.match(otherdevices_svalues['prova'], "(%d+%.*%d*);(%d+%.*%d*);(%d+%.*%d*);(%d+%.*%d*);(%d+%.*%d*);(%d+%.*%d*)")
aa1 = EE1+10
aa1 = tostring(aa1)
commandArray[4]={['UpdateDevice'] = 37 .. '|0|' .. aa1..";" .. 0 ..";" .. 0 ..";" .. 0 ..";" .. 0 ..";" .. 0}
return commandArray
Any idea to solve this?
I'm using domoticz in a old laptop with raspberry pi desktop as OS. I measure electric current from transducer connected to denkovi daenetip4 board. This board is automatically recognized by domoticz and I have ampere value adsorbed by the house and produced by photovoltaic cells on domoticz without problem.
Then I use this values to feed data to P1 smart meter.
The problem is that data shown in P1 smart meter are from my point of view wrong, I understood that in the graph power data is calculated from the energy but:
First question: why calculate power from energy if in the meter I have also power info?
Graph is updated every 5 minutes and the power is the AVG value of power related to the energy produced in that 5 minutes. The problem is that sometimes the script that update the meter looks to work earlier than my script and sometimes later... In fact if I setup a P1 smart meter and I feed to it 10wh every 1 minute I should have a constant power of 600 watt but really I have a value that changes between 480 and 720 watt. In fact the energy usage in 5 minutes should be always 50wh but sometimes is 40 or 60.
My script is setup as time script and it runs once a minute:
commandArray = {}
EE1, EE2, EE3, EE4, PP1, PP2 = string.match(otherdevices_svalues['prova'], "(%d+%.*%d*);(%d+%.*%d*);(%d+%.*%d*);(%d+%.*%d*);(%d+%.*%d*);(%d+%.*%d*)")
aa1 = EE1+10
aa1 = tostring(aa1)
commandArray[4]={['UpdateDevice'] = 37 .. '|0|' .. aa1..";" .. 0 ..";" .. 0 ..";" .. 0 ..";" .. 0 ..";" .. 0}
return commandArray
Any idea to solve this?