-
Notifications
You must be signed in to change notification settings - Fork 10
Interference between pimatic-hap and Homeduino RF #39
Comments
What type of dimmer do you use? |
Kaku device. But i don't think that had any influence on the behaviour as there is no feedback signal from the device to the RF receiver. My guess it has more to do with "slow" reaction and by the time one end has processed the signal the other end has already changed it. In the very early days of hap plugin / homeduino I did not have this behaviour. But now it is there for a while and it is consistent. Before it was occasionally... Maybe this info helps with debugging. Try to dig in the source as well but I get a bit lost. |
Your guess is right i think. The frontend is sending multiple values while sliding the dimmer. Do you use the frontend for changing the dim level? Or do you have a remote? |
And what about the repeats that homeduino sends? Maybe thats the problem. First it sends a dim level of 13, then 15, then the first repeat sends another 13. Since this is done parallel, i think pimatic-hap gets confused. |
Don't know about that at that moment I am not touching anything... So a loop is created |
Sorry wrong button for closing... I already posted some feedback in that issue as well. The sliding back dimmers were caused by an bug in homeduino. So here it could be the same case that a bug in homeduino is triggering some unwanted behaviour in the hap plugin. |
Ok Thanks, it is updating now. Takes a little while as other updates are running as well. Will test it tomorrow and let you know! |
I was using the latest homeduino but still had sliding back dimmers. With 0.8.0 it was gone. Hope it helps for you as well |
Unfortunately it did not solve the problem. Got a new piece of feedback: Via the web I changed the dimlevel (lamp was off) to 47. It start oscilating between 47 and 44. Then after a while I tried to change it back to 0 via the web. Then it started oscilating between values 47 / 44 and 0... See below. Can it maybe have something to do with rounding the values of the dimlevel? 18:22:14.213 [pimatic-homeduino] debug: data: "ACK" |
Would there be anyway how I can debug it in more detail, to see what is happening under the hood? |
you can enable debug output in the pimatic-hap plugin. Additionally you could add some more debug statements in the code itself. |
Ok the debug option was already enabled but I will add a few more debug lines in the code so we can see what is happening. |
By default no plugin has the debug option, but you can still add it to the config. it will be recognized by pimatic, although it logs a warning that debug isn't allowed. One day I'll fix this, but for now, its the way how it works. |
I have noticed that if I control the dimmer via rules it works. If PIR signals present then dim the Lamp to 40 -> No problem. If PIR is absent then turn off Lamp ->No problem. Pushing the off button on home-app on iPhone works as well but sliding is a problem. |
i'm pretty sure this is because different dim levels are sent in short intervals. If you switch from 10% to 70% it will send commands in between, too, like 40%. The pimatic-hap is still busy working with the 40% request, when the 70% request comes in. Because i have to remember what the current state (dim level, on/off etc.) of the device is (to prevent infinite loops), this mechanism doesn't work sometimes when a new request comes in too fast. |
Would it be possible to build a short delay after receiving a value? If a new value is received, drop the old value, if no value is received for the delay period then continue execute the routine? |
That means you have to wait 500 - 1000 ms more than before. I would say no. I'm planning to implement some semaphore that prevents subsequent request from interfere. |
I was already changing my comment you were to fast in reply. But can't you drop values in the queue if they are entered to fast in the queue. |
If I dropped any request chances are good that I drop the wrong request. That means for my dimmer example that I would drop the last of two requests which would be the actual dim level that the user wanted to switch to. Bad idea. Sorry |
I understand your remark but I was not suggesting to drop the last package. I had more the following sequence in my mind. Receive the value, que it and wait for XX ms. If there is a new request drop the first item and que this request wait for XX ms, etc. If no new request is received within the XX ms execute the last request. Only request are dropped when they are overruled by new info...? |
That would leave the last value when dimming. This would work probably, although with a bigger delay than before. Whats also missing would be the smoothly dimming from on value to another with the steps between. No, I'm still working on a solution that just queues the request and processes them FIFO. |
You are right about the smooth dimming and let us hope it works. I am more than happy to test and make the system wife aproved! |
I think it must be really fast! The new implementation adds a "queue" where the requests are put into and then they are processed synchronously. First tests look good. |
Please checkout https://github.com/michbeck100/pimatic-hap/tree/request_queue and test if the issue is resolved for you. |
As far as I know, I am not using a RF repeater. But to my feeling it makes no sense for the homeduino unit to receive the same signal you have just submitted. |
And it seems that it even receives a slightly different signal with different values. If the values wouldn't change there would be no flickering and no infinite loop. |
Hi, as you can see I have opened an issue on homeduino as well. To have some experts reviewed the homeduino behaviour. I will do some more debugging tonight. |
I consider this issue closed then, because pimatic-hap can't do anything then react, if it gets values from homeduino. If the values were at least equal, then you wouldn't have this infinite loop. |
Well not completely closed as even when I switch the receiving part off. The HAP plugin does retrigger homeduino to submit again? See last test log in the issue....? Do you have the same behaviour. |
Ok, i reopen this again. Please post your complete log without the receiving part and describe what you are doing there, e.g. switch on/off using pimatic or pimatic-hap or remote control. I think we're getting closer to the root of this problem. |
First the answer to the last question. I have manually installed the request-queue branch. So that is the version. Switching ON Via the Pimatic User Interface 16:27:00.783 [pimatic-homeduino] debug: Sending Protocol: switch1 id:43962 unit:9 all:false state:true Pin:4 Repeats:7 Switching OFF Via the Pimatic User Interface 16:27:03.103 [pimatic-homeduino] debug: Sending Protocol: switch1 id:43962 unit:9 all:false state:false Pin:4 Repeats:7 OPENING HOME APP ON IPHONE 16:27:09.786 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics Switching the same Lamp ON via the HOME APP 16:27:20.282 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics Switching the same Lamp OFF via the HOME APP 16:27:22.675 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics |
I have recompiled the latest homeduino sketch and uploaded this to the Nano and it looks like that this has helped...No more receiving after sending. And even better Rock Solid behaviour when dimming my lamps! YEAH... |
Good to hear. The second sending is because pimatic-homeduino send the event that the state has changed before sending the RF signal. pimatic-hap observes the event and triggers another sending. But sending true two times doesn't change anything on the switch. So I would consider this issue as closed. |
Last night suddenly I had am issue with one of my dimmer. It might be triggered by my pir but suddenly the light was dimming from 0 to 100 and back again... Verstuurd vanaf mijn iPhone
|
What Screenshots? Do you also have the part of the log file? |
I am abroad at the moment but I could trace the part in log... |
some line seem to be truncated, i would need the complete text. Apart from that there was an error at 05:09:47.002. this would be interesting |
Now a better copy paste of the log I hope.... |
Honestly, this is pretty confusing. Apart from the error at 05:09:47.002 there are also some rules int the log. I think i need the rules and devices from your config file, too. If you have some dev experience it would also help if you could add some more debug log statements in the pimatic-hap sources. |
Hi I would love to do some more debugging on this. It is not the first time I have noticed this effect... at the moment I am abroad so I have switched of the hap plugin to keep my wife happy and not having her to call me to reboot the device in the middle of the night...;-) I can send you a part of the config file with the rules and devices would that help? Verstuurd vanaf mijn iPhone
|
This might help. I must understand which way the dim requests go and why they keep changing. Since i can't build your environment at home, i have to follow the request in my mind. Depending on the complexity of your devices and rules this might be really confusing. |
Ok here it is not very complex |
I've experienced the same issue as mentioned here. This is what it look like now:
I think it doesn't have to do with rules, only with slow responding devices/homeduino and the hap plugin thinks a new value is set while the homeduino was actually setting the previous one. If I can add some debug statements let me know. |
That change is obvious. if i remember correctly pimatic-hap did compare the device's value directly in some earlier version already. I had to change this, because some plugins fire the change event BEFORE changing the value. Then there is an endless loop again. After that i figured that saving the state on my own would be the safest way. |
How can I test this change? Is it in a new version or should I clone the
|
I released version 0.8.2 yesterday. In theory your problems should be fixed, too. Could you please install the update and test the changes? I'll close this issue for now. If the problems still exists, just reopen it. |
OK I am installing it at the moment. I hope it will be stable and I can use the SIRI commands again. Thanks for the great work! |
Thanks this update solved the problems I had before! |
This issue is already present for a while and reported in an other issue. Today I did a bit of debugging. If I disable the Hap plugin, it does not happen. As soon as I enable the pluging the interference starts.
As soon as I change the setting for my RF Dimmer it keeps oscillating between values. This behaviour is consistant. The only way to stop is to restart pimatic. I have enabled debug for homeduino and hap. Below the output.
This does not only happen with the dimmer but also with a switch. I have one door contact which activates a RFswitch. Sometime in keeps oscillating between ON/OFF. Again restarting is the only way out. This behaviour is not consistant.
16:50:09.744 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:0 all:false dimlevel:2 Pin:4 Repeats:1
16:50:10.481 [pimatic-homeduino] debug: data: "ACK"
16:50:10.518 [pimatic-homeduino] debug: data: "RF receive 352 2644 212 1258 10412 0 0 0 0102030203020302030203030202030302020302030203030203020203020303020302030202030203020303020203030203020203020302020203020302030203020302030302020304"
16:50:10.626 [pimatic-homeduino] debug: received: [ 212, 352, 1258, 2644, 10412 ] 1310121012101210121012121010121210101210121012121012101012101212101210121010121012101212101012121012101012101210101012101210121012101210121210101214
16:50:11.168 [pimatic-homeduino] debug: dimmer1: { id: 1337110, all: false, unit: 0, dimlevel: 2, state: undefined }
16:50:11.198 [pimatic-hap] debug: changing dimlevel of Lamp Bank to 13
16:50:11.214 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:0 all:false dimlevel:2 Pin:4 Repeats:1
16:50:11.283 [pimatic-hap] debug: changing dimlevel of Lamp Bank to 15
16:50:11.296 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:0 all:false dimlevel:2 Pin:4 Repeats:1
16:50:12.200 [pimatic-homeduino] debug: data: "ACK"
16:50:12.216 [pimatic-homeduino] debug: data: "RF receive 352 2640 211 1258 10408 0 0 0 0102030203020302030203030202030302020302030203030203020203020303020302030202030203020303020203030203020203020302020203020302030203020302030302020304"
16:50:12.236 [pimatic-homeduino] debug: received: [ 211, 352, 1258, 2640, 10408 ] 1310121012101210121012121010121210101210121012121012101012101212101210121010121012101212101012121012101012101210101012101210121012101210121210101214
16:50:12.261 [pimatic-homeduino] debug: dimmer1: { id: 1337110, all: false, unit: 0, dimlevel: 2, state: undefined }
16:50:12.278 [pimatic-hap] debug: changing dimlevel of Lamp Bank to 13
16:50:12.289 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:0 all:false dimlevel:2 Pin:4 Repeats:1
16:50:13.101 [pimatic-homeduino] debug: data: "ACK"
16:50:13.141 [pimatic-homeduino] debug: data: "RF receive 303 2660 214 1278 10444 0 0 0 0102030203020302030003030200030300000300030003030003000003000303000300030000030003000303000003030003000003000300000003000300030003000300030300000304"
16:50:13.164 [pimatic-homeduino] debug: received: [ 214, 303, 1278, 2660, 10444 ] 1310121012101210121112121011121211111211121112121112111112111212111211121111121112111212111112121112111112111211111112111211121112111211121211111214
16:50:13.184 [pimatic-homeduino] debug: dimmer1: { id: 1337110, all: false, unit: 0, dimlevel: 2, state: undefined }
16:50:13.214 [pimatic-hap] debug: changing dimlevel of Lamp Bank to 15
16:50:13.226 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:0 all:false dimlevel:2 Pin:4 Repeats:1
16:50:13.796 [pimatic-homeduino] debug: data: "ACK"
16:50:13.837 [pimatic-homeduino] debug: data: "RF receive 297 2672 212 1286 10452 0 0 0 0102030003000300030003030000030300000300030003030003000003000303000300030000030003000303000003030003000003000300000003000300030003000300030300000304"
16:50:13.860 [pimatic-homeduino] debug: received: [ 212, 297, 1286, 2672, 10452 ] 1310121112111211121112121111121211111211121112121112111112111212111211121111121112111212111112121112111112111211111112111211121112111211121211111214
16:50:13.881 [pimatic-homeduino] debug: dimmer1: { id: 1337110, all: false, unit: 0, dimlevel: 2, state: undefined }
16:50:13.897 [pimatic-hap] debug: changing dimlevel of Lamp Bank to 13
The text was updated successfully, but these errors were encountered: