hobbyquaker / node-red-contrib-zigbee

Node-RED Nodes for ZigBee Devices 🐝
MIT License
86 stars 15 forks source link

[FR] Converter: Override topic with msg.topic #73

Open Sineos opened 4 years ago

Sineos commented 4 years ago

I have a 2 channel relay controller. To control it, the topic is either: zigbee/LichtTreppeUG/l1/set respectively zigbee/LichtTreppeUG/l2/set.

The converter node will only work if the set topic matches the msg.topic, i.e. zigbee/${name}/l1/set. If it does not match, a topic mismatch error is thrown.

I would find it more intuitive, to just pass the desired topic via msg.topic or to have kind of a topic regex pattern like zigbee/${name}/*

bohtho commented 4 years ago

Isn’t the “MQTT way” to use “#”, or “+/set” instead of “*” in the pattern?

Sineos commented 4 years ago

Is this related to my issue here: https://github.com/Koenkk/zigbee-herdsman-converters/issues/756

Using the command node and publishing to endpoint 1 will work for channel 1 on the relay, while publishing to endpoint 2 will work for channel 2.

@bohtho I would be fine with mqtt way or regex way. Basically it should be sufficient to pass / override the node's setting with the supplied topic of the preceding flow.