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

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Sarcas
Posts: 86
Joined: Wednesday 11 October 2017 8:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1ß
Location: Friesland
Contact:

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

Post 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
--

Domoticz on rPi4 - RFXCOM RFXtrx433 USB - ZW090 Z-Stick Gen5 EU - IKEA Tradfri - Philips HUE - YouLess meter - SolarEdge
User avatar
heggink
Posts: 979
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

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

Post 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.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
Sarcas
Posts: 86
Joined: Wednesday 11 October 2017 8:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1ß
Location: Friesland
Contact:

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

Post 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 :)
--

Domoticz on rPi4 - RFXCOM RFXtrx433 USB - ZW090 Z-Stick Gen5 EU - IKEA Tradfri - Philips HUE - YouLess meter - SolarEdge
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest