If I add the Zigbee Butoon IH-K663 to z2m i can see, that everything seems to work fine. If I press the button one time, it shows the action single and with a double click it shows double. But if I look into my home assistant there is no "action" sensor. All other topics like battery, voltage and linkqualitiy are there.
If I add the button to z2m at the beginning the action is not showed in z2m. Only when I press the button, the action shows up. Maybe it has something to do with that.
Im not sure, if this is a problem of z2m or with home assistant. I just can say, that another button I have works well in the same setup.
@kirovilya
What did you expect to happen?
To see the action senor in Home Assistant.
How to reproduce it (minimal and precise)
Just add the button to z2m and look into MQTT-Explorer. There is an "action" topic showed in z2m and MQTT but not in home assistant.
What happened?
If I add the Zigbee Butoon IH-K663 to z2m i can see, that everything seems to work fine. If I press the button one time, it shows the action single and with a double click it shows double. But if I look into my home assistant there is no "action" sensor. All other topics like battery, voltage and linkqualitiy are there. If I add the button to z2m at the beginning the action is not showed in z2m. Only when I press the button, the action shows up. Maybe it has something to do with that.
Im not sure, if this is a problem of z2m or with home assistant. I just can say, that another button I have works well in the same setup. @kirovilya
What did you expect to happen?
To see the action senor in Home Assistant.
How to reproduce it (minimal and precise)
Just add the button to z2m and look into MQTT-Explorer. There is an "action" topic showed in z2m and MQTT but not in home assistant.
Zigbee2MQTT version
1.34.0
Adapter firmware version
20230507
Adapter
Custom CC2652P
Debug log
z2m-log:
Zigbee2MQTT:info 19-12-2023 14:27:25: MQTT publish: topic 'zigbee2mqtt/Knopf Mikrowelle', payload '{"action":"single","battery":null,"linkquality":72,"voltage":null}' Zigbee2MQTT:info 19-12-2023 14:27:25: MQTT publish: topic 'zigbee2mqtt/Knopf Mikrowelle/action', payload 'single'
diagnostic Information of the two buttons in home assistant:
### not working button (TuYa, IH-K663): ```ruby { "home_assistant": { "installation_type": "Home Assistant Container", "version": "2023.12.3", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.11.6", "docker": true, "arch": "aarch64", "timezone": "Europe/Berlin", "os_name": "Linux", "os_version": "6.1.21-v8+", "run_as_root": true }, "custom_components": { "hass_agent": { "version": "2022.11.9", "requirements": [] }, "portainer": { "version": "0.0.0", "requirements": [] }, "hacs": { "version": "1.33.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, "scheduler": { "version": "v0.0.0", "requirements": [] }, "better_thermostat": { "version": "1.4.0", "requirements": [] }, "browser_mod": { "version": "2.3.0", "requirements": [] }, "dwd": { "version": "2023.10.0", "requirements": [] }, "simpleicons": { "version": "v2.2.0", "requirements": [ "simpleicons==7.14.0" ] }, "smart_thermostat": { "version": "2021.11.1", "requirements": [] } }, "integration_manifest": { "domain": "mqtt", "name": "MQTT", "codeowners": [ "@emontnemery", "@jbouwh" ], "config_flow": true, "dependencies": [ "file_upload", "http" ], "documentation": "https://www.home-assistant.io/integrations/mqtt", "iot_class": "local_push", "quality_scale": "gold", "requirements": [ "paho-mqtt==1.6.1" ], "is_built_in": true }, "data": { "connected": true, "mqtt_config": { "broker": "mqtt.my-domain.de", "port": 1883, "username": "**REDACTED**", "password": "**REDACTED**", "client_id": "homeassistant", "keepalive": 60, "tls_insecure": false, "protocol": "5", "transport": "tcp", "discovery": true, "discovery_prefix": "homeassistant", "birth_message": { "topic": "homeassistant/status", "payload": "online", "qos": 0, "retain": false }, "will_message": { "topic": "homeassistant/status", "payload": "offline", "qos": 0, "retain": false } }, "device": { "id": "86d3afa63afd96ce9d846dc560b36ede", "name": "Knopf Mikrowelle", "name_by_user": null, "disabled": false, "disabled_by": null, "entities": [ { "device_class": null, "disabled_by": "integration", "disabled": true, "entity_category": "diagnostic", "entity_id": "sensor.knopf_mikrowelle_voltage", "icon": null, "original_device_class": "voltage", "original_icon": null, "state": null, "unit_of_measurement": "mV" }, { "device_class": null, "disabled_by": "integration", "disabled": true, "entity_category": "diagnostic", "entity_id": "sensor.knopf_mikrowelle_linkquality", "icon": null, "original_device_class": null, "original_icon": "mdi:signal", "state": null, "unit_of_measurement": "lqi" }, { "device_class": null, "disabled_by": null, "disabled": false, "entity_category": "diagnostic", "entity_id": "sensor.knopf_mikrowelle_battery", "icon": null, "original_device_class": "battery", "original_icon": null, "state": { "entity_id": "sensor.knopf_mikrowelle_battery", "state": "unknown", "attributes": { "state_class": "measurement", "unit_of_measurement": "%", "device_class": "battery", "friendly_name": "Knopf Mikrowelle Batterie" }, "last_changed": "2023-12-19T13:10:00.019673+00:00", "last_updated": "2023-12-19T13:10:00.019673+00:00" }, "unit_of_measurement": "%" } ] }, "mqtt_debug_info": { "entities": [ { "entity_id": "sensor.knopf_mikrowelle_battery", "subscriptions": [ { "topic": "zigbee2mqtt/bridge/state", "messages": [ { "payload": "{\"state\":\"online\"}", "qos": 0, "retain": 1, "time": "2023-12-19T13:10:00.018213+00:00", "topic": "zigbee2mqtt/bridge/state" } ] }, { "topic": "zigbee2mqtt/Knopf Mikrowelle/availability", "messages": [ { "payload": "{\"state\":\"online\"}", "qos": 0, "retain": 1, "time": "2023-12-19T13:10:00.019213+00:00", "topic": "zigbee2mqtt/Knopf Mikrowelle/availability" } ] }, { "topic": "zigbee2mqtt/Knopf Mikrowelle", "messages": [ { "payload": "{\"action\":\"single\",\"battery\":null,\"linkquality\":36,\"voltage\":null}", "qos": 0, "retain": 0, "time": "2023-12-19T13:10:02.600825+00:00", "topic": "zigbee2mqtt/Knopf Mikrowelle" }, { "payload": "{\"action\":\"single\",\"battery\":null,\"linkquality\":36,\"voltage\":null}", "qos": 0, "retain": 0, "time": "2023-12-19T13:10:05.780739+00:00", "topic": "zigbee2mqtt/Knopf Mikrowelle" }, { "payload": "{\"action\":\"single\",\"battery\":null,\"linkquality\":18,\"voltage\":null}", "qos": 0, "retain": 0, "time": "2023-12-19T13:11:54.555477+00:00", "topic": "zigbee2mqtt/Knopf Mikrowelle" }, { "payload": "{\"action\":\"double\",\"battery\":null,\"linkquality\":32,\"voltage\":null}", "qos": 0, "retain": 0, "time": "2023-12-19T13:11:55.381098+00:00", "topic": "zigbee2mqtt/Knopf Mikrowelle" }, { "payload": "{\"action\":\"single\",\"battery\":null,\"linkquality\":21,\"voltage\":null}", "qos": 0, "retain": 0, "time": "2023-12-19T13:11:58.617238+00:00", "topic": "zigbee2mqtt/Knopf Mikrowelle" }, { "payload": "{\"action\":\"single\",\"battery\":null,\"linkquality\":32,\"voltage\":null}", "qos": 0, "retain": 0, "time": "2023-12-19T13:24:47.609502+00:00", "topic": "zigbee2mqtt/Knopf Mikrowelle" }, { "payload": "{\"action\":\"single\",\"battery\":null,\"linkquality\":3,\"voltage\":null}", "qos": 0, "retain": 0, "time": "2023-12-19T13:26:21.039819+00:00", "topic": "zigbee2mqtt/Knopf Mikrowelle" }, { "payload": "{\"action\":\"double\",\"battery\":null,\"linkquality\":76,\"voltage\":null}", "qos": 0, "retain": 0, "time": "2023-12-19T13:26:24.804024+00:00", "topic": "zigbee2mqtt/Knopf Mikrowelle" }, { "payload": "{\"action\":\"single\",\"battery\":null,\"linkquality\":72,\"voltage\":null}", "qos": 0, "retain": 0, "time": "2023-12-19T13:27:25.256151+00:00", "topic": "zigbee2mqtt/Knopf Mikrowelle" } ] } ], "discovery_data": { "topic": "homeassistant/sensor/0xa4c138355cb6bd10/battery/config", "payload": { "availability": [ { "topic": "zigbee2mqtt/bridge/state", "value_template": "{{ value_json.state }}" }, { "topic": "zigbee2mqtt/Knopf Mikrowelle/availability", "value_template": "{{ value_json.state }}" } ], "availability_mode": "all", "device": { "identifiers": [ "zigbee2mqtt_0xa4c138355cb6bd10" ], "manufacturer": "TuYa", "model": "Smart button (IH-K663)", "name": "Knopf Mikrowelle" }, "device_class": "battery", "enabled_by_default": true, "entity_category": "diagnostic", "object_id": "knopf_mikrowelle_battery", "origin": { "name": "Zigbee2MQTT", "sw_version": "1.34.0", "support_url": "https://www.zigbee2mqtt.io" }, "state_class": "measurement", "state_topic": "zigbee2mqtt/Knopf Mikrowelle", "unique_id": "0xa4c138355cb6bd10_battery_zigbee2mqtt", "unit_of_measurement": "%", "value_template": "{{ value_json.battery }}", "platform": "mqtt" } }, "transmitted": [] } ], "triggers": [ { "discovery_data": { "topic": "homeassistant/device_automation/0xa4c138355cb6bd10/action_single/config", "payload": { "automation_type": "trigger", "device": { "identifiers": [ "zigbee2mqtt_0xa4c138355cb6bd10" ], "manufacturer": "TuYa", "model": "Smart button (IH-K663)", "name": "Knopf Mikrowelle" }, "origin": { "name": "Zigbee2MQTT", "sw_version": "1.34.0", "support_url": "https://www.zigbee2mqtt.io" }, "payload": "single", "subtype": "single", "topic": "zigbee2mqtt/Knopf Mikrowelle/action", "type": "action", "platform": "mqtt" } }, "trigger_key": [ "device_automation", "0xa4c138355cb6bd10 action_single" ] }, { "discovery_data": { "topic": "homeassistant/device_automation/0xa4c138355cb6bd10/action_double/config", "payload": { "automation_type": "trigger", "device": { "identifiers": [ "zigbee2mqtt_0xa4c138355cb6bd10" ], "manufacturer": "TuYa", "model": "Smart button (IH-K663)", "name": "Knopf Mikrowelle" }, "origin": { "name": "Zigbee2MQTT", "sw_version": "1.34.0", "support_url": "https://www.zigbee2mqtt.io" }, "payload": "double", "subtype": "double", "topic": "zigbee2mqtt/Knopf Mikrowelle/action", "type": "action", "platform": "mqtt" } }, "trigger_key": [ "device_automation", "0xa4c138355cb6bd10 action_double" ] } ] } } } ``` working button (Sonoff, SNZB-01): ```ruby { "home_assistant": { "installation_type": "Home Assistant Container", "version": "2023.12.3", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.11.6", "docker": true, "arch": "aarch64", "timezone": "Europe/Berlin", "os_name": "Linux", "os_version": "6.1.21-v8+", "run_as_root": true }, "custom_components": { "hass_agent": { "version": "2022.11.9", "requirements": [] }, "portainer": { "version": "0.0.0", "requirements": [] }, "hacs": { "version": "1.33.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, "scheduler": { "version": "v0.0.0", "requirements": [] }, "better_thermostat": { "version": "1.4.0", "requirements": [] }, "browser_mod": { "version": "2.3.0", "requirements": [] }, "dwd": { "version": "2023.10.0", "requirements": [] }, "simpleicons": { "version": "v2.2.0", "requirements": [ "simpleicons==7.14.0" ] }, "smart_thermostat": { "version": "2021.11.1", "requirements": [] } }, "integration_manifest": { "domain": "mqtt", "name": "MQTT", "codeowners": [ "@emontnemery", "@jbouwh" ], "config_flow": true, "dependencies": [ "file_upload", "http" ], "documentation": "https://www.home-assistant.io/integrations/mqtt", "iot_class": "local_push", "quality_scale": "gold", "requirements": [ "paho-mqtt==1.6.1" ], "is_built_in": true }, "data": { "connected": true, "mqtt_config": { "broker": "mqtt.my-domain.de", "port": 1883, "username": "**REDACTED**", "password": "**REDACTED**", "client_id": "homeassistant", "keepalive": 60, "tls_insecure": false, "protocol": "5", "transport": "tcp", "discovery": true, "discovery_prefix": "homeassistant", "birth_message": { "topic": "homeassistant/status", "payload": "online", "qos": 0, "retain": false }, "will_message": { "topic": "homeassistant/status", "payload": "offline", "qos": 0, "retain": false } }, "device": { "id": "ae5e3531d262ae038d47e9963297c8d4", "name": "Lichtschalter Knopf", "name_by_user": null, "disabled": false, "disabled_by": null, "entities": [ { "device_class": null, "disabled_by": "integration", "disabled": true, "entity_category": "diagnostic", "entity_id": "sensor.lichtschalter_knopf_voltage", "icon": null, "original_device_class": "voltage", "original_icon": null, "state": null, "unit_of_measurement": "mV" }, { "device_class": null, "disabled_by": "integration", "disabled": true, "entity_category": "diagnostic", "entity_id": "sensor.lichtschalter_knopf_linkquality", "icon": null, "original_device_class": null, "original_icon": "mdi:signal", "state": null, "unit_of_measurement": "lqi" }, { "device_class": null, "disabled_by": null, "disabled": false, "entity_category": "diagnostic", "entity_id": "sensor.lichtschalter_knopf_battery", "icon": null, "original_device_class": "battery", "original_icon": null, "state": { "entity_id": "sensor.lichtschalter_knopf_battery", "state": "100", "attributes": { "state_class": "measurement", "unit_of_measurement": "%", "device_class": "battery", "friendly_name": "Lichtschalter Knopf Batterie" }, "last_changed": "2023-12-19T13:01:38.229602+00:00", "last_updated": "2023-12-19T13:01:38.229602+00:00" }, "unit_of_measurement": "%" }, { "device_class": null, "disabled_by": null, "disabled": false, "entity_category": null, "entity_id": "sensor.lichtschalter_knopf_action", "icon": null, "original_device_class": null, "original_icon": "mdi:gesture-double-tap", "state": { "entity_id": "sensor.lichtschalter_knopf_action", "state": "unavailable", "attributes": { "restored": true, "icon": "mdi:gesture-double-tap", "friendly_name": "Action", "supported_features": 0 }, "last_changed": "2023-12-19T13:01:04.317212+00:00", "last_updated": "2023-12-19T13:01:04.317212+00:00" }, "unit_of_measurement": null } ] }, "mqtt_debug_info": { "entities": [ { "entity_id": "sensor.lichtschalter_knopf_battery", "subscriptions": [ { "topic": "zigbee2mqtt/bridge/state", "messages": [ { "payload": "{\"state\":\"online\"}", "qos": 0, "retain": 1, "time": "2023-12-19T13:01:00.786533+00:00", "topic": "zigbee2mqtt/bridge/state" } ] }, { "topic": "zigbee2mqtt/Lichtschalter Knopf/availability", "messages": [ { "payload": "{\"state\":\"online\"}", "qos": 0, "retain": 1, "time": "2023-12-19T13:01:00.883694+00:00", "topic": "zigbee2mqtt/Lichtschalter Knopf/availability" } ] }, { "topic": "zigbee2mqtt/Lichtschalter Knopf", "messages": [ { "payload": "{\"battery\":100,\"linkquality\":36,\"voltage\":3000}", "qos": 0, "retain": 0, "time": "2023-12-19T13:01:38.228809+00:00", "topic": "zigbee2mqtt/Lichtschalter Knopf" }, { "payload": "{\"action\":\"single\",\"battery\":100,\"linkquality\":7,\"voltage\":3000}", "qos": 0, "retain": 0, "time": "2023-12-19T13:25:56.029769+00:00", "topic": "zigbee2mqtt/Lichtschalter Knopf" }, { "payload": "{\"battery\":100,\"linkquality\":21,\"voltage\":3000}", "qos": 0, "retain": 0, "time": "2023-12-19T13:27:38.820647+00:00", "topic": "zigbee2mqtt/Lichtschalter Knopf" }, { "payload": "{\"battery\":100,\"linkquality\":21,\"voltage\":3000}", "qos": 0, "retain": 0, "time": "2023-12-19T13:27:38.823022+00:00", "topic": "zigbee2mqtt/Lichtschalter Knopf" }, { "payload": "{\"action\":\"single\",\"battery\":100,\"linkquality\":32,\"voltage\":3000}", "qos": 0, "retain": 0, "time": "2023-12-19T13:56:08.606322+00:00", "topic": "zigbee2mqtt/Lichtschalter Knopf" } ] } ], "discovery_data": { "topic": "homeassistant/sensor/0x00124b002911419f/battery/config", "payload": { "availability": [ { "topic": "zigbee2mqtt/bridge/state", "value_template": "{{ value_json.state }}" }, { "topic": "zigbee2mqtt/Lichtschalter Knopf/availability", "value_template": "{{ value_json.state }}" } ], "availability_mode": "all", "device": { "identifiers": [ "zigbee2mqtt_0x00124b002911419f" ], "manufacturer": "SONOFF", "model": "Wireless button (SNZB-01)", "name": "Lichtschalter Knopf" }, "device_class": "battery", "enabled_by_default": true, "entity_category": "diagnostic", "object_id": "lichtschalter_knopf_battery", "origin": { "name": "Zigbee2MQTT", "sw_version": "1.34.0", "support_url": "https://www.zigbee2mqtt.io" }, "state_class": "measurement", "state_topic": "zigbee2mqtt/Lichtschalter Knopf", "unique_id": "0x00124b002911419f_battery_zigbee2mqtt", "unit_of_measurement": "%", "value_template": "{{ value_json.battery }}", "platform": "mqtt" } }, "transmitted": [] } ], "triggers": [ { "discovery_data": { "topic": "homeassistant/device_automation/0x00124b002911419f/action_single/config", "payload": { "automation_type": "trigger", "device": { "identifiers": [ "zigbee2mqtt_0x00124b002911419f" ], "manufacturer": "SONOFF", "model": "Wireless button (SNZB-01)", "name": "Lichtschalter Knopf" }, "origin": { "name": "Zigbee2MQTT", "sw_version": "1.33.0", "support_url": "https://www.zigbee2mqtt.io" }, "payload": "single", "subtype": "single", "topic": "zigbee2mqtt/Lichtschalter Knopf/action", "type": "action", "platform": "mqtt" } }, "trigger_key": [ "device_automation", "0x00124b002911419f action_single" ] }, { "discovery_data": { "topic": "homeassistant/device_automation/0x00124b002911419f/action_double/config", "payload": { "automation_type": "trigger", "device": { "identifiers": [ "zigbee2mqtt_0x00124b002911419f" ], "manufacturer": "SONOFF", "model": "Wireless button (SNZB-01)", "name": "Lichtschalter Knopf" }, "origin": { "name": "Zigbee2MQTT", "sw_version": "1.33.0", "support_url": "https://www.zigbee2mqtt.io" }, "payload": "double", "subtype": "double", "topic": "zigbee2mqtt/Lichtschalter Knopf/action", "type": "action", "platform": "mqtt" } }, "trigger_key": [ "device_automation", "0x00124b002911419f action_double" ] }, { "discovery_data": { "topic": "homeassistant/device_automation/0x00124b002911419f/action_long/config", "payload": { "automation_type": "trigger", "device": { "identifiers": [ "zigbee2mqtt_0x00124b002911419f" ], "manufacturer": "SONOFF", "model": "Wireless button (SNZB-01)", "name": "Lichtschalter Knopf" }, "origin": { "name": "Zigbee2MQTT", "sw_version": "1.33.0", "support_url": "https://www.zigbee2mqtt.io" }, "payload": "long", "subtype": "long", "topic": "zigbee2mqtt/Lichtschalter Knopf/action", "type": "action", "platform": "mqtt" } }, "trigger_key": [ "device_automation", "0x00124b002911419f action_long" ] } ] } } } ```