Page 1 of 1

Can I use (all) devices from a hardware id as trigger?

Posted: Friday 25 February 2022 17:06
by Sarcas
I've created a separate hardwareId for a dynamic collection of virtual switches. My script creates the switches when it needs to. But it also has to act when the switch is triggered.

I use myDeviceTriggers = domoticz.hardwareInfo(myHardwareId).idx and I get a table with all the right idx's. But adding myDeviceTriggers to the triggers doesn't work; nothing happens when I activate a switch.

Code: Select all

on= {
	devices = {
		myDeviceTriggers
	},
}
Is it possible at all?

thx

Re: Can I use (all) devices from a hardware id as trigger?

Posted: Friday 25 February 2022 18:01
by heggink
I may be wrong here as I haven't tried it myself but, AFAIK, dzvents can get triggered by different means: devices, groups, scenes, variable but a hardware subsystem isn't part of that. TO get that to work, you would need to add all the devices in that hardware to a group and use the group as a trigger.

Re: Can I use (all) devices from a hardware id as trigger?

Posted: Saturday 26 February 2022 13:23
by Sarcas
heggink wrote: Friday 25 February 2022 18:01 TO get that to work, you would need to add all the devices in that hardware to a group and use the group as a trigger.
Mm, but I would not know which device in the group caused the group-trigger, would I?

Anyway, I 'solved' it by add a prefix to the devices and using a wildcard in the device-triggers. Not very pretty, but it works. Thanks for the reply :)