action of scene depending on switch state

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
HeHa
Posts: 12
Joined: 30 Dec 2016 22:46

action of scene depending on switch state

Post by HeHa »

Hi,

I use EventWatcher to turn off lights based on Astronomy and Presence modules.
I want to turn off another switch (TV) 5 minutes later if the lights are still off.

How to implement? Logical Rule module should be able to, but does not work for me.


/HeHa
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: action of scene depending on switch state

Post by PoltoS »

There is a delayed scene app. You can trigger it from other apps
HeHa
Posts: 12
Joined: 30 Dec 2016 22:46

Re: action of scene depending on switch state

Post by HeHa »

Hi,
PoltoS wrote:
09 Feb 2020 11:06
There is a delayed scene app. You can trigger it from other apps
Yes thank you. What I am then missing is the dependency of the light switch?


/HeHa
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: action of scene depending on switch state

Post by PoltoS »

You can use logical rules to trigger scene on button press
HeHa
Posts: 12
Joined: 30 Dec 2016 22:46

Re: action of scene depending on switch state

Post by HeHa »

when scene is triggered, I want to turn off device B but only if device A is off.
micky1500
Posts: 298
Joined: 07 Feb 2016 16:29
Location: England

Re: action of scene depending on switch state

Post by micky1500 »

This is how I would do it.
it might work :)


Create 2 App - Dummy Devices
Binary Switch DummyA and DummyB

Create App - Automated Switch Off
Switch off DummyA after 300 seconds

Create Rule in 'Automation-Rules' Add. New.
IF - (Turn on Advanced settings at bottom)
Nested Condition (AND)
if DummyA = Off (5 minutes has expired)
if DummyB = On (EventWatcher was triggered)
if Lights = Off (Lights are off)
THEN
Turn OFF DummyB
Turn OFF TV
ELSE
Disable Reverse Event

In EventWatcher
Turn Off Lights (as already doing)
Also in same Event
Turn On DummyA
Turn On DummyB
...


DummyB is used to prevent normal light switching on/off from triggering false TV changes.

Does seem a bit complicated to turn off a TV tho.

Micky
Raspi 4 - (Buster - 32 Bit) Zwave Version 4.1.1, Raz 7 Pro, Serial API Version: 07.38
HeHa
Posts: 12
Joined: 30 Dec 2016 22:46

Re: action of scene depending on switch state

Post by HeHa »

I soleved this eventually by using the app "Event Button" (https://github.com/maros/Zway-EventButton/).
When "Presence State" switches to "Night", then I use "EventWatcher" to turn off the lights immediately and another "EventWatcher" turns off TV with 2 minutes delay.
The delayed EventWatcher to turn off the TV has a "Cancel Event" which is an event setup in app "Event Button", so I can now trigger this software button to generate an event which cancels that the TV turns off.
I have set a rule that when the light switch is turned ON, then the event from app "Event Button" is triggered and hence cancels that the TV turns off.
This means that when I am watching a late movie and the lights go off, then all I have to do is to switch the lights back on and the TV will remain on. :D
Post Reply