As described in this topic New thing doesn't have chanells - #12 by PabloP automatically adding things is buggy as channels are not discovered properly.
I create a config file a 1 gage switch … It was easy
Thing topic switch_1 "switch_1" {
Channels:
Type switch : switch "switch 1" [ stateTopic="zigbee2mqtt/switch_1", commandTopic="zigbee2mqtt/switch_1/set", transformationPattern="JSONPATH:$.state", on="ON", off="OFF"]
Type number : linkquality "link quality" [ stateTopic="zigbee2mqtt/switch_1", transformationPattern="JSONPATH:$.linkquality"]
}
However I failed with 2 gang switch
Thing topic switch_4 "switch_4" {
Channels:
Type switch : switch_1 "switch 4_1" [ stateTopic="zigbee2mqtt/switch_4/state_l1", commandTopic="zigbee2mqtt/switch_4/set/state_l1", transformationPattern="JSONPATH:$._l1", on="ON", off="OFF"]
Type switch : switch_2 "switch 4_2" [ stateTopic="zigbee2mqtt/switch_4/state_l2", commandTopic="zigbee2mqtt/switch_4/set/state_l2", transformationPattern="JSONPATH:$._l2", on="ON", off="OFF"]
Type number : linkquality "link quality" [ stateTopic="zigbee2mqtt/switch_4", transformationPattern="JSONPATH:$.linkquality"]
}
I followed the specification TuYa TS0002_switch_module_2 control via MQTT | Zigbee2MQTT but it doesn’t work. It does change the states, but can not read statuses.
Can someone give me hint, how to configure it correctly?