Update input_boolean state without re-triggering automation

Hi, I have an automation (see below) with two triggers defined, “state > input_boolean > on” and “event > telegram_command > command”, the automation works and triggers as expected via either trigger, what I would like to do is update the state of the input_boolean when the automation is triggered via the telegram_command without re-triggering the automation, is this possible?

Automation:-

  - id: '3454366499090'
    alias: Show Cameras On Vizio TV
    initial_state: true
    trigger:
      - platform: state
        entity_id: input_boolean.cameras_on_vizio
        from: 'off'
        to: 'on'
      - platform: event
        event_type: telegram_command
        event_data:
          command: '/camsyson'
    action:
      - service: script.turn_on
        entity_id: script.cameras_on_vizio

Thanks.

    action:
      - service: script.turn_on
        entity_id: script.cameras_on_vizio
      - condition: template
        value_template: "{{ trigger.platform == 'event' }}"
      - service: input_boolean.turn_on
        entity_id: input_boolean.cameras_on_vizio
    mode: single
    max_exceeded: silent

Thank you for this, works great.

1 Like