#Mini Switch Trigger

1 messages · Page 1 of 1 (latest)

civic burrow
#

Hi I'm new to HS and have an issue with an automation. I cant get my mini switch to trigger properly. Its an Aqara mini switch and I want to trigger a helper, it should be fairly simple but it doesn't seem to detect a single press in the the automation. I know the switch is working because the state changes in the home screen and in the developer tools section but not sure how the trigger should be written in the automation.

frosty thorn
#

Share the automation YAML

civic burrow
#

The trigger works if I set it from Pressed twice to Pressed once but not if I only have pressed once

frosty thorn
#

Please share as text and not a screenshot/photo next time. So state triggers will only work if the state (or attribute) you're referencing actually changes. If the state goes from multi_press_1 to multi_press_1, then it won't trigger

#

You might need to use an event trigger instead of a state trigger. Is the button by any chance a Zigbee device that you have connected to HA via ZHA?

civic burrow
#

It is a zigbee device but it not connected directly to home assistant but through a aqara hub

silk carbon
#

Yeah, still a bit of a problem with event entities. For the trigger, just make it trigger on the state. Check the event type separately in the conditions.

If you would have posted the yaml as text, I would have changed it for you 🙂

civic burrow
#

Im not sure how to change from an event trigger instead of a state trigger but if i set the trigger from device and select pressed once it still doesnt work

#

device_id: e4621404b8ee22d0f8335898ed9b7009
domain: button
entity_id: b825c2c1c60d6793cb05c241c89ba53e
type: pressed
trigger: device

#

alias: Set bella status to fed
description: ""
triggers:

  • trigger: state
    entity_id:
    • event.aqara_wireless_mini_switch_button
      attribute: event_type
      to: multi_press_1
      conditions: []
      actions:
  • action: input_boolean.turn_on
    metadata: {}
    data: {}
    target:
    entity_id: input_boolean.bella_fed
  • action: light.turn_on
    metadata: {}
    data:
    rgb_color:
    - 78
    - 122
    - 39
    brightness_step_pct: 100
    target:
    device_id: e063f90afe29b4c758e080df4b58d7a1
    mode: single