#Why does my button not react to single press the first time?

1 messages · Page 1 of 1 (latest)

sand egret
#

So i have an aqara button as a ring bell, that turns my lights on and off, instead of a sound, since i usually walk around with headphones. However, it has come to my attention, that the first single press usually doesn't trigger the automation, while hold, double press and second single press does trigger the automation. Can someone help me figure out why?
Attached are pictures of logbook showing that first single press doesnt trigger while the other do. Automation:

alias: Ringeklokke lys v4
description: ""
triggers:
  - trigger: state
    entity_id:
      - event.entre_knap_ringeklokke_aqara_action
    attribute: event_type
    to: single
  - trigger: state
    entity_id:
      - event.entre_knap_ringeklokke_aqara_action
    attribute: event_type
    to: double
  - trigger: state
    entity_id:
      - event.entre_knap_ringeklokke_aqara_action
    attribute: event_type
    to: hold
actions:
  - repeat:
      count: 4
      sequence:
        - target:
            entity_id:
              - light.badevaerelse_controller_ledstrip_miboxer
              - light.badevarelse_spots_loft_shelly
              - light.kokken_controller_ledstrip_miboxer
              - light.kokken_lampe_loft_shelly
              - light.spisebord_lampe_loft_shelly
              - light.stue_lampe_gulv_ikea
              - light.stue_lampe_loft_tuya
              - light.entre_lampe_loft_shelly
              - light.kontor_lampe_loft_ikea
          action: light.toggle
          data: {}
        - delay: "00:00:01"
#

I don't see it can have anything to do with the button itself, connection or battery, since HA receives the button presses. HA just doesn't trigger the automation for some reason

bitter pendant
#

This won't trigger if the event_type is the same as the most recent event_type

#

As it requires the event_type to change

sand egret
#

Wow that actually makes a lot of sense

bitter pendant
#

Event entities are kinda weird

sand egret
#

So how do i get past that?

bitter pendant
#

Remove the attribute from the trigger, and trigger on any state but unavailable.

#

You can refine allowed event_types in a condition

#

I would do:

not_to: unavailable
sand egret
#
alias: Ringeklokke lys v4
description: ""
triggers:
  - trigger: state
    entity_id:
      - event.entre_knap_ringeklokke_aqara_action
    not_from: unavailable
    not_to: unavailable

Like this?

#

And then follows the actions, of course

bitter pendant
#

Yeah that looks good.

#

If you need to disallow any event_types, add a condition

sand egret
#

I really don't, it should fire no matter what a guest does