#Automation works only once - Voice PE Button

1 messages · Page 1 of 1 (latest)

vast sinew
#

Hi, my automation only works once, my guess is that my issue is "changed to double press", as the button was already on "double press for the last used state".
How can i resolve this please (hope the option restart would help, but it seems not :D)?

`alias: Voice button press
description: ""
triggers:

  • trigger: state
    entity_id:
    • event.home_assistant_voice_091c68_button_press
      attribute: event_type
      to: double_press
      conditions: []
      actions:
  • action: homeassistant.toggle
    metadata: {}
    data: {}
    target:
    entity_id: light.lichtpunt_terras_2
  • action: light.toggle
    target:
    entity_id: light.lichtpunt_terras_2
    data: {}
    mode: restart`

Thank you!

#

Automation to toggle a light with the Voice PE Button

#

Automation works only once - Voice PE Button

olive cedar
#

This is because there will be no change on the second double press

#

So no trigger

#

Change it to this

alias: Voice button press
triggers:
  - trigger: state
    entity_id:
      - event.home_assistant_voice_091c68_button_press
    not_from: unavailable
conditions:
  - condition: template
    value_template: "{{ trigger.to_state.attributes.event_type == 'double_press' }}"
actions:
  - action: light.toggle
    target:
      entity_id:
        - light.lichtpunt_terras_2
mode: restart
olive cedar
#

BTW you were toggling the same entity twice, so that would have no effect in the end

vast sinew