Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Interference between pimatic-hap and Homeduino RF #39

Closed
rspaargaren opened this issue Sep 11, 2016 · 58 comments
Closed

Interference between pimatic-hap and Homeduino RF #39

rspaargaren opened this issue Sep 11, 2016 · 58 comments

Comments

@rspaargaren
Copy link

rspaargaren commented Sep 11, 2016

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

@michbeck100
Copy link
Owner

What type of dimmer do you use?

@rspaargaren
Copy link
Author

rspaargaren commented Sep 11, 2016

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.

@michbeck100
Copy link
Owner

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?

@michbeck100
Copy link
Owner

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.

@rspaargaren
Copy link
Author

rspaargaren commented Sep 11, 2016

Don't know about that at that moment I am not touching anything... So a loop is created

@michbeck100
Copy link
Owner

I think this one is the same bug like described in #37 and might be fixed by 2a773af.

@rspaargaren
Copy link
Author

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.

@michbeck100
Copy link
Owner

Just released version 0.8.0 including 2a773af. Please test if this helps. I did have a strange behavior at home with sliding back dimmers as described in #37 and it was gone with the update. Maybe this fix helps with the infinite switching, too.

@rspaargaren
Copy link
Author

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!

@michbeck100
Copy link
Owner

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

@rspaargaren
Copy link
Author

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"
18:22:14.255 [pimatic-homeduino] debug: data: "RF receive 295 2668 1288 10440 0 0 0 0 0100020002000200020002020000020200000200020002020002000002000202000200020000020002000202000002020002000002000200000002000200020002000202000200020003"
18:22:14.281 [pimatic-homeduino] debug: received: [ 295, 1288, 2668, 10440 ] 0200010001000100010001010000010100000100010001010001000001000101000100010000010001000101000001010001000001000100000001000100010001000101000100010003
18:22:14.302 [pimatic-homeduino] debug: dimmer1: { id: 1337110, all: false, unit: 0, dimlevel: 7, state: undefined }
18:22:14.318 [pimatic-hap] debug: changing dimlevel of Lamp Bank to 47
18:22:14.336 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:0 all:false dimlevel:7 Pin:4 Repeats:1
18:22:14.918 [pimatic-homeduino] debug: data: "ACK"
18:22:14.957 [pimatic-homeduino] debug: data: "RF receive 297 2672 218 1288 10448 0 0 0 0102030203000300030003030000030300000300030003030003000003000303000300030000030003000303000003030003000003000300030003000300030003000300030003000304"
18:22:14.981 [pimatic-homeduino] debug: received: [ 218, 297, 1288, 2672, 10448 ] 1310121012111211121112121111121211111211121112121112111112111212111211121111121112111212111112121112111112111211121112111211121112111211121112111214
18:22:15.002 [pimatic-homeduino] debug: dimmer1: { id: 1337110, all: false, unit: 0, dimlevel: 0, state: false }
18:22:15.018 [pimatic-hap] debug: changing dimlevel of Lamp Bank to 0
18:22:15.034 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:0 all:false state:false dimlevel:0 Pin:4 Repeats:1
18:22:15.050 [pimatic-hap] debug: value false equals current state of Lamp Bank. Not switching.
18:22:15.090 [pimatic-homeduino] debug: pir5: { id: 1337110, all: false, presence: false, unit: 0 }
18:22:15.110 [pimatic-homeduino] debug: contact1: { id: 1337110, all: false, contact: true, unit: 0 }
18:22:15.613 [pimatic-homeduino] debug: data: "ACK"
18:22:15.652 [pimatic-homeduino] debug: data: "RF receive 295 2676 1288 10444 0 0 0 0 0100020002000200020002020000020200000200020002020002000002000202000200020000020002000202000002020002000002000200000002000200020002000202000200020003"
18:22:15.677 [pimatic-homeduino] debug: received: [ 295, 1288, 2676, 10444 ] 0200010001000100010001010000010100000100010001010001000001000101000100010000010001000101000001010001000001000100000001000100010001000101000100010003
18:22:15.699 [pimatic-homeduino] debug: dimmer1: { id: 1337110, all: false, unit: 0, dimlevel: 7, state: undefined }
18:22:15.725 [pimatic-hap] debug: changing dimlevel of Lamp Bank to 47
18:22:15.737 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:0 all:false dimlevel:7 Pin:4 Repeats:1
18:22:15.754 [pimatic-hap] debug: value true equals current state of Lamp Bank. Not switching.
18:22:16.308 [pimatic-homeduino] debug: data: "ACK"
18:22:16.347 [pimatic-homeduino] debug: data: "RF receive 295 2668 1288 10440 0 0 0 0 0100020002000200020002020000020200000200020002020002000002000202000200020000020002000202000002020002000002000200000002000200020002000202000200020003"
18:22:16.368 [pimatic-homeduino] debug: received: [ 295, 1288, 2668, 10440 ] 0200010001000100010001010000010100000100010001010001000001000101000100010000010001000101000001010001000001000100000001000100010001000101000100010003
18:22:16.392 [pimatic-homeduino] debug: dimmer1: { id: 1337110, all: false, unit: 0, dimlevel: 7, state: undefined }
18:22:16.420 [pimatic-hap] debug: changing dimlevel of Lamp Bank to 44

@rspaargaren
Copy link
Author

Would there be anyway how I can debug it in more detail, to see what is happening under the hood?

@michbeck100
Copy link
Owner

you can enable debug output in the pimatic-hap plugin. Additionally you could add some more debug statements in the code itself.
Especially pay attention to the debug lines 'changing dimlevel of device to x' and 'value x equals current dim level of device. Not changing.'. These should be in that order. If you encounter the 'changing ...' line two times without the other line in between, that means that homeduino switched to "fast".

@rspaargaren
Copy link
Author

rspaargaren commented Sep 13, 2016

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.
BTW there is no debug option in the menu off pimatic 0.9.0 of the hap plugin...?

@michbeck100
Copy link
Owner

michbeck100 commented Sep 26, 2016

BTW there is no debug option in the menu off pimatic 0.9.0 of the hap plugin...?

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.

@rspaargaren
Copy link
Author

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.
Maybe a side step, the dimmer are shown as on in the home-app of apple even though they are turned off. (by the rule above).

@michbeck100
Copy link
Owner

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.

@rspaargaren
Copy link
Author

rspaargaren commented Sep 26, 2016

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?

@michbeck100
Copy link
Owner

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.

@rspaargaren
Copy link
Author

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.

@michbeck100
Copy link
Owner

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

@rspaargaren
Copy link
Author

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...?

@michbeck100
Copy link
Owner

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.
I hope to have a working branch until tomorrow, so you can test if it works.

@rspaargaren
Copy link
Author

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!
My only concern is that still loops can be created after fast switching. Let us say I switch something on/off fast by a contact. Pimatic send ON to hab and little later OFF. ON is executed and hap send back status ON but Pimatic is already OFF so it is changing the state to ON again and sending this to HAP to be queued but HAP is working on OFF etc etc then a que will not help or am I wrong about the procedure?

@michbeck100
Copy link
Owner

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.

@michbeck100
Copy link
Owner

Please checkout https://github.com/michbeck100/pimatic-hap/tree/request_queue and test if the issue is resolved for you.

@rspaargaren
Copy link
Author

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.

@michbeck100
Copy link
Owner

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.

@rspaargaren
Copy link
Author

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.

@michbeck100
Copy link
Owner

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.
You can still open this issue again, if there's still a problem with pimatic-hap, after the homeduino issue is solved.

@rspaargaren
Copy link
Author

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.

@michbeck100 michbeck100 reopened this Sep 29, 2016
@michbeck100
Copy link
Owner

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.
Another question is, did you use the branch from https://github.com/michbeck100/pimatic-hap/tree/request_queue or the official release?

@rspaargaren
Copy link
Author

First the answer to the last question. I have manually installed the request-queue branch. So that is the version.
Now the output from my tests. Homeduino receiving is OFF. First switched in the Pimatic screen second try in the iPhone Home app.

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
16:27:01.413 [pimatic-homeduino] debug: data: "ACK"
16:27:01.455 [pimatic-hap] debug: switching device Lamp Kast to true
16:27:01.486 [pimatic-homeduino] debug: Sending Protocol: switch1 id:43962 unit:9 all:false state:true Pin:4 Repeats:7
16:27:02.157 [pimatic-homeduino] debug: data: "ACK"

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
16:27:03.732 [pimatic-homeduino] debug: data: "ACK"
16:27:03.774 [pimatic-hap] debug: switching device Lamp Kast to false
16:27:03.805 [pimatic-homeduino] debug: Sending Protocol: switch1 id:43962 unit:9 all:false state:false Pin:4 Repeats:7
16:27:04.490 [pimatic-homeduino] debug: data: "ACK"

OPENING HOME APP ON IPHONE

16:27:09.786 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:09.818 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":22,"iid":14,"ev":true}]
16:27:09.838 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Motion Detected" for events
16:27:09.995 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:10.020 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":14,"iid":14,"ev":true}]
16:27:10.037 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "On" for events
16:27:10.196 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:10.224 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":4,"iid":14,"ev":true},{"aid":4,"iid":15,"ev":true},{"aid":4,"iid":16,"ev":true},{"aid":4,"iid":17,"ev":true},{"aid":4,"iid":18,"ev":true}]
16:27:10.242 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Current Heating Cooling State" for events
16:27:10.256 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Target Heating Cooling State" for events
16:27:10.270 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Current Temperature" for events
16:27:10.283 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Target Temperature" for events
16:27:10.301 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Temperature Display Units" for events
16:27:10.543 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:10.570 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":9,"iid":14,"ev":true}]
16:27:10.586 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Motion Detected" for events
16:27:10.814 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:10.837 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":7,"iid":14,"ev":true}]
16:27:10.860 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Current Temperature" for events
16:27:11.001 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:11.031 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":8,"iid":14,"ev":true}]
16:27:11.047 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Motion Detected" for events
16:27:11.185 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:11.207 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":20,"iid":14,"ev":true}]
16:27:11.223 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Motion Detected" for events
16:27:11.374 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:11.397 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":5,"iid":14,"ev":true},{"aid":5,"iid":15,"ev":true}]
16:27:11.416 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "On" for events
16:27:11.431 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Brightness" for events
16:27:11.591 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:11.613 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":16,"iid":14,"ev":true}]
16:27:11.632 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Contact Sensor State" for events
16:27:11.774 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:11.797 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":18,"iid":14,"ev":true}]
16:27:11.813 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "On" for events
16:27:11.974 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:11.997 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":12,"iid":14,"ev":true},{"aid":12,"iid":15,"ev":true}]
16:27:12.013 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "On" for events
16:27:12.027 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Brightness" for events
16:27:12.196 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:12.219 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":3,"iid":14,"ev":true}]
16:27:12.236 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Current Temperature" for events
16:27:12.382 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:12.405 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":21,"iid":14,"ev":true}]
16:27:12.422 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Motion Detected" for events
16:27:12.574 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:12.596 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":19,"iid":14,"ev":true}]
16:27:12.613 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "On" for events
16:27:12.843 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:12.865 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":15,"iid":14,"ev":true}]
16:27:12.882 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "On" for events
16:27:13.117 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:13.143 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":2,"iid":14,"ev":true}]
16:27:13.162 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "On" for events
16:27:13.299 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:13.321 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":10,"iid":14,"ev":true}]
16:27:13.340 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Motion Detected" for events
16:27:13.488 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:13.514 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":11,"iid":14,"ev":true}]
16:27:13.530 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Current Temperature" for events
16:27:13.669 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:13.691 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":6,"iid":14,"ev":true}]
16:27:13.710 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Motion Detected" for events
16:27:13.984 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:14.006 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":13,"iid":14,"ev":true},{"aid":13,"iid":15,"ev":true}]
16:27:14.023 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "On" for events
16:27:14.044 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "Brightness" for events
16:27:14.216 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: PUT /characteristics
16:27:14.239 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":17,"iid":14,"ev":true}]
16:27:14.256 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Registering Characteristic "On" for events
16:27:14.508 [pimatic-hap] debug: [fa:fe:db:e4:36:2c] HAP Request: GET /characteristics?id=20.14,11.14,21.14,22.14,6.14,15.14,10.14,16.14,18.14,13.15,13.14,4.16,4.18,4.14,4.15,4.17,12.15,12.14,5.14,8.14,17.14,2.14,19.14,14.14,9.14
16:27:14.545 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Motion Detected"
16:27:14.583 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Current Temperature"
16:27:14.601 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Motion Detected"
16:27:14.618 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Motion Detected"
16:27:14.632 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Motion Detected"
16:27:14.649 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "On"
16:27:14.673 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Motion Detected"
16:27:14.691 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Contact Sensor State"
16:27:14.709 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "On"
16:27:14.724 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Brightness"
16:27:14.741 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "On"
16:27:14.757 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Current Temperature"
16:27:14.777 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Current Temperature" value: 5
16:27:14.793 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Temperature Display Units"
16:27:14.810 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Temperature Display Units" value: 0
16:27:14.826 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Current Heating Cooling State"
16:27:14.843 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Current Heating Cooling State" value: 1
16:27:14.860 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Target Heating Cooling State"
16:27:14.888 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Target Heating Cooling State" value: 3
16:27:14.902 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Target Temperature"
16:27:14.918 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Brightness"
16:27:14.933 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "On"
16:27:14.948 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "On"
16:27:14.963 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Motion Detected"
16:27:14.981 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "On"
16:27:14.995 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "On"
16:27:15.010 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "On"
16:27:15.025 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "On"
16:27:15.040 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Getting value for Characteristic "Motion Detected"
16:27:15.135 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Motion Detected" value: false
16:27:15.154 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Current Temperature" value: 22.5
16:27:15.174 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Motion Detected" value: false
16:27:15.188 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Motion Detected" value: false
16:27:15.201 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Motion Detected" value: false
16:27:15.214 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "On" value: false
16:27:15.228 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Motion Detected" value: false
16:27:15.242 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Contact Sensor State" value: 0
16:27:15.259 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "On" value: false
16:27:15.272 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Brightness" value: 100
16:27:15.286 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "On" value: true
16:27:15.299 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Target Temperature" value: 5
16:27:15.312 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Brightness" value: 17
16:27:15.325 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "On" value: true
16:27:15.343 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "On" value: false
16:27:15.357 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Motion Detected" value: false
16:27:15.371 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "On" value: false
16:27:15.384 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "On" value: false
16:27:15.398 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "On" value: false
16:27:15.411 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "On" value: false
16:27:15.427 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Got Characteristic "Motion Detected" value: false

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
16:27:20.307 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":15,"iid":14,"value":1}]
16:27:20.327 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Setting Characteristic "On" to value 1
16:27:20.343 [pimatic-hap] debug: switching device Lamp Kast to true
16:27:20.368 [pimatic-homeduino] debug: Sending Protocol: switch1 id:43962 unit:9 all:false state:true Pin:4 Repeats:7
16:27:21.050 [pimatic-homeduino] debug: data: "ACK"
16:27:21.094 [pimatic-hap] debug: value true equals current state of Lamp Kast. Not switching.

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
16:27:22.701 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Processing characteristic set: [{"aid":15,"iid":14,"value":0}]
16:27:22.718 [pimatic-hap] debug: [Pimatic HomeKit Bridge] Setting Characteristic "On" to value 0
16:27:22.731 [pimatic-hap] debug: switching device Lamp Kast to false
16:27:22.755 [pimatic-homeduino] debug: Sending Protocol: switch1 id:43962 unit:9 all:false state:false Pin:4 Repeats:7
16:27:23.432 [pimatic-homeduino] debug: data: "ACK"
16:27:23.474 [pimatic-hap] debug: value false equals current state of Lamp Kast. Not switching.

@rspaargaren
Copy link
Author

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...
Now we still have the effect that if I switch something within Pimatic the sending gets triggered twice after feedback from the Hap plugin. I think the response will be improved when sliding the dimmer if we can eliminate this effect?

@michbeck100
Copy link
Owner

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.

@rspaargaren
Copy link
Author

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...
See screenshots for more info. This time no repeat/echo from the homeduino....?

Verstuurd vanaf mijn iPhone

Op 30 sep. 2016 om 01:14 heeft Michael Kotten notifications@github.com het volgende geschreven:

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.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

@michbeck100
Copy link
Owner

What Screenshots? Do you also have the part of the log file?

@rspaargaren
Copy link
Author

I am abroad at the moment but I could trace the part in log...
05:09:46.486 [pimatic-homeduino] debug: data: "ACK"
05:09:46.511 [pimatic-homeduino] debug: data: "PING"
05:09:46.525 [pimatic-homeduino] debug: data: "PING"
05:09:46.537 [pimatic-homeduino] debug: data: "PING"
05:09:46.550 [pimatic-homeduino] debug: data: "PING"
05:09:46.562 [pimatic-homeduino] debug: data: "PING"
05:09:46.574 [pimatic-homeduino] debug: data: "PING"
05:09:46.585 [pimatic-homeduino] debug: data: "PING"
05:09:46.597 [pimatic-homeduino] debug: data: "PING"
05:09:46.609 [pimatic-homeduino] debug: data: "PING"
05:09:46.621 [pimatic-homeduino] debug: data: "PING"
05:09:46.632 [pimatic-homeduino] debug: data: "PING"
05:09:46.643 [pimatic-homeduino] debug: data: "PING"
05:09:46.885 [pimatic-hap] debug: switching device Lamp Kast $05:09:46.934 [pimatic-homeduino] debug: Sending Protocol: swi$05:09:47.002 [pimatic-homeduino] debug: data: "ERR unknown_co$05:09:47.151 [pimatic-hap] error: Could not call promise: unk$05:09:47.182 [pimatic-hap] debug: Error: unknown_command
05:09:47.182 [pimatic-hap] debug:> at /home/pi/pimatic-app$05:09:47.182 [pimatic-hap] debug:> at tryCatcher (/home/pi$05:09:47.182 [pimatic-hap] debug:> at Promise._settlePromi$05:09:47.182 [pimatic-hap] debug:> at Promise._settlePromi$05:09:47.182 [pimatic-hap] debug:> at Promise._settlePromi$05:09:47.182 [pimatic-hap] debug:> at Async._drainQueue (/$
05:09:47.182 [pimatic-hap] debug:> at Async._drainQueues ($05:09:47.182 [pimatic-hap] debug:> at Immediate.Async.drai$05:09:47.182 [pimatic-hap] debug:> at processImmediate [as$05:09:47.769 [pimatic-homeduino] debug: data: "ACK"
05:09:47.822 [pimatic-hap] debug: changing dimlevel of Lamp H$05:09:47.856 [pimatic-homeduino] debug: Sending Protocol: dim$05:09:47.943 [pimatic] info: rule zonsopgang: Lamp Hal gedimd$05:09:48.066 [pimatic-hap] debug: value true equals current s$05:09:48.457 [pimatic-homeduino] debug: data: "ACK"
05:09:48.499 [pimatic-hap] debug: changing dimlevel of Lamp H$05:09:48.518 [pimatic-homeduino] debug: Sending Protocol: dim$05:09:48.541 [pimatic] info: rule pir-gang-uit: Lamp Hal uitg$05:09:48.661 [pimatic-hap] debug: value false equals current $05:09:49.136 [pimatic-homeduino] debug: data: "ACK"
05:09:49.181 [pimatic-hap] debug: changing dimlevel of Lamp H$05:09:49.195 [pimatic-homeduino] debug: Sending Protocol: dim$05:09:49.214 [pimatic] info: rule zonsopgang: Lamp Hal gedimd$05:09:49.333 [pimatic-hap] debug: value true equals current s$05:09:49.821 [pimatic-homeduino] debug: data: "ACK"
05:09:49.863 [pimatic-hap] debug: changing dimlevel of Lamp H$05:09:49.878 [pimatic-homeduino] debug: Sending Protocol: dim$05:09:49.897 [pimatic] info: rule pir-gang-uit: Lamp Hal uitg$05:09:50.013 [pimatic-hap] debug: value false equals current $05:09:50.500 [pimatic-homeduino] debug: data: "ACK"
05:09:50.541 [pimatic-hap] debug: changing dimlevel of Lamp H$05:09:50.555 [pimatic-homeduino] debug: Sending Protocol: dim$05:09:50.573 [pimatic] info: rule zonsopgang: Lamp Hal gedimd$05:09:50.687 [pimatic-hap] debug: value true equals current s$05:09:51.185 [pimatic-homeduino] debug: data: "ACK"
05:09:51.226 [pimatic-hap] debug: changing dimlevel of Lamp H$05:09:51.239 [pimatic-homeduino] debug: Sending Protocol: dim$05:09:51.257 [pimatic] info: rule pir-gang-uit: Lamp Hal uitg$

@michbeck100
Copy link
Owner

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

@rspaargaren
Copy link
Author

Now a better copy paste of the log I hope....
05:09:46.486 [pimatic-homeduino] debug: data: "ACK"
05:09:46.511 [pimatic-homeduino] debug: data: "PING"
05:09:46.525 [pimatic-homeduino] debug: data: "PING"
05:09:46.537 [pimatic-homeduino] debug: data: "PING"
05:09:46.550 [pimatic-homeduino] debug: data: "PING"
05:09:46.562 [pimatic-homeduino] debug: data: "PING"
05:09:46.574 [pimatic-homeduino] debug: data: "PING"
05:09:46.585 [pimatic-homeduino] debug: data: "PING"
05:09:46.597 [pimatic-homeduino] debug: data: "PING"
05:09:46.609 [pimatic-homeduino] debug: data: "PING"
05:09:46.621 [pimatic-homeduino] debug: data: "PING"
05:09:46.632 [pimatic-homeduino] debug: data: "PING"
05:09:46.643 [pimatic-homeduino] debug: data: "PING"
05:09:46.885 [pimatic-hap] debug: switching device Lamp Kast to true
05:09:46.934 [pimatic-homeduino] debug: Sending Protocol: switch1 id:43962 unit:9 all:false state:true Pin:4 Repeats:7
05:09:47.002 [pimatic-homeduino] debug: data: "ERR unknown_command"
05:09:47.151 [pimatic-hap] error: Could not call promise: unknown_command
05:09:47.182 [pimatic-hap] debug: Error: unknown_command
05:09:47.182 [pimatic-hap] debug:> at /home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/lib/board.js:294:19
05:09:47.182 [pimatic-hap] debug:> at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/bluebird/js/main/util.js:26:23)
05:09:47.182 [pimatic-hap] debug:> at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/bluebird/js/main/promise.js:503:31)
05:09:47.182 [pimatic-hap] debug:> at Promise._settlePromiseAt (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/bluebird/js/main/promise.js:577:18)
05:09:47.182 [pimatic-hap] debug:> at Promise._settlePromises (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/bluebird/js/main/promise.js:693:14)
05:09:47.182 [pimatic-hap] debug:> at Async._drainQueue (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/bluebird/js/main/async.js:123:16)
05:09:47.182 [pimatic-hap] debug:> at Async._drainQueues (/home/pi/pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/bluebird/js/main/async.js:133:10)
05:09:47.182 [pimatic-hap] debug:> at Immediate.Async.drainQueues as _onImmediate
05:09:47.182 [pimatic-hap] debug:> at processImmediate as _immediateCallback
05:09:47.769 [pimatic-homeduino] debug: data: "ACK"
05:09:47.822 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:09:47.856 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:09:47.943 [pimatic] info: rule zonsopgang: Lamp Hal gedimd naar 100%
05:09:48.066 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:09:48.457 [pimatic-homeduino] debug: data: "ACK"
05:09:48.499 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:09:48.518 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:09:48.541 [pimatic] info: rule pir-gang-uit: Lamp Hal uitgezet
05:09:48.661 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:09:49.136 [pimatic-homeduino] debug: data: "ACK"
05:09:49.181 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:09:49.195 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:09:49.214 [pimatic] info: rule zonsopgang: Lamp Hal gedimd naar 100%
05:09:49.333 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:09:49.821 [pimatic-homeduino] debug: data: "ACK"
05:09:49.863 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:09:49.878 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:09:49.897 [pimatic] info: rule pir-gang-uit: Lamp Hal uitgezet
05:09:50.013 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:09:50.500 [pimatic-homeduino] debug: data: "ACK"
05:09:50.541 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:09:50.555 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:09:50.573 [pimatic] info: rule zonsopgang: Lamp Hal gedimd naar 100%
05:09:50.687 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:09:51.185 [pimatic-homeduino] debug: data: "ACK"
05:09:51.226 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:09:51.239 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:09:51.257 [pimatic] info: rule pir-gang-uit: Lamp Hal uitgezet
05:09:51.367 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:09:51.816 [pimatic-homeduino] debug: data: "ACK"
05:09:51.861 [pimatic-hap] debug: switching device Lamp Televisie to true
05:09:51.883 [pimatic] info: rule lamp-aan: Lamp Televisie aangezet
05:09:51.901 [pimatic-homeduino] debug: Sending Protocol: switch1 id:1337110 unit:1 all:false state:true Pin:4 Repeats:7
05:09:52.443 [pimatic-homeduino] debug: data: "ACK"
05:09:52.483 [pimatic] info: rule bed-lamp-gijs: Lamp Gijs uitgezet
05:09:53.067 [pimatic-homeduino] debug: data: "ACK"
05:09:53.107 [pimatic] info: rule bed-lamp-bas: Lamp Bas uitgezet
05:09:53.691 [pimatic-homeduino] debug: data: "ACK"
05:09:53.730 [pimatic] info: rule bed-lamp-gijs: Lamp Gijs uitgezet
05:09:54.315 [pimatic-homeduino] debug: data: "ACK"
05:09:54.354 [pimatic] info: rule bed-lamp-bas: Lamp Bas uitgezet
05:09:54.939 [pimatic-homeduino] debug: data: "ACK"
05:09:55.512 [pimatic-homeduino] debug: Sending Protocol: switch1 id:4287711 unit:1 all:false state:true Pin:4 Repeats:7
05:09:55.564 [pimatic-homeduino] debug: data: "ACK"
05:09:55.606 [pimatic-hap] debug: value true equals current state of Lamp Tom. Not switching.
05:09:56.129 [pimatic-homeduino] debug: Sending Protocol: switch1 id:4287711 unit:0 all:false state:true Pin:4 Repeats:7
05:09:56.188 [pimatic-homeduino] debug: data: "ACK"
05:09:56.867 [pimatic-homeduino] debug: data: "ACK"
05:09:56.914 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:09:56.927 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:09:57.034 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:09:57.557 [pimatic-homeduino] debug: data: "ACK"
05:09:57.598 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:09:57.611 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:09:57.720 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:09:58.235 [pimatic-homeduino] debug: data: "ACK"
05:09:58.276 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:09:58.290 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:09:58.406 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:09:58.920 [pimatic-homeduino] debug: data: "ACK"
05:09:58.962 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:09:58.977 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:09:59.085 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:09:59.599 [pimatic-homeduino] debug: data: "ACK"
05:09:59.642 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:09:59.655 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:09:59.783 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:10:00.286 [pimatic-homeduino] debug: data: "ACK"
05:10:00.327 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:10:00.341 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:10:00.451 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:10:00.909 [pimatic-homeduino] debug: data: "ACK"
05:10:01.533 [pimatic-homeduino] debug: data: "ACK"
05:10:01.574 [pimatic-hap] debug: switching device Lamp Gijs to true
05:10:01.592 [pimatic] info: rule bed-lamp-gijs: Lamp Gijs aangezet
05:10:01.607 [pimatic-homeduino] debug: Sending Protocol: switch1 id:4287711 unit:1 all:false state:true Pin:4 Repeats:7
05:10:02.156 [pimatic-homeduino] debug: data: "ACK"
05:10:02.207 [pimatic-hap] debug: switching device Lamp Bas to true
05:10:02.224 [pimatic] info: rule bed-lamp-bas: Lamp Bas aangezet
05:10:02.241 [pimatic-homeduino] debug: Sending Protocol: switch1 id:4287711 unit:0 all:false state:true Pin:4 Repeats:7
05:10:02.841 [pimatic-homeduino] debug: data: "ACK"
05:10:02.883 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:10:02.897 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:10:03.005 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:10:03.526 [pimatic-homeduino] debug: data: "ACK"
05:10:03.567 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:10:03.581 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:10:03.687 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:10:04.204 [pimatic-homeduino] debug: data: "ACK"
05:10:04.245 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:10:04.258 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:10:04.362 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:10:04.889 [pimatic-homeduino] debug: data: "ACK"
05:10:04.932 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:10:04.945 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:10:05.053 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:10:05.569 [pimatic-homeduino] debug: data: "ACK"
05:10:05.612 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:10:05.625 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:10:05.735 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:10:06.255 [pimatic-homeduino] debug: data: "ACK"
05:10:06.297 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:10:06.311 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:10:06.421 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:10:06.879 [pimatic-homeduino] debug: data: "ACK"
05:10:07.503 [pimatic-homeduino] debug: data: "ACK"
05:10:08.187 [pimatic-homeduino] debug: data: "ACK"
05:10:08.233 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:10:08.247 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:10:08.369 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:10:08.876 [pimatic-homeduino] debug: data: "ACK"
05:10:08.918 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:10:08.932 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:10:09.040 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:10:09.553 [pimatic-homeduino] debug: data: "ACK"
05:10:09.595 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:10:09.608 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:10:09.714 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:10:10.239 [pimatic-homeduino] debug: data: "ACK"
05:10:10.278 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:10:10.291 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:10:10.394 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:10:10.915 [pimatic-homeduino] debug: data: "ACK"
05:10:10.957 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:10:10.970 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:10:11.078 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:10:11.601 [pimatic-homeduino] debug: data: "ACK"
05:10:11.643 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:10:11.656 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:10:11.765 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:10:12.278 [pimatic-homeduino] debug: data: "ACK"
05:10:12.321 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:10:12.334 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:10:12.445 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:10:12.965 [pimatic-homeduino] debug: data: "ACK"
05:10:13.013 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:10:13.027 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:10:13.142 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:10:13.651 [pimatic-homeduino] debug: data: "ACK"
05:10:13.696 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:10:13.710 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:10:13.827 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.
05:10:14.339 [pimatic-homeduino] debug: data: "ACK"
05:10:14.382 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 0
05:10:14.395 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false state:false dimlevel:0 Pin:4 Repeats:2
05:10:14.506 [pimatic-hap] debug: value false equals current state of Lamp Hal. Not switching.
05:10:15.018 [pimatic-homeduino] debug: data: "ACK"
05:10:15.061 [pimatic-hap] debug: changing dimlevel of Lamp Hal to 100
05:10:15.074 [pimatic-homeduino] debug: Sending Protocol: dimmer1 id:1337110 unit:2 all:false dimlevel:15 Pin:4 Repeats:2
05:10:15.185 [pimatic-hap] debug: value true equals current state of Lamp Hal. Not switching.

@michbeck100 michbeck100 reopened this Oct 4, 2016
@michbeck100
Copy link
Owner

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.

@rspaargaren
Copy link
Author

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

Op 5 okt. 2016 om 01:00 heeft Michael Kotten notifications@github.com het volgende geschreven:

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.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

@michbeck100
Copy link
Owner

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.

@rspaargaren
Copy link
Author

Ok here it is not very complex
devices": [
{
"id": "guest-wlan",
"name": "Guest WLAN",
"class": "FritzWlan",
"interval": 1800
},
{
"id": "RoomTemp",
"class": "OTGWMainThermostat",
"name": "Room Temp"
},
{
"id": "HeatingThermostat",
"class": "OTGWHeatingThermostat",
"name": "Heating Thermostat",
"comfyTemp": 20,
"ecoTemp": 19,
"guiShowModeControl": true,
"guiShowPresetControl": true,
"guiShowTemperatueInput": true
},
{
"id": "esp01",
"name": "Werk Kamer Temp.",
"class": "VariablesDevice",
"variables": [
{
"name": "Temperature",
"expression": "$ESI_TEMP",
"type": "number",
"unit": "°C"
}
]
},
{
"id": "Dimmertest2",
"name": "Dimmertest",
"class": "MySensorsDimmer",
"nodeid": 111,
"sensorid": 4
},
{
"id": "PIRtest2",
"name": "PIRtest",
"class": "MySensorsPIR",
"nodeid": 111,
"sensorid": 2,
"resetTime": 5000
},
{
"id": "Temptest2",
"name": "Temp_TEST",
"class": "MySensorsDST",
"nodeid": 111,
"batterySensor": true,
"sensorid": 1
},
{
"id": "Lighttest",
"name": "Light_test",
"class": "MySensorsLight",
"nodeid": 111,
"batterySensor": false,
"sensorid": 3
},
{
"id": "PIR",
"name": "PIR",
"class": "MySensorsPIR",
"nodeid": 1,
"sensorid": 1,
"resetTime": 8000
},
{
"id": "Muurschakelaar",
"name": "Schakelaar_muur",
"class": "MySensorsPIR",
"nodeid": 66,
"sensorid": 1,
"resetTime": 1000
},
{
"id": "PIRTEST",
"name": "PIR_Plafond",
"class": "MySensorsPIR",
"nodeid": 100,
"sensorid": 2,
"resetTime": 8000
},
{
"id": "Temp1",
"name": "Temp_Plafond",
"class": "MySensorsDST",
"nodeid": 100,
"batterySensor": true,
"sensorid": 1
},
{
"id": "Light",
"name": "Light_Plafond",
"class": "MySensorsLight",
"nodeid": 100,
"batterySensor": true,
"sensorid": 3,
"xAttributeOptions": []
},
{
"id": "KAKU_BANK",
"name": "Lamp Bank",
"class": "HomeduinoRFDimmer",
"protocols": [
{
"name": "dimmer1",
"options": {
"id": 1337110,
"unit": 0
},
"send": true,
"receive": true,
"rfrepeats": 1
}
]
},
{
"id": "KAKU_HAL",
"name": "Lamp Hal",
"class": "HomeduinoRFDimmer",
"protocols": [
{
"name": "dimmer1",
"options": {
"id": 1337110,
"unit": 2
},
"send": true,
"receive": true,
"rfrepeats": 2
}
]
},
{
"id": "ALARM_SW",
"name": "ALARM AAN/UIT",
"class": "HomeduinoRFSwitch",
"hap": {
"exclude": true
},
"protocols": [
{
"name": "switch1",
"options": {
"id": 1337110,
"unit": 4
}
}
]
},
{
"id": "KAKU_HAL_SW",
"name": "Lamp Hal AAN/UIT",
"class": "HomeduinoRFSwitch",
"hap": {
"service": "Lightbulb",
"exclude": true
},
"protocols": [
{
"name": "switch1",
"options": {
"id": 1337110,
"unit": 2
}
}
]
},
{
"id": "KAKU_TEL",
"name": "Lamp Televisie",
"class": "HomeduinoRFSwitch",
"hap": {
"service": "Lightbulb"
},
"protocols": [
{
"name": "switch1",
"options": {
"id": 1337110,
"unit": 1
}
}
]
},
{
"id": "KAKU_KAST",
"name": "Lamp Kast",
"class": "HomeduinoRFSwitch",
"hap": {
"service": "Lightbulb"
},
"protocols": [
{
"name": "switch1",
"options": {
"id": 43962,
"unit": 9
}
}
]
},
{
"id": "KAKU_KAST_DEUR",
"name": "Kast Deur",
"class": "HomeduinoRFContactSensor",
"protocols": [
{
"name": "contact1",
"options": {
"unit": 9,
"id": 43962
}
}
]
},
{
"id": "KAKU_BAS",
"name": "Lamp Bas",
"class": "HomeduinoRFSwitch",
"hap": {
"service": "Lightbulb"
},
"protocols": [
{
"name": "switch1",
"options": {
"id": 4287711,
"unit": 0
}
}
]
},
{
"id": "KAKU_GIJS",
"name": "Lamp Gijs",
"class": "HomeduinoRFSwitch",
"hap": {
"service": "Lightbulb"
},
"protocols": [
{
"name": "switch1",
"options": {
"id": 4287711,
"unit": 1
}
}
]
},
{
"id": "KAKU_TOM",
"name": "Lamp Tom",
"class": "HomeduinoRFSwitch",
"hap": {
"service": "Lightbulb"
},
"protocols": [
{
"name": "switch1",
"options": {
"id": 4287711,
"unit": 2
}
},
{
"name": "switch1",
"options": {
"id": 1398338,
"unit": 2
}
}
]
},
{
"id": "IphoneFemke",
"name": "Iphone van Femke",
"class": "PingPresence",
"host": "192.168.178.50",
"interval": 5000
},
{
"id": "IphoneRichard",
"name": "Iphone van Richard",
"class": "PingPresence",
"host": "192.168.178.55",
"interval": 5000
},
{
"id": "homeduino-pir",
"name": "PIR Gang",
"class": "HomeduinoRFPir",
"protocols": [
{
"name": "pir1",
"options": {
"unit": 10,
"id": 10
}
}
],
"resetTime": 30000
},
{
"class": "SystemSensor",
"id": "syssensor",
"name": "System",
"attributes": [
{
"name": "cpu"
},
{
"name": "memory"
}
]
},
{
"id": "HET_WEER",
"class": "OpenWeatherDevice",
"name": "Weer Aalsmeer",
"location": "Amsterdam, Netherlands",
"lang": "nl",
"units": "metric",
"timeout": 300000
},
{
"id": "VOORSPELLING",
"class": "OpenWeatherForecastDevice",
"name": "Voorspelling voor 1 dag in Aalsmeer",
"location": "Amsterdam, Netherlands",
"lang": "nl",
"units": "metric",
"timeout": 300000,
"day": 1
},
{
"id": "kodi-player",
"name": "Kodi",
"class": "KodiPlayer",
"host": "192.168.178.24",
"port": 9090
}
],
"rules": [
{
"id": "test-pint-iphone",
"name": "test pint iphone",
"rule": "when every 2 minutes then execute "sudo hping3 -2 -c 3 -p 5353 192.168.178.55 >/dev/null 2>&1 || true" and execute "sudo hping3 -2 -c 3 -p 5353 192.168.178.50 >/dev/null 2>&1 || true"",
"active": false,
"logging": false
},
{
"id": "voorraad_uitschakelen",
"name": "Beveiliging voorraadkast",
"rule": "when Kast Deur is opened for 2 minutes then turn off Lamp Kast",
"active": true,
"logging": true
},
{
"id": "lampje-kamer-tom",
"name": "Lampje Kamer Tom",
"rule": "when it is 7:00 am then turn Lamp Tom off",
"active": true,
"logging": true
},
{
"id": "bed-lamp-bas",
"name": "Bed Lamp Bas",
"rule": "when it is 8:00 pm then turn Lamp Bas off for 3 seconds and turn Lamp Bas off after 5 minutes",
"active": true,
"logging": true
},
{
"id": "bed-lamp-gijs",
"name": "Bed Lamp Gijs",
"rule": "when it is 8:00 pm then turn Lamp Gijs off for 3 seconds and turn KAKU_GIJS off after 5 minutes",
"active": true,
"logging": true
},
{
"id": "pir-gang-uit",
"name": "PIR_GANG_UIT",
"rule": "when PIR Gang is absent then turn off Lamp Hal",
"active": true,
"logging": true
},
{
"id": "zonsopgang",
"name": "dim hal aan",
"rule": "when PIR Gang signals present then dim the Lamp Hal to $DIM_LEVEL_HAL",
"active": true,
"logging": true
},
{
"id": "zet-dim-level-hal-dag",
"name": "Zet dim level hal dag",
"rule": "when sunrise then set $DIM_LEVEL_HAL to 100",
"active": true,
"logging": true
},
{
"id": "dim-level-hal-nacht",
"name": "dim level hal nacht",
"rule": "when sunset then set $DIM_LEVEL_HAL to 40 ",
"active": true,
"logging": true
},
{
"id": "lampen-aan-in-de-ochtend",
"name": "lampen aan in de ochtend",
"rule": "when $Beneden = 1 and it is after 6:45 am and it is before 10:00 am and PIR Gang reports present then set $Beneden = 0 and turn on Lamp Televisie",
"active": true,
"logging": true
},
{
"id": "reset-beneden",
"name": "reset beneden",
"rule": "when it is after 11am then $Beneden = 1",
"active": true,
"logging": true
},
{
"id": "push-pir-alarm",
"name": "PUSH_PIR_ALARM",
"rule": "when state of ALARM AAN/UIT is on and PIR Gang is present then push title:"PIR Beneden ALARM" message:"PIR Beneden geactiveerd!"",
"active": true,
"logging": true
},
{
"id": "richard-thuis",
"name": "RICHARD THUIS",
"rule": "when Iphone van Richard is absent for 10 minutes then set $RICHARD_THUIS = "0" and pushbullet title:"Ben je weg?" message:"Doei!"",
"active": false,
"logging": true
},
{
"id": "richard-weg",
"name": "RICHARD WEG",
"rule": "when Iphone van Richard is present and $RICHARD_THUIS = 0 then set $RICHARD_THUIS = 1 and push title:"Ben je er weer?" message:"Welkom thuis!"",
"active": false,
"logging": true
},
{
"id": "lamp-aan",
"name": "lamp aan",
"rule": "when it is sunset then turn on Lamp Televisie for 5 hours",
"active": true,
"logging": true
},
{
"id": "muurschakelaar",
"name": "Muurschakelaar",
"rule": "when Muurschakelaar is present then toggle KAKU_TEL ",
"active": true,
"logging": true
},
{
"id": "muur-lamp-bank",
"name": "Muur_lamp_bank",
"rule": "when Muurschakelaar is present and KAKU_BANK is turned on then turn off KAKU_BANK",
"active": true,
"logging": true
},
{
"id": "alarm",
"name": "alarm",
"rule": "when ALARM_SW is turned on then turn off Lamp Bank",
"active": true,
"logging": true
}
],

@rikki78
Copy link

rikki78 commented Oct 6, 2016

I've experienced the same issue as mentioned here.
After commenting out some code this doesn't occur anymore.

This is what it look like now:
class DimmerAccessory extends SwitchAccessory

_dimlevel: null

constructor: (device) ->
  super(device)
  @_dimlevel = device._dimlevel

  @getService(Service.Lightbulb)
    .getCharacteristic(Characteristic.Brightness)
    .on 'get', (callback) =>
      @handleReturnPromise(device.getDimlevel(), callback, null)

  device.on 'dimlevel', (dimlevel) =>
    @getService(Service.Lightbulb)
      .setCharacteristic(Characteristic.Brightness, dimlevel)

  @getService(Service.Lightbulb)
    .getCharacteristic(Characteristic.Brightness)
    .on 'set', (value, callback) =>
      if device._dimlevel == value
        callback()
        return
      @handleVoidPromise(device.changeDimlevelTo(value), callback)

   # .getCharacteristic(Characteristic.Brightness)
   # .on 'set', (value, callback) =>
   #   if @_dimlevel is value
   #     env.logger.info 'value ' + value +
   #       ' equals current dimlevel of ' + device.name  + '. Not changing.'
   #     callback()
   #     return  
   #   env.logger.info ' changing dimlevel of ' + device.name + ' to ' + value + ' from ' + @_dimlevel
   #   @_dimlevel = value
   #   @_state = value > 0
      #@handleVoidPromise(device.changeDimlevelTo(value), callback)
   #   @handleVoidPromise(promise, callback)

getDefaultService: =>
  return Service.Lightbulb

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.

@michbeck100
Copy link
Owner

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.

@rikki78
Copy link

rikki78 commented Oct 26, 2016

How can I test this change? Is it in a new version or should I clone the
GitHub version?
Op za 8 okt. 2016 om 22:13 schreef Michael Kotten notifications@github.com

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.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#39 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKqfY98SVgxyZ_PML-f4mpD_RQtR9q3Cks5qx_lPgaJpZM4J6BoD
.

@michbeck100
Copy link
Owner

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.

@rspaargaren
Copy link
Author

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!

@rikki78
Copy link

rikki78 commented Nov 6, 2016

Thanks this update solved the problems I had before!
Great work!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants