Page 1 of 1

Sum from voltage devices

Posted: Saturday 09 November 2019 21:01
by Knibor
Hi,

I tried the sum from 2 voltage devices in dzVents but no succes, could someone help me with this?

Cell Voltage 1 = device 136 virtual device General, voltage
Cell Voltage 2 = device 137 virtual device General, voltage
Sum of voltage device 136 and 137 = device 213. virtual device General, voltage

Code: Select all

return {

	on = {
	    timer = { 'every 1 minutes' }
	},
	
	execute = function(domoticz, item)
	    
	    local Cell1 = domoticz.devices(136)      
	    local Cell2 = domoticz.devices(137)     
	    local totalCells = domoticz.devices(213)  
	    
	    totalCells.updateVoltage(Cell1.Voltage + Cell2.Voltage)
	    
	end
	
}

Re: Sum from voltage devices

Posted: Saturday 09 November 2019 23:26
by waaren
Knibor wrote: Saturday 09 November 2019 21:01 Hi,

I tried the sum from 2 voltage devices in dzVents but no succes, could someone help me with this?

Code: Select all

   totalCells.updateVoltage(Cell1.Voltage + Cell2.Voltage)
The attributes of devices always start lowercase. So here it is

Code: Select all

   totalCells.updateVoltage(Cell1.voltage + Cell2.voltage) 

Re: Sum from voltage devices  [Solved]

Posted: Sunday 10 November 2019 10:45
by Knibor
Hi,

Thanks for the info, now it works!