So I recently purchased a 10 lot of the Iris 3326-L motion sensors in order to add motion to the other rooms of my house. As a result, I like the ability to turn the motion detection on and off at will. At the moment I just want to do it through Alexa but don't really want to have 5 different voice commands that my family and I have to remember, one per room.
This is when I had the idea to use the wasLastSpokenTo
attribute of the Echo Speaks devices and my hope was to have a single "Motion Detection Switch" exposed to Alexa. Then I planned on having RM handle which Alexa that was spoken to and turn on or off the motion detection for that corresponding room.
Now for a single room this will work since Alexa will trigger the main switch and then a if-else tree will turn on/off the corresponding motion disabler/enabler switch. However, if I want to have multiple rooms that is where the issue comes in.
To my knowledge triggers only come when there is a change of state, i.e. on -> off or off -> on. So in my case, let's say that we are trying to disable motion sensing in two rooms, in the first room, the switch exposed to Alexa would turn off, and then the if-else tree will function to turn the corresponding switch off. But the moment someone in a different room tries to turn the motion off in that differet room, that main switch is still off, so RM will not detect a change of state and thus will not trigger.
This is my issue, I want to be able trigger a rule whenever a switch gets an on
or off
command, not just when it's state changes. Any ideas on how to do this or an alternative approach that would not have this issue would be greatly appreciated.