Page 1 of 1

trigger.Info.trigger with devices

Posted: Friday 17 November 2017 10:54
by Gravityz
Does trigger.Info.trigger also work with devices?
if not i surely hope something will be implemented to check which device triggered an event

another way to check which device triggered an event is to do a device.name==(' ddddd')
problem with this is if you have a long list of devices you will have to name them al to check
wildcards do not work with the check (while they do work with the device trigger list)
also you can only check if a device.name is the same.
would be nice to do a check if the device.name is NOT EQUAL



i am trying to figur out which device triggered the event but it seems that trigger.Info.trigger does not work with devices
return {
active = true,
on = {
Devices = {
'deviceA',
'deviceB'
}
},
execute = function(domoticz, devices, triggerInfo)
-- external light switch name

if (triggerInfo.trigger == 'deviceA') then
external_light.switchOn()
else
external_light.switchOff()
end
end
}

Re: trigger.Info.trigger with devices

Posted: Friday 17 November 2017 10:57
by emme

Code: Select all

execute = function(domoticz, devices, triggerInfo)
                     |          |        \-------- Table for time trigger script
                     |          |
                     |          \----------------- Table with single device/variable that trigger the script
                     |
                      \---------------------------- Entire Domoticz table
so you can use devices.name instead ;)

Re: trigger.Info.trigger with devices

Posted: Friday 17 November 2017 12:45
by Gravityz
ok i understand

i was thinking to difficult