Page 1 of 1

P1 power don't match extracted power in dzvents

Posted: Sunday 25 December 2022 10:30
by Robert72
Hi all,

I have domoticz 2022-2, running on a Pi and try to calculate with the power from P1, adding PV power.
I extract the power with devices('Power').actualWatt
(trigger is the power change)

and update this value, directly in a new virtual device UsedPower. No calculations made yet, for now.

Somehow the value is not equal and I can't figure why.

I cant post images yet, but in the link here without the spaces, you see the difference, and the log:
Power = 561 Watt
Used power = 621 Watt

image
h ttps://postimg. cc/vcNKfp78
image

Why does this happen? What I am doing wrong?

Thanks in advance.

Re: P1 power don't match extracted power in dzvents

Posted: Sunday 25 December 2022 12:51
by gizmocuz
Maybe when we see your code we could understand where it might go wrong.
What happens when you make a very small test script where you put 1234 in the UsedPower device, does this work?
Also note that the P1 usage value could change every 10 seconds

Re: P1 power don't match extracted power in dzvents

Posted: Sunday 25 December 2022 13:14
by Robert72
Hi gizmocuz,

I wasn't able to post code and images, but somehow now I am. See code below.
If I make Allpower 1234, this is shown in the meter.

Code: Select all

return
{
    on =
    {
        devices =
        {
            'Power',
        },
    },
    execute = function(domoticz, item)
        local Allpower = domoticz.devices('Power').actualWatt
        local Verbruik = domoticz.devices(163) 
        Verbruik.updateEnergy(Allpower)
    end
}

Re: P1 power don't match extracted power in dzvents

Posted: Sunday 25 December 2022 13:23
by gizmocuz
Maybe 'Power' is not the right trigger here, the P1 has up to 4 different sensors it could update (low/high usage and return)

Could you try a trigger every 10 second and see if that goes better?

domoticz.devices(163).updateEnergy(Allpower)

Re: P1 power don't match extracted power in dzvents

Posted: Sunday 25 December 2022 14:05
by Robert72
Hi gizmocuz,

I think P1 has even 6 values:

Image

I know how to create a minute trigger, how do I create a 10 seconds one?

Regards.

Re: P1 power don't match extracted power in dzvents

Posted: Sunday 25 December 2022 14:25
by Robert72
I made the every minute timer now, waited to see the AllPower value change in the meter, but it's still not equal to the power meter when it updates.

Re: P1 power don't match extracted power in dzvents

Posted: Sunday 25 December 2022 14:32
by gizmocuz
That might be correct because the P1 is updating maybe every 10 seconds, and your dzVents script once in a minute

Re: P1 power don't match extracted power in dzvents

Posted: Sunday 25 December 2022 14:46
by Robert72
No, I think the value of the P1 is updating every second. The power meter changes constantly.

But if the script runs, I thought the Allpower meter would take over the value of the Power meter, but that's not happening.

Re: P1 power don't match extracted power in dzvents

Posted: Sunday 25 December 2022 15:05
by Robert72
Hmm, I think it's a bigger issue. I looked at the KWH meter directly, comparing it with the values in domotics.
Can you open this dropbox link? Looks like communication between the KWH meter and domoticz is wrong, is'nt it?
The video also shows the wrong value in Allpower meter.

https://www.dropbox.com/sh/e464jmt7s9fo ... 3oiea?dl=0

Re: P1 power don't match extracted power in dzvents  [Solved]

Posted: Sunday 25 December 2022 16:17
by Robert72
I did a fresh install, now the problem seems gone.

Thx for the help!