Using global variables for automation

Hi there, I want to declare a global boolean variable in Home Assistant that I can read and change with different automations. I have never worked with variables in Home Assistant before, so I don’t really know how to achieve this. Any help is appreciated!

This would be a input helper
settings > devices > helpers tab … the ‘toggle’ type

2 Likes

thanks, that worked fine!

how do you change it in your automation?

Via service… Input boolean: Toggle

1 Like

How would I save the state of an input_boolean helper in one script and restore that state in another script?
I made a 2nd input_boolean helper but don’t know how to set this to the value of the other … :flushed:

  - service: input_boolean.turn_{{ states('input_boolean.one') }}
    entity_id: input_boolean.two
2 Likes

WHOA! Didn’t know that! Very cool & thanks a lot!!