#Keep state for automation

1 messages · Page 1 of 1 (latest)

snow ravine
#

We just configured a new Yale lock for our door. I now want to link locking the door to enabling our home alarm system. We have opening sensors on all doors and windows and the idea is that once the door is locked, triggering any of the opening sensors would trigger the alarm. This part seems really straightforward. However we would also like to do a "good night" scene/automation that basically locks the door, turns all lights off etc. As this also locks the door the home alarm automation would be enabled, which is not what we want. For this case we only want to lock the door and somehow set some state that causes the alarm automations to not go off.

Is this something that can be done? Like, enabling "good night" would set a "sleeping" state that's persisting until the lock is unlocked. The alarm automations would have a check for "door locked AND sleeping is not set". Unlocking would clear the "sleeping" state. Is there some kind of state helper or similar I could look into?

fathom zodiac
#

to answer your question directly, you're describing an input_boolean or toggle helper

#

I have exactly such a "sleeping" toggle that I use for similar things

snow ravine
#

Aha, that looks promising.

#

Let me google a bit now that I have something to hold onto.

snow ravine
#

How do you trigger your sleeping state? Just a button in the UI? I thought about adding a scene for it that would turn off all lights. lock the door etc, but scenes can not set input_boolean helpers, they can only set device states.

pliant fable
#

Hi, I use a ZihBee remote. Two clicks in botton 1 activates sleeping mode, as an example

snow ravine
#

I meant what component in HA. I'd want to use something that the iOS app lets me use in the "control centre" for quick access.

pliant fable
#

You can create a boolean helper as said above

#

Active, inactive

snow ravine
#

Yeah, got it to work using a boolean and then an automation connected to the boolean turning on (go to sleep) and off (the dawn of a glorious new day).

#

Not sure yet if that single boolean can be exposed to iOS.

#

But now I should be able to turn on the home alarm if the lock becomes locked and the boolean is false, i.e. door got locked but we're at home. If the boolean is not enabled then we're not sleeping nor at home and locking should also enable the larm.