P1 Smart Meter does not update  [Solved]

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

Moderator: leecollings

Post Reply
nclgius
Posts: 7
Joined: Friday 26 July 2019 11:18
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10
Location: Italia
Contact:

P1 Smart Meter does not update

Post by nclgius »

My device P1 Smart Meter with idx 73, does not update
Tanks

Code: Select all

UpdateDev('Power',0,'12;1;0;0;300;0')

Code: Select all

-- Contatore potenza
return {
    on = {  
        timer = { "every 1 minutes"}
        },

    execute = function(dz,trigger)

        local device_power = dz.devices(72).getupvalue

        print(dz.devices(72).state)
 
        UpdateDev('Power',0,'12;1;0;0;300;0')
    
    end
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: P1 Smart Meter does not update  [Solved]

Post by waaren »

nclgius wrote: Tuesday 08 October 2019 16:21 My device P1 Smart Meter with idx 73, does not update
Tanks
[/code]
There are a couple of unknow dzVents commands in your script.

Try this one:

Code: Select all

-- Contatore potenza
return {
    on = {  
        timer = { "every 1 minutes"}
        },
    
	logging = { level = domoticz.LOG_DEBUG, marker = 'power update' },
	
    execute = function(dz)

        local power = dz.devices(73)
        
        dz.log('Power state:   ' .. power.state,dz.LOG_FORCE)
        
        power.update(0,'12;1;0;0;300;0')
    
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
nclgius
Posts: 7
Joined: Friday 26 July 2019 11:18
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10
Location: Italia
Contact:

Re: P1 Smart Meter does not update

Post by nclgius »

Grazie Waaren
Grande!
Post Reply

Who is online

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