1) Give a description of the problem
I have a simple piston I use to turn on a light in my walk-in closet when motion is detected, very basic stuff. I’d like to make it so I can setup a variable with a list of motion devices and make them trigger the corresponding light without having the create the same code for each and every combination of devices. In the code in the screenshot below, I figured I’d replace the first if with if $motionSensorList motion is changes to active and then do another if that would do something like if $currentEventDevice = ‘Walk-In Motion Sensor’ then set $matchingLight = Walk-In Closet Light. It’s the first part of that if that I’m struggling with, I’m not seeing how to make a simple equality on the device, it seems to want me to use a property of said device, which is not what I’m after.
2) What is the expected behavior?
Being able to define a list of motion sensors and corresponding light sensors and be able to use the same code for all
3) What is happening/not happening?
Can’t seem to do $currentEventDevice = Some Specific Physical Device
4) Post a Green Snapshot of the piston
Can’t find a place to upload, but here’s a link: https://app.box.com/s/x6asl3sph9qir8ttylpj2gp8v8ibwpnm