Quantcast
Channel: HomeSeer Message Board
Viewing all articles
Browse latest Browse all 4847

Determining which device triggered an event

$
0
0
I have an audio matrix which controls the audio in each room/zone of my building. Each room/zone is set up as it's own device.

I have written a script which controls the audio matrix and turns a zone on or off. The script is written in a way so that multiple zones can all use the same script (sub) and the correct zone is turned on/off.

Currently, each Device/Zone has a one-to-one match with it's own event which then passes the correct parameters to the script so it knows which zone to control.

I also have the same for a zone's volume control. In total, I have three events per zone (power on/off, vol up, vol down).

Doing this is OK when there are just a couple of zones. Right now I only have 5 zones which means 15 total events. However, I am about to increase my number of zones significantly (50+) which would mean at least 150 events. That will be extremely tedious to create and maintain. :eek:

Main Question: Is there a way to simplify all of this and not need separate events per device/zone? Rather than passing a Device ID (or other similar identification) via an event parameter, is there any way for a script or event to figure out which device triggered the event? That way, I could just have 3 events (power, vol up, vol down) and based upon which device triggered these events, the script would know which zone to control.

I guess an alternate would be to skip events and trigger the script directly from the device. Is that even possible? Is that what RegisterStatusChangeCB does? :confused:

Viewing all articles
Browse latest Browse all 4847

Trending Articles