What it exposes
| Feature | Property | Values | Control |
|---|---|---|---|
| Action (button press) | action | hold_switch_1, hold_switch_2, single_switch_1, single_switch_2, double_switch_1, double_switch_2 | read only |
| Switch (switch_1) | state_switch_1 | — | settable |
| (1) Power-on behavior (switch_1) | power_on_behavior_switch_1 | off, on, toggle, previous | settable |
| (1) Relay mode (switch_1) | relay_mode_switch_1 | control_relay, decoupled | settable |
| (1) Allow double clicks (switch_1) | allow_double_click_switch_1 | — | settable |
| (1) Identify (switch_1) | identify_switch_1 | identify | settable |
| (1) LED indication (switch_1) | led_indicator_on_enable_switch_1 | — | settable |
| (1) Hue (switch_1) | led_indicator_on_h_switch_1 | ° · 0…359 | settable |
| (1) Saturation (switch_1) | led_indicator_on_s_switch_1 | 0…254 | settable |
| (1) Brightness (switch_1) | led_indicator_on_b_switch_1 | 1…254 | settable |
| (1) LED indication (switch_1) | led_indicator_off_enable_switch_1 | — | settable |
| (1) Hue (switch_1) | led_indicator_off_h_switch_1 | ° · 0…359 | settable |
| (1) Saturation (switch_1) | led_indicator_off_s_switch_1 | 0…254 | settable |
| (1) Brightness (switch_1) | led_indicator_off_b_switch_1 | 1…254 | settable |
| Switch (switch_2) | state_switch_2 | — | settable |
| (2) Power-on behavior (switch_2) | power_on_behavior_switch_2 | off, on, toggle, previous | settable |
| (2) Relay mode (switch_2) | relay_mode_switch_2 | control_relay, decoupled | settable |
| (2) Allow double clicks (switch_2) | allow_double_click_switch_2 | — | settable |
| (2) Identify (switch_2) | identify_switch_2 | identify | settable |
| (2) LED indication (switch_2) | led_indicator_on_enable_switch_2 | — | settable |
| (2) Hue (switch_2) | led_indicator_on_h_switch_2 | ° · 0…359 | settable |
| (2) Saturation (switch_2) | led_indicator_on_s_switch_2 | 0…254 | settable |
| (2) Brightness (switch_2) | led_indicator_on_b_switch_2 | 1…254 | settable |
| (2) LED indication (switch_2) | led_indicator_off_enable_switch_2 | — | settable |
| (2) Hue (switch_2) | led_indicator_off_h_switch_2 | ° · 0…359 | settable |
| (2) Saturation (switch_2) | led_indicator_off_s_switch_2 | 0…254 | settable |
| (2) Brightness (switch_2) | led_indicator_off_b_switch_2 | 1…254 | settable |
| Child lock | child_lock | — | settable |
| Serial Number | serial_number | — | read only |
| Resets count | resets_count | — | read only |
| Uptime | uptime | s | read only |
| Button clicks count 1 | button_clicks_count_1 | — | read only |
| Button clicks count 2 | button_clicks_count_2 | — | read only |
| Button clicks count 3 | button_clicks_count_3 | — | read only |
| Relay switches count 1 | relay_switches_count_1 | — | read only |
| Relay switches count 2 | relay_switches_count_2 | — | read only |
MQTT: state and commands
Zigbee2MQTT publishes the device state to zigbee2mqtt/my_device (my_device is the name you give the device). An example message:
{
"state_switch_1": "ON",
"power_on_behavior_switch_1": "off",
"relay_mode_switch_1": "control_relay",
"allow_double_click_switch_1": false,
"identify_switch_1": "identify",
"led_indicator_on_enable_switch_1": false,
"led_indicator_on_h_switch_1": 180,
"led_indicator_on_s_switch_1": 127,
"led_indicator_on_b_switch_1": 128,
"led_indicator_off_enable_switch_1": false,
"led_indicator_off_h_switch_1": 180,
"led_indicator_off_s_switch_1": 127,
"led_indicator_off_b_switch_1": 128,
"state_switch_2": "ON",
"linkquality": 120
}
Send commands to zigbee2mqtt/my_device/set:
mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"state_switch_1":"TOGGLE"}'
mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"state_switch_2":"TOGGLE"}'
mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"power_on_behavior_switch_1":"on"}'
mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"relay_mode_switch_1":"decoupled"}'
mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"allow_double_click_switch_1":true}'
Watch the topics live from the browser: MQTT client.
Home Assistant automation example
Zigbee2MQTT creates Home Assistant entities from the device name. If it is called my_device, an automation in automations.yaml can look like this:
- alias: "Off at night"
mode: single
triggers:
- trigger: time
at: "23:30:00"
actions:
- action: switch.turn_off
target:
entity_id: switch.my_device_switch_1
Check the YAML: YAML checker.
How to pair it
- In Zigbee2MQTT click Permit join.
- Put the device in pairing mode: usually a long press of the reset button (5–10 s) until the LED blinks; bulbs: switch the power off and on 5–6 times.
- Keep the device close to the coordinator or a router while pairing.
- Give it a clear name: MQTT topics and Home Assistant entities are built from it.
Exact procedure and model notes: the device page in the Zigbee2MQTT docs. No coordinator yet: coordinator picker.