Forums : An interesting question about Switches and Rules
This page last changed on Dec 08, 2013 by mbarne36.
I have hit a snag and need your collective advice.
My problem is this; I have an OpenRemote layout that controls multiple pieces of equipment in multiple rooms. I have switches on the control panel that determine the "room" I am in, and the "activity" I am controlling (Media Player, DVD, TV etc).
I have rules set up so that when I press the "Lounge" switch, I deactivate all other room switches, and my rules engine knows I am in the Lounge, and all other "room" switches go into greyed out state.
I also have rules set up so that when I press the "TV" switch, I deactivate all other activities, and my rules engine knows I am wanting to watch TV, and all other activity switches go into greyed out state.
Ok, so imagine my layout... I press TV activity and all other switches on the layout that relate to TV are turned by my rules into active state, and all switches on my layout that do not relate to the TV are set to inactive state and thus greyed out.
Example: I have Play and Record switches on my layout. When I press the activity for "DVD", my rules put these switches into their active state and they highlight. But when I press the activity for "TV", I don't need the Play and Record switches, so my rules put these switches into their deactivated (greyed out) state.
Everything works fine so far... and the glory of this is that things like the volume buttons can be told to control the right piece of equipment in the right room (depending upon the state of the Room and Activity switches) - all from the same screen and layout.
Ok, so now my problem... my rules are set to fire when one of the function switches goes to "on". Of course. So when I press "play", my rule knows which room I am in and what activity I am doing and sends the appropriate "play" command to the appropriate piece of equipment. But... my problem is that when you press the switch for Lounge, and the activity for DVD, and when my rule activates the "Play" button, it also fires it. So the very act of sending an "on" to the Play switch to stop it being off and greyed out, not only highlights it (good), but also sends the "play" command (bad) - before I press it.
so, how do I disassociate the action of enabling and disabling switches, without sending On and Off commands from my rules, which (of course) end up sending On and Off Commands, when all I want to do it enable and disable the buttons.
oh.. and of course, I am using Virtual In-Memory variables for the switches and sensors, and just using my rules to control them.
thanks in advance.
|Document generated by Confluence on Jun 05, 2016 09:34|