Question about the use of activated device
Posted: Wednesday 26 July 2017 18:30
Hello,
I have a question. It it possible to retrieve the device IDX that is responsible for the actual trigger? Like in this little script:
return {
active = true,
on = {
devices = { 'SENSOR_*' } ( or perhaps in something like this: "devices = {74, 21, 71, 164}" )
},
execute = function(domoticz, sensoren)
if sensoren.state == 'Open' then
domoticz.devices('Magneetsensors').switchOn()
domoticz.log('<font color="red">Een deur- of raamsensor is geactiveerd.</font>', domoticz.LOG_INFO)
end
end
}
I would like to use the activated sensor in another script or put the value in a variable.
Thanks again for all the excellent work!
Regards, Rob
I have a question. It it possible to retrieve the device IDX that is responsible for the actual trigger? Like in this little script:
return {
active = true,
on = {
devices = { 'SENSOR_*' } ( or perhaps in something like this: "devices = {74, 21, 71, 164}" )
},
execute = function(domoticz, sensoren)
if sensoren.state == 'Open' then
domoticz.devices('Magneetsensors').switchOn()
domoticz.log('<font color="red">Een deur- of raamsensor is geactiveerd.</font>', domoticz.LOG_INFO)
end
end
}
I would like to use the activated sensor in another script or put the value in a variable.
Thanks again for all the excellent work!
Regards, Rob