Missing entities for actions from Zigbee2MQTT (Z2M)

Hi

I’ve got a weird problem with actions comming from my buttons. Especially form E1743 (IKEA E1743 control via MQTT | Zigbee2MQTT).

In Z2M the action is present and reacts to ON or OFF, but this does not go to an entity in the MQTT integration in Home Assistant.

Does someone know what I can do to solve this?

Kind regards,
Maarten.

just a guess, maybe it doesn’t create a switch/sensor in HA, but publishes an event (mqtt trigger) instead?

I’m now trying to create the event in an automation like the suggestion from another topic: https://community.home-assistant.io/t/hue-tap-dial-missing-action-entity-via-zigbee2mqtt/751046/3

See: https://www.zigbee2mqtt.io/guide/usage/integrations/home_assistant.html#responding-to-button-clicks

Hi, Here is the solution. For everyone thas is having the same issue with Zigbee2MQTT and the TRADFRI on/off switch, type E1743.

Automations in YALM

ON switch:

alias: Kerstlichtjes aan
description: ""
triggers:
  - trigger: mqtt
    topic: zigbee2mqtt/Kerstlichtjes schakelaar/action
    payload: "on"
conditions: []
actions:
  - action: light.turn_on
    metadata: {}
    data: {}
    target:
      device_id: c5784515f2cbdd1209770007e2d82942
mode: single

OFF switch:

alias: Kerstlichtjes uit
description: ""
triggers:
  - trigger: mqtt
    topic: zigbee2mqtt/Kerstlichtjes schakelaar/action
    payload: "off"
conditions: []
actions:
  - action: light.turn_off
    metadata: {}
    data: {}
    target:
      device_id: c5784515f2cbdd1209770007e2d82942
mode: single
  • The Topic is discovered through the MQTT integration and then press ‘Configure’.
  • At the bottom you can ‘Listen to Topic’ ("Luisteren naar “onderwerp” in dutch).
  • Insert # into the input field and press ‘Start listening’ (“Start met luisteren” in dutch).
  • Then press the button on the on/off switch.

Here is the message I got:

{
    "level": "info",
    "message": "z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Kerstlichtjes schakelaar/action', payload 'on'"
}

The topic = zigbee2mqtt/Kerstlichtjes schakelaar/action
The payload = on

And then choose you own action to perform in Home Assistant. In my example the action is to turn on the Christmas lights. :smiley:

Kind regards and happy holidays!
Maarten.

1 Like

@MeJebus
I think I had the same problem with the same devices which had been working as I expected for quite some time until I performed some updates including the Zigbee2MQTT which has two of my E1734 switches on it (incidentally I have a E1734 on another Zigbee2MQTT instance which was not upgraded and this continued to work).
The failing E1734’s are on a Zigbee2MQTT with the following levels

Zigbee2MQTT version  2.0.0 commit: unknown
Coordinator type  EZSP v7
Coordinator revision 6.5.0.0 build 188
zigbee-herdsman-converters version 21.12.0
zigbee-herdsman version 3.2.1

I can see that the Action entities for the devices have disappeared, and are not appearing in the Discovery messages for the devices, although the devices are still publishing on the Action topic.

The way I “fixed” this is to go into the Zigbee2MQTT addon and set the Legacy Action Sensors tickbox

I’m a little concerned that the documentation shows that Actions are deprecated, however I’m not 100% certain what I’m supposed to use instead. I’m currently using Node-Red. Hopefully all will become clearer before Actions are completely removed.

1 Like

Hi, i have the same problem, did you open issue on Z2M github page ?

Thank you for your investigation

what do your flows look like in Node Red? What nodes are you using?

@speedypidz Since the option I checked is consistant with the function I needed to restore (and that Actions are marked as deprecated), I assume that what I experienced was intentional, and not a bug so I didn’t raise an issue.

@Provost I’m just using an Events: State node against the sensor.action entity of the switch.

I was doing the same for the buttons that control our bedroom lamps, and they stopped working after I applied the Z2M update without realizing it would have breaking changes.
I swapped the event node for an Z2M node, which I think may be an add-on and all is working well. ymmv, but you could try that node, or the “MQTT in” node under the Network section.

You are right, sorry, also i just read this thread Using the new action events in Zigbee2MQTT 2.0

Best regards ans happy new year all

If it can help you, here what you have to do to activate the events entities of your IKEA e1753

Then my automation that i have modified

alias: aut_chambre_est_bouton_nico
description: ""
triggers:
  - trigger: state
    entity_id:
      - event.rdc_chambre_est_bouton_nico_action
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: event.rdc_chambre_est_bouton_nico_action
            state: "on"
            attribute: event_type
        sequence:
          - action: light.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: light.rdc_chambre_est_lampe_nico
      - conditions:
          - condition: state
            entity_id: event.rdc_chambre_est_bouton_nico_action
            state: "off"
            attribute: event_type
        sequence:
          - action: light.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: light.rdc_chambre_est_lampe_nico
      - conditions:
          - condition: state
            entity_id: event.rdc_chambre_est_bouton_nico_action
            attribute: event_type
            state: brightness_move_up
        sequence:
          - repeat:
              sequence:
                - action: light.turn_on
                  metadata: {}
                  data:
                    brightness_step_pct: 5
                  target:
                    entity_id: light.rdc_chambre_est_lampe_nico
                - delay:
                    milliseconds: 200
              until:
                - condition: or
                  conditions:
                    - condition: state
                      entity_id: event.rdc_chambre_est_bouton_nico_action
                      attribute: event_type
                      state: brightness_stop
                    - condition: numeric_state
                      entity_id: light.rdc_chambre_est_lampe_nico
                      above: 255
                      attribute: brightness
      - conditions:
          - condition: state
            entity_id: event.rdc_chambre_est_bouton_nico_action
            attribute: event_type
            state: brightness_move_down
        sequence:
          - repeat:
              sequence:
                - action: light.turn_on
                  metadata: {}
                  data:
                    brightness_step_pct: -5
                  target:
                    entity_id: light.rdc_chambre_est_lampe_nico
                - delay:
                    milliseconds: 200
              until:
                - condition: or
                  conditions:
                    - condition: state
                      entity_id: event.rdc_chambre_est_bouton_nico_action
                      attribute: event_type
                      state: brightness_stop
                    - condition: numeric_state
                      entity_id: light.rdc_chambre_est_lampe_nico
                      below: 10
                      attribute: brightness
mode: single