I made this script but it doens't work the way I want.
Code: Select all
return
{ on = { security = { domoticz.SECURITY_DISARMED, domoticz.SECURITY_ARMEDAWAY } },
execute = function(domoticz, device)
if (device.state == 'SECURITY_ARMEDAWAY') then
domoticz.devices('Dummy Beveiliging').switchOn()
domoticz.executeShellCommand ('mosquitto_pub -h 10.0.1.122 -p 1883 -t domoticz/out/buttonplus/wk1/button/1r/ledrgb -m 8323072')
domoticz.log(device.name)
else
domoticz.devices('Dummy Beveiliging').switchOff()
domoticz.executeShellCommand ('mosquitto_pub -h 10.0.1.122 -p 1883 -t domoticz/out/buttonplus/wk1/button/1r/ledrgb -m 0')
domoticz.log(device.name)
end
end
}