domoticz / domoticz

Open source Home Automation System
http://www.domoticz.com
GNU General Public License v3.0
3.47k stars 1.12k forks source link

Domoticz sends SYNCID after RFLink string #5239

Closed urkelbundy closed 1 year ago

urkelbundy commented 2 years ago

Hi all,

I'm using the RFLink gateway MQTT of Domoticz 2022.1 together with the espRFLinkMQTT software on a Nodemcu. Receiving 433Mhz sensors works great but switching a switch doesn't seem to work.

I used the mosquitto client to subscribe to rflink/out to see what Domoticz is sending when a switch was switched ON. What I expected to see is for example: 10;NewKaku;1234567;1;ON; What was sent by Domoticz is: 10;NewKaku;1234567;1;ON;SYNCID=65fdd29e;

When 10;NewKaku;1234567;1;ON; is published to the rflink/out topic the switch switches to ON. So it is definitely the SYNCID part that shouldn't be there.

The RFLink doesn't respond to the string received because of the SYNCID=65fdd29e; part, so the switch is not switched to ON.

What is that SYNCID=65fdd29e; part doing there? Why is Domoticz sending it? I use Domoticz in a docker pulled from docker hub from LinuxServer.io

Is there something wrong with my Domoticz docker or is espRFLinkMQTT missing something that should filter the SYNCID part?

Best regards

urkelbundy commented 2 years ago

I found it in the Domoticz code in RFLinkMQTT.cpp sstr << msg << "SYNCID=" << std::hex << m_syncid << ";\n";

Please explain what the idea behind this SYNCID is!?

waltervl commented 2 years ago

Looking at the source code the author of the Domoticz rflinkmqtt gateway is the same as the author of the https://github.com/pagocs/esp32-rflinkmqttgateway @pagocs can you please answer the question?

waltervl commented 2 years ago

I think it could be related to multiple RFLink devices, see comments in PR https://github.com/domoticz/domoticz/pull/5135

waltervl commented 2 years ago

I think it could be related to multiple RFLink devices, see comments in PR #5135

That PR is implemented in Beta 2022.1 in februari. So perhaps you have to update your environment to latest beta if you are using 2022.1 stable.

urkelbundy commented 2 years ago

I think it could be related to multiple RFLink devices, see comments in PR https://github.com/domoticz/domoticz/pull/5135

I looked at that part of code but I think it is not related to my question. A CRC code is calculated for the message received. When an identical message is received within a certain time frame and the CRC code of this message is identical to that of the previous message, the latter message is ignored as it is considered the same. Identical messages are most likely to occur when multiple RFLink devices publish the same message and this has nothing to do with SYNCID.

So my question still remains. What is the SYNCID part for?

waltervl commented 2 years ago

SyncID is also used in authors esp library https://github.com/pagocs/esp32-rflinkmqttgateway You are using another library it seems, so perhaps uploading his library on your board will solve your issue.

I do not know the reason why the author @pagocs has implemented this SyncID. Perhaps creating an issue on his library will give a reaction. I am closing this issue for now. If needed it can be reopened.

pagocs commented 1 year ago

Sorry for missing this thread... :( The syncID mechanism is added for supporting multiple domoticz instance.

If it is still an issue I can add a config options for this function.

urkelbundy commented 1 year ago

Hi,

I changed the ESP software so that it works for me but a config option would be better

pagocs commented 1 year ago

I finished the modification