calculation
Posted: Friday 05 June 2020 12:44
help:
I Have a chlorine sensor connected to domoticz. (this is a analog sensor)
name in domoticz: chloor.
I want to make a calculation with the value (devide by 1.4)
That value should then update a dummy sensor named: chloorcal
this is what I have now. But it doesnt work. Any idea anybody?
I Have a chlorine sensor connected to domoticz. (this is a analog sensor)
name in domoticz: chloor.
I want to make a calculation with the value (devide by 1.4)
That value should then update a dummy sensor named: chloorcal
this is what I have now. But it doesnt work. Any idea anybody?
Code: Select all
return {
on = {
timer = {
'every 1 minutes'
},
},
execute = function(domoticz, device, timer)
local chloorcal = domoticz.devices('chloorcal')
local chloor = domoticz.devices('chloor')
local factor = 1.4
local chloorcal = tonumber(domoticz.utils.round (chloor / factor) )
chloorcal.updateCustomSensor(chloorcal)
end
}