Page 1 of 1

help with simple lua script

Posted: Thursday 15 February 2018 10:59
by pvklink
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
}

Re: help with simple lua script

Posted: Thursday 15 February 2018 11:10
by emme
try with...

ip = domoticz.variables('ipdenon').value

and then

os.execute('curl "http://'..IP..'/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FON"')