2 gang switch thing configuration

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?

I’m pretty sure the Thing has to be different:

Thing topic switch_1 "switch_1" {
    Channels:
    Type switch : switch1   "switch 1" [ stateTopic="zigbee2mqtt/switch_1", transformationPattern="REGEX:.*l1.*∩JSONPATH:$.state_l1", commandTopic="zigbee2mqtt/switch_1/set", formatBeforePublish="{\"state_l1\": \"%s\"}"]
    Type switch : switch2   "switch 2" [ stateTopic="zigbee2mqtt/switch_1", transformationPattern="REGEX:.*l2.*∩JSONPATH:$.state_l2", commandTopic="zigbee2mqtt/switch_1/set", formatBeforePublish="{\"state_l2\": \"%s\"}"]
    Type number : linkquality  "link quality" [ stateTopic="zigbee2mqtt/switch_1", transformationPattern="JSONPATH:$.linkquality"]
}

Please be aware that switch_1 within the full topic is so identify the device, not the channel.
The stateTopic is to receive the actual state, which is given as a JSON, so we have to use JSONPATH to filter down to the value. However, the JSON will not necessarily always send the value for all channels, so you have to ensure that only valid JSON states are used, therefor use an additional REGEX and intersect (∩) both transformations.
To send the command, also use JSON through the generic set topic.

As both values ON and OFF are the same as in openHAB, there is no need to set on or off property at all.