prefixkit Ask an engineerAsk Support RU

Zigbee devices Switches and relays

Tuya M9Pro

Smart 4 gang switch, curtain, smart light or scene. 1x thermostat control. Works with Zigbee2MQTT with no vendor hub or cloud: it pairs with a Zigbee stick and shows up in Home Assistant.

Vendor
Tuya
Model
M9Pro
Type
Switches and relays
Power
mains: usually a router that extends the mesh
Firmware updates (OTA)
no

Find it in shops: AliExpress

Links open a search in the shop; some are affiliate links: buying through them costs you nothing extra and supports this site. We do not sell devices or get them from manufacturers.

What it exposes

FeaturePropertyValuesControl
On / off (l1)state_l1—settable
On / off (l2)state_l2—settable
On / off (l3)state_l3—settable
On / off (l4)state_l4—settable
Mode (l1)mode_l1switch, scene, smart_light, curtainsettable
Mode (l2)mode_l2switch, scene, smart_light, curtainsettable
Mode (l3)mode_l3switch, scene, smart_light, curtainsettable
Mode (l4)mode_l4switch, scene, smart_light, curtain, thermostatsettable
Name (l1)name_l1—settable
Name (l2)name_l2—settable
Name (l3)name_l3—settable
Name (l4)name_l4—settable
Scene name (l1)scene_name_l1—settable
Scene name (l2)scene_name_l2—settable
Scene name (l3)scene_name_l3—settable
Scene name (l4)scene_name_l4—settable
Dimmer name (l1)dimmer_name_l1—settable
Dimmer name (l2)dimmer_name_l2—settable
Dimmer name (l3)dimmer_name_l3—settable
Dimmer name (l4)dimmer_name_l4—settable
Dimmer switch (l1)dimmer_switch_l1—settable
Dimmer switch (l2)dimmer_switch_l2—settable
Dimmer switch (l3)dimmer_switch_l3—settable
Dimmer switch (l4)dimmer_switch_l4—settable
Brightness (l1)brightness_l10…254read only
Brightness (l2)brightness_l20…254read only
Brightness (l3)brightness_l30…254read only
Brightness (l4)brightness_l40…254read only
Color temp (l1)color_temp_l10…254read only
Color temp (l2)color_temp_l20…254read only
Color temp (l3)color_temp_l30…254read only
Color temp (l4)color_temp_l40…254read only
Curtain name (l1)curtain_name_l1—settable
Curtain name (l2)curtain_name_l2—settable
Curtain name (l3)curtain_name_l3—settable
Curtain name (l4)curtain_name_l4—settable
Curtain switch (l1)curtain_switch_l1—settable
Curtain switch (l2)curtain_switch_l2—settable
Curtain switch (l3)curtain_switch_l3—settable
Curtain switch (l4)curtain_switch_l4—settable
Group id (l1)group_id_l11…10000settable
Group id (l2)group_id_l21…10000settable
Group id (l3)group_id_l31…10000settable
Group id (l4)group_id_l41…10000settable
After power losspower_on_behavioroff, on, previoussettable
After power loss (l1)power_on_behavior_l1off, on, previoussettable
After power loss (l2)power_on_behavior_l2off, on, previoussettable
After power loss (l3)power_on_behavior_l3off, on, previoussettable
After power loss (l4)power_on_behavior_l4off, on, previoussettable
Show weathershow_weather—settable
Backlightbacklight—settable
Show screenshow_screenmotion, on_press, onsettable
Thermostatthermostat—settable
Thermostat namethermostat_name—settable
Heating setpointcurrent_heating_setpoint16…32read only
Fan modefan_mode0…3read only
Scene switchscene_switchswitch_1, switch_2, switch_3, switch_4, switch_5, switch_6, switch_7, switch_8 …settable
Temperaturetemperature_1-65…99settable
Condition 1condition_1sunny, heavy_rain, cloudy, sandstorm, light_snow, snow, freezing_fog, rainstorm …settable
Action (button press)actionscene_0, scene_1, scene_2, scene_3, scene_4, scene_5, scene_6, scene_7 …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_l1": "ON",
  "state_l2": "ON",
  "state_l3": "ON",
  "state_l4": "ON",
  "mode_l1": "switch",
  "mode_l2": "switch",
  "mode_l3": "switch",
  "mode_l4": "switch",
  "dimmer_switch_l1": false,
  "dimmer_switch_l2": false,
  "dimmer_switch_l3": false,
  "dimmer_switch_l4": false,
  "brightness_l1": 127,
  "brightness_l2": 127,
  "linkquality": 120
}

Send commands to zigbee2mqtt/my_device/set:

mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"state_l1":"TOGGLE"}'
mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"state_l2":"TOGGLE"}'
mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"state_l3":"TOGGLE"}'
mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"state_l4":"TOGGLE"}'
mosquitto_pub -t zigbee2mqtt/my_device/set -m '{"mode_l1":"scene"}'

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_l1

Check the YAML: YAML checker.

How to pair it

  1. In Zigbee2MQTT click Permit join.
  2. 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.
  3. Keep the device close to the coordinator or a router while pairing.
  4. 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.

Similar devices

Idea?