For my EnOcean PTM 215z switches I need to enable the setting “Home Assistant legacy action sensors” under Z2M->Settings-> Home Assistant integration, but when I do i get the error “Extension with name HomeAssistant already present.”
Screenshot:
I need to enable this setting or the EnOcean switches does not have any action entity, which in turn means I cannot add them to a blueprint and work as switches.
I can’t find any other posts dealing with this issue.
Any ideas on where to start?
tom_l
April 8, 2025, 2:36am
2
Do you though?
Everything you can do with the legacy sensor you can do with the modern (aka experimental) sensors.
Either way you should be able to change it in config/zigbee2mqtt/configuration.yaml
See: Home Assistant integration | Zigbee2MQTT
Thank you @tom_l , it worked setting it in yaml
Action entity is showing on my switches now!
tom_l
April 8, 2025, 9:08pm
4
Great but they will be depreciated eventually.
Everything you can do with action
(legacy) entities you can do with event
(new) entities. e.g.
- id: 23cd99f6-6054-43cc-9fbe-a89570fb0bfa
alias: Master Bed Button Events
triggers:
- trigger: state
entity_id: event.master_bed_button_action
to: ~
conditions:
- condition: template
value_template: "{{trigger.from_state.state != 'unavailable'}}"
actions:
- choose:
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == 'single'}}"
sequence:
- action: light.toggle
target:
entity_id:
- light.lifx_mstr_bed_lamp_left
- light.lifx_mstr_bed_lamp_right
- action: lifx.set_state
entity_id:
- light.lifx_mstr_bed_lamp_left
- light.lifx_mstr_bed_lamp_right
data:
brightness: "{{ states('sensor.calculated_light_brightness_25pct_min')|int(0) }}"
color_temp_kelvin: 2700
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == 'double'}}"
sequence:
- action: script.master_bed_close
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == 'triple'}}"
sequence:
- action: script.master_bed_east_open
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == 'hold'}}"
sequence:
- action: script.master_bed_favourite
kdineut
(K. Di Neut)
April 23, 2025, 11:27am
5
do you mind if I ask what kind of switch/dimmer is that that has these kind of triple press gestures and stuff like that?
thanks.
tom_l
April 23, 2025, 11:45am
6
That automation is for this one: Wireless Mini Switch T1 - Aqara
But most (all?) buttons can do this. e.g. I also have some three and four button versions of these Loratap remotes: https://vi.aliexpress.com/item/1005004988714663.html they can do this too. The only thing I’m annoyed about is that there is only one hold event for the entire remote (instead a hold event of per button).
- id: a9918825-dc29-409b-ba37-832f9dd0f6e6
alias: Dining Button Events
triggers:
- trigger: state
entity_id: event.dining_button_action
to: ~
conditions:
- condition: template
value_template: "{{trigger.from_state.state != 'unavailable'}}"
actions:
- choose:
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == '1_single'}}"
sequence:
- repeat:
count: 6
sequence:
- action: media_player.volume_up
target:
entity_id:
- media_player.dining_zone
- delay: 0.1
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == '1_double'}}"
sequence:
- repeat:
count: 9
sequence:
- action: media_player.volume_up
target:
entity_id:
- media_player.dining_zone
- delay: 0.1
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == '2_single'}}"
sequence:
- repeat:
count: 6
sequence:
- action: media_player.volume_down
target:
entity_id:
- media_player.dining_zone
- delay: 0.1
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == '2_double'}}"
sequence:
- repeat:
count: 9
sequence:
- action: media_player.volume_down
target:
entity_id:
- media_player.dining_zone
- delay: 0.1
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == '3_single'}}"
sequence:
- action: media_player.media_next_track
target:
entity_id:
- media_player.lounge_zone
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == '3_double'}}"
sequence:
- action: media_player.media_previous_track
target:
entity_id:
- media_player.lounge_zone
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == '4_single'}}"
sequence:
- action: media_player.media_play_pause
target:
entity_id:
- media_player.lounge_zone
- conditions:
- condition: template
value_template: "{{trigger.to_state.attributes.event_type == 'hold'}}"
sequence:
- action: media_player.toggle
target:
entity_id:
- media_player.dining_zone
- action: media_player.select_source
target:
entity_id:
- media_player.dining_zone
data:
source: Main Zone Sync
1 Like
tinju
(Tinju)
August 2, 2025, 6:12am
7
So one has to edit the config again because changes made for this via web gui do not work despite the button for it.
Could you elaborate a bit on the „events“ topic? Because that is not showing either. Making it broken again…
Thanks