I am in the process of changing from OpenHAB Zigbee binding to MQTT and Zigbee2MQTT, to be able to use a wider range of devices. Steep learning curve, so far.
I have a MHCOZY 4-channel relay (MHCOZY TYWB 4ch-RF control via MQTT | Zigbee2MQTT). It worked under the Zigbee binding. Under Z2M I have created a Thing for the device, and Channel and Item for the first of the relays (so far).
OpenHAB has contact with the relay. When I manually swich the relay ON or OFF, this is reflected in OpenHAB. The problem is, I have not found out how to control the relay from OpenHAB.
Using the information on the abovementioned web page, I have set up the channel like this:
I don’t think so. Then you wouldn’t have any way to distinguish between the four diffrernt relays (the “set” topic is on the thing level, not channel level)
Yes, I know I must have one channel per relay. I only finished the first one.
The problem is, as I understand the doc, my device has one common “set” topic for all the relays. In your example, there is a differnt topic for each, which is a different scenario.
Anyway, to be sure, I tried the syntax you sent. It did not work