Have script toggle a "boolean switch"

Hi,

I am new to Home Assistant and come from a long history together with PiMatic.
I am trying to “migrate” my automations from PiMatic to Home Assistant right now.

I have been successfull with converting my ESP8266 controlled sunscreens using Tasmota. I also succeeded in controlling the Tasmota device from Home Assistant.

The next challenge is the automation part. I have 2 scripts created - one which lowers our sunscreens over a number of Tasmota devices. The other one is a script which move the screens back up.

The only challenge i currently have is with the automations.

As soon as i - manually - lower the screens using the script, there is no way to tell the “status” of the screens. In the automation i currently have setup to move the screns up at sunset and with heavy rain and high wind speeds.

However, in the automation i use a “helper” input boolean which needs to be state “on” before the automation would be doing anything with sunset or weather rules.

Here is my issue: in the script i havent found a way to toggle the input boolean from status on (when lowered) or status off (when moved up). Can someone help me in the right direction here? Is it possible to change the status of the input boolean using a script, or is there perhaps a better way of doing this?

Thanks in advance.

Post the automation you have so far, but to switch the input_boolean you would want something like

- service: input_boolean.toggle
  entity_id: input_boolean.your_input_boolean_name

in the action: section of your automation

If you want to switch it to a specific state you could also use input_boolean.turn_off or input_boolean.turn_on

…and welcome to the Home Assistant forums :wink::+1:

Hi! Thanks for your reply - i am using the UI so far as YAML isnt totally clear - yet -

this is what i have currently. Would it be possible to combine YAML with the UI? As it seems the UI doenst save any YAML in configuration.yaml.

Edit:

OK, so as @jivesinger mentioned “service” i found " call service" in the OU and this seems to do exactly what i need. Tnx for directing me in the right direction, its a learning curve in the new terminology :wink:

1 Like