help with simple lua script
Posted: Thursday 15 February 2018 10:59
So i tried to make my first dcevenz script. I have a dummy switch (selector) on/off and volumecontrol and made a simple script from within the events gui. My reciever does not work with this script... The old lua script works perfect for years...
return {
active = true,
on = {
devices = {
'denon_volume'
}
},
execute = function(domoticz, device)
IP=devices = { domoticz.variables('ipdenon').value } -- this is uservariable
if (device.state == 'On') then
os.execute ("curl http://" .. (IP) .. "/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FON" ); -- zet denon aan
else
os.execute ("curl http://" .. (IP) .. "/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FOFF" ); -- zet denon uit
end
end
}
return {
active = true,
on = {
devices = {
'denon_volume'
}
},
execute = function(domoticz, device)
IP=devices = { domoticz.variables('ipdenon').value } -- this is uservariable
if (device.state == 'On') then
os.execute ("curl http://" .. (IP) .. "/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FON" ); -- zet denon aan
else
os.execute ("curl http://" .. (IP) .. "/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FOFF" ); -- zet denon uit
end
end
}