I'm looking for best practice to have a virtual device be set ON or OFF based on the behavior of a certain location. For example, In my living room I have 4 lights(devices) set to a location. If any of those are on, I want a virtual device to show ON. If they are ALL off then the virtual device to show OFF. Is there a simple way to script this??
Announcement
Collapse
No announcement yet.
Virtual device flag If any ON for a location
Collapse
X
-
Unless you are looking to script this for a learning experience I think you can handle it with an event just fine. Well, two events actually. One for on and one for off.
Create a virtual device to represent the room. Living room for example.
Create a condition triggered event to turn on this device if any of your target devices change status to on. Do the same for the off event with off status changes. Group the on conditions in group 2 as or's and group the off conditions on the off event to group 1 so they will be and's.
Any target device changes state to on and the virtual device is set.
All target devices change state to off and the virtual device is cleared.
I think that is what you are looking for. Later, Terry
Comment