Move SWITCH and ID values to the topic
Closed this issue · 4 comments
The RFLink protocol sends the SWITCH parameter as a data field. However, it is often useful to consider it a part of the address, especially when using multi-channel switches. It would thus be very useful to include it in the topic. It would be great to add a config option that controls if the SWITCH number is put in the topic or not.
E.g. my multi-channel remote now generates messages like:
rflink/Kaku/44/R/CMD "ON"
rflink/Kaku/44/R/SWITCH "2"
rflink/Kaku/44/R/message "20;69;Kaku;ID=44;SWITCH=2;CMD=ON;"
This is only a meningful event if we know both the channel and the command. The HA controller will either have to combine (1) and (2) or parse the string in message (3) to understand it.
It would be much more convenient if RFLinkGateway included the SWITCH in the topic and sent messages like:
rflink/Kaku/44/R/2/CMD "ON"
rflink/Kaku/44/R/message "20;69;Kaku;ID=44;SWITCH=2;CMD=ON;"
Then we can subscribe to "rflink/Kaku/44/2/CMD" and listen to ON/OFF messages for channel 2 in a single topic/message. Similarly to how Write messages are constructed.
hi, can you try that please ? (works for me) :
git clone --single-branch -b devel---move-switch-id-to-topic https://github.com/aschor/RFLinkGateway.git
Hi,
A pull request is welcome. Thanks.