Z2M - Setting "Home Assistant legacy action sensors" failed with error

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?

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 :slight_smile:
Action entity is showing on my switches now!

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

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.

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

So one has to edit the config again because changes made for this via web gui do not work despite the button for it. :man_facepalming:
Could you elaborate a bit on the „events“ topic? Because that is not showing either. Making it broken again…
Thanks