Page 1 of 1

P1 Smart Meter does not update

Posted: Tuesday 08 October 2019 16:21
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
}

Re: P1 Smart Meter does not update  [Solved]

Posted: Tuesday 08 October 2019 16:39
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
}

Re: P1 Smart Meter does not update

Posted: Tuesday 08 October 2019 17:26
by nclgius
Grazie Waaren
Grande!