help with simple lua script

Moderator: leecollings

Post Reply
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

help with simple lua script

Post 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
}
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: help with simple lua script

Post by emme »

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