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

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Robert72
Posts: 9
Joined: Saturday 24 December 2022 21:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

P1 power don't match extracted power in dzvents

Post 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.
User avatar
gizmocuz
Posts: 2552
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

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

Post 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
Quality outlives Quantity!
Robert72
Posts: 9
Joined: Saturday 24 December 2022 21:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
}
User avatar
gizmocuz
Posts: 2552
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

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

Post 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)
Quality outlives Quantity!
Robert72
Posts: 9
Joined: Saturday 24 December 2022 21:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
Robert72
Posts: 9
Joined: Saturday 24 December 2022 21:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
User avatar
gizmocuz
Posts: 2552
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

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

Post by gizmocuz »

That might be correct because the P1 is updating maybe every 10 seconds, and your dzVents script once in a minute
Quality outlives Quantity!
Robert72
Posts: 9
Joined: Saturday 24 December 2022 21:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
Robert72
Posts: 9
Joined: Saturday 24 December 2022 21:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
Robert72
Posts: 9
Joined: Saturday 24 December 2022 21:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Robert72 »

I did a fresh install, now the problem seems gone.

Thx for the help!
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest