I have a set of scripts that I’d like to make “smarter” so that they only complete when I’m awake (a test of a boolean). But I can’t work out the syntax. I can find plenty of automation examples, but no script examples.
Thanks! I think that at some point I had tried using multiple conditions (both myself AND my wife are awake before speaking). With your help, I figured that out, too:
speakweather:
alias: 'Speak weather forecast'
sequence:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.person1_awake
state: 'on'
- condition: state
entity_id: input_boolean.person2_awake
state: 'on'
- service: shell_command.speakweather