I recently got a Shelly Dimmer 2. Today I installed it and tried to automate the light. My problem now is that the event of the input buttons won’t trigger my automation based on event type. If I remove the event_type, it seems to work, but without filter for long presses.
These are the trigger of my automation
# Works
- trigger: state
entity_id:
- event.shellydimmer2_kuche_channel_1
id: bright
# Don't work
- trigger: state
entity_id:
- event.shellydimmer2_kuche_channel_2
id: dark
attribute: event_type
to: single
# Works
- trigger: state
entity_id:
- event.shellydimmer2_kuche_channel_2
- event.shellydimmer2_kuche_channel_1
attribute: event_type
to: long
id: "off"
I can see the events fired in Logbook and Events section on the device page.
Is there a way to see more details of the events fired? Has anyone a clue whats going wrong here?
I ended up using the pattern from the docs https://www.home-assistant.io/integrations/event/#event-types
This is the final automation
alias: Dining Light
description: ""
triggers:
- trigger: state
entity_id:
- event.shellydimmer2_dining_channel_1
id: bright
- trigger: state
entity_id:
- event.shellydimmer2_dining_channel_2
id: dark
conditions: []
actions:
- if:
- condition: state
entity_id: light.shellydimmer2_dining
state: "off"
then:
- action: light.turn_on
metadata: {}
data: {}
target:
entity_id: light.shellydimmer2_dining
else:
- choose:
- conditions:
- condition: and
conditions:
- condition: trigger
id:
- bright
- condition: state
entity_id: event.shellydimmer2_dining_channel_1
attribute: event_type
state: single
sequence:
- action: light.turn_on
metadata: {}
data:
brightness_step_pct: 20
target:
entity_id: light.shellydimmer2_dining
alias: Brighter
- conditions:
- condition: and
conditions:
- condition: trigger
id:
- dark
- condition: state
entity_id: event.shellydimmer2_dining_channel_2
attribute: event_type
state: single
sequence:
- action: light.turn_on
metadata: {}
data:
brightness_step_pct: -20
target:
entity_id: light.shellydimmer2_dining
alias: Darker
- conditions:
- condition: or
conditions:
- condition: and
conditions:
- condition: trigger
id:
- bright
- condition: state
entity_id: event.shellydimmer2_dining_channel_1
attribute: event_type
state: long
- condition: and
conditions:
- condition: trigger
id:
- dark
- condition: state
entity_id: event.shellydimmer2_dining_channel_2
attribute: event_type
state: long
sequence:
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.shellydimmer2_dining
alias: "Off"
mode: single