upsert / lutron-caseta-pro

Custom Home Assistant Component for Lutron Caseta Smart Bridge PRO / RA2 Select
Apache License 2.0
184 stars 38 forks source link

Occasional wrong states on pico button press #31

Open cgarwood opened 5 years ago

cgarwood commented 5 years ago

Not sure how to best troubleshoot this.

Seemingly randomly some of my pico remotes will stop working correctly. These remotes aren't paired to an actual caseta dimmer, just to the hub, and I use an automation to make them control non-caseta lights.

I put some logging on it and found out that when this happens, the numeric state on the sensor entity is wrong. Everything is +8 - so when no buttons are pressed, the state is 8 instead of 0, on is 9 instead of 1, favorite is 10 instead of 2, up is 16 instead of 8, etc.

Usually a restart of Home Assistant will fix the issue, or sometimes it will fix itself after a couple hours.

Mdleal commented 5 years ago

That is why my pico only works half the time. I am seeing the same thing.

cgarwood commented 5 years ago

Just had it happen again this evening, but this time everything is +4 instead of +8, which is different from all the other times this has happened in the past that I'm aware of. Only 1 pico though, the others all seem to be working fine.

cwawak commented 5 years ago

Two picos of mine stop responding, then seemingly “wake up” again. I wonder if I’m hitting this.

On the bright side I can reliably reproduce the picos stopping responding, so if there’s debugging to happen let me know.

cwawak commented 5 years ago

I can confirm that the state gets confused. It looks like it fails to return to 0 and ends up adding the sensor values.

upsert commented 5 years ago

I have attempted to simplify the state updates again for the sensor. Releasing the button will always set the state back to zero and the states are no longer combined on update.

This may not fix the problem if the component never receives the message for the button release, but it will at least simplify the logic.

cwawak commented 5 years ago

I've chatted on and off with Lutron support/engineering. They seem somewhat interested in helping, but I'm not sure exactly how to go about this. Is ther anything holding me back from trying to loop them in on the bug?