I have this two events and I think they work just fine by them self.
The "problem" is that the Tv has so low standby consumption that the script 1 is triggered right away and turns off the Onkyo.
I came up with a ide while I was writing this post is to create a third script that sets a variable when Samsung_Curent_Consumption.WhActual
is higher then 20.
Add that variable to the if statement in script 1
The TV switch is in general always going to be on as it ha so low stand by.
Any other ideas ?
Script 1)
Code: Select all
return {
active = true,
on = {
devices = {
'Onkyo',
'Samsung_Curent_Consumption'
}
},
execute = function(domoticz, device)
if ((device.name == 'Onkyo' and device.state == 'On') and
(device.name == 'Samsung_Curent_Consumption' and device.WhActual <= 1)) then
domoticz.device('Onkyo').switchOff()
elseif ((device.name == 'Onkyo' and device.state == 'Off') and
(device.name == 'Samsung_Curent_Consumption' and device.WhActual >= 2)) then
domoticz.device('Onkyo').switchOn()
end
end
}Code: Select all
return {
on = {
devices = {
'TV'
}
},
execute = function(domoticz, device)
if(device.staus == 'On') then
domoticz.device('Onkyo').switchOn()
end
end
}