Template Not running last turn_on

Hi

I trigger this template with the state of input_boolean.tedtv, when switched on it triggers all action, but doesnt run the last one which is set as homeassistant.turn_off in the code below, i have also tried input_boolean.turn_off and toggle. I want the above boolean to turn off automatically so it shows as of until i want to trigger the template again (looks nicer on hadashboard)

- platform: template
  switches:
    tvonoff:
      value_template: "{{ is_state('input_boolean.tedtv', 'on') }}"
      turn_on:
        - service: switch.turn_on
          entity_id: switch.tivo_tedstv
        - service: switch.turn_on
          entity_id: switch.20146435807d3a4a790c
        - service: media_player.turn_on
          data:
            entity_id: media_player.yamaha_receiver_lounge_room
        - service: media_player.select_source
          data:
            entity_id: media_player.yamaha_receiver_lounge_room
            source: av2
        - service: switch.broadlink_send_packet_192_168_5_78
          data:
            packet:
              - "JgBUAE4UEhMpESkRKhAWECkRFREnFBITFREVERUAAzxREBYQKhAnEycTExMpERURKhAWEBYQFhAWAAM7ThQUEScUKBEpERURKhAWECkRFBITExMTEwANBQAAAAA="
        - service: homeassistant.turn_off
          data:
            entity_id: input_boolean.tedtv
      turn_off:

This doesn’t do what you think it does. This is a switch template, not an automation. When you press on, it does not turn the input boolean on. The state of the switch is pulled from the template. When you turn the switch on, it executes the turn on function. When you turn the switch off it executes the off function. Changing the state of the input boolean will not affect this switch at all unless you built an automation that does this.

Also, input booleans have a caveat. They can only be turned on if they are off. They can only be turned off if they are on. Any attempt to turn an input boolean on when it is already on will be suppressed.

cheers, sort of get what you mean. I did have a automation configured previously, but it stopped working as it was and what im trying to achieve.

when i press the input boolean (IB) on the dashboard it used to run the commands in the automation, and then turn itself back off as instructed to do in the automation. From what i have read and the mention of the IB being supressed now also in an automation i thought the template may work. It certainly runs all the other instructions (the automation didnt), it just doesnt flick the IB back to off.

Is there a way to set the IB as a momentary so it would switch back off on its own, as a simpler solution, or can you recommend another way?

thanks for your response.