Persistent Variables I can Turn On/Off w Switch?

Hey all,

I’m looking for documentation related to creating persistent global variables that can be manipulated and used in automations.

For example, suppose I decide I need to be productive this evening. I might push a button “enter productivity mode” which sets a boolean variable. Then, my home automations behave differently: The lights in my work room don’t dim when there is no motion in the room ; The lights in the living room don’t go into the cool dim/colorful “movie mode” I have setup when my media center begins playing, etc. Perhaps some automations are just disabled, while others are enabled, and others still behave differently.

Any advice appreciated.

You could have a look at Helpers. In particular, the Toggle Helper.

Just use an input boolean

Sorry for the late reply. Thank you both for your suggestions - they work perfectly.

I can now flip a switch in the UI to enter/exit any mode I want, to change automation behaviors. I’ve even used helpers to add another layer of abstraction. For example, an automation that detects that I am sleeping by the phone charger + door sensor + computer state, then sets a toggle helper called “Sleeping”. Other automations can then simply watch the state of the “Sleeping” helper to help simplify my setups.

Thanks again! Having loads of fun.