Input boolean toggle rather than on off

hi

i have an input boolean triggering an automation. I hve the button on haddashboard. when i switch it on it runs the automation (switch amplifier on, switch tv on, switch virgin tv channel)

The switch stays illumated on hadashboard and stays active on the ha frontend.

How can i get it to return to the off state automatically?

Off doesnt do anything, but if i change tv channel or turn amp off with remote control, i then have to subsquently hit the butto on the dashboard twice, off then back on to retrigger the automation.

cheers

Just add a step at the end of the automation to turn the input_boolean off. Is there a reason you don’t think that would work?

EDIT: BTW, if the automation only has that as its trigger, another option is to move the actions from an automation to a script. Then put the script on the frontend, and you can click its EXECUTE button instead.

1 Like

Superb cheers. I’m still learning :grimacing:. Good tips, not even looked at scripts yet!!

Thank you

1 Like

As suggested, easiest solution is to add a delay of 1 or 2 seconds then have the input boolean flick back.

I have a similar thing set up for my TV, but instead I’ve set it up as a switch, so when the switch is toggled, it turns my TV and satellite TV box on, then when I’m done watching, i turn it off, and it runs an automation/script that switches it off.

- platform: template
  switches:       
    tv_switch:
      friendly_name: "TV"
      value_template: "{{ is_state('remote.harmony_hub', 'on') }}"
      turn_on:
          service: script.turn_on
          data:
            entity_id: script.tvon
      turn_off:
          service: script.turn_on
          data:
            entity_id: script.tvoff
      icon_template: >
       {% if is_state('remote.harmony_hub', 'on') %}
       mdi:television-classic
       {% else %}
       mdi:television-classic-off
       {% endif %}

Hi pnbrucker, I was trying do to exactly that, but not sure what step to add. I use an input boolean to make Alexa say something, so I just want the button go back to off when she is finished, not sure what action to use for that.

@RoyD2 try this

I can confirm that this works wonderfully.
When I turn a switch on it does its thing and turns itself off ready to be triggered again, great for volume controls and things like that.