help with simple lua script

Post Reply
pvklink
Posts: 127
Joined: Wednesday 12 November 2014 16:01
Target OS: Raspberry Pi
Domoticz version:
Contact:

help with simple lua script

Post by pvklink » Thursday 15 February 2018 11: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
}

User avatar
emme
Posts: 951
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: help with simple lua script

Post by emme » Thursday 15 February 2018 12:10

try with...

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

and then

os.execute('curl "http://'..IP..'/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FON"')
The most dangerous phrase in any language is:
"We always done this way"

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest