rnilssoncx / homebridge-pico

Expose Lutron Pico Remotes in Homebridge: https://github.com/nfarina/homebridge
MIT License
63 stars 6 forks source link

Incorrect Mapping for PJ2-4B-WH-L01P #35

Closed yungsters closed 2 years ago

yungsters commented 2 years ago

I recently purchased a PJ2-4B-WH-L01P which has "On", "Up", "Down", and "Off".

According to the README.md as well as types['PJ2-4B-XXX-L01'], this should map to button IDs 2 (On), 5 (Up), 6 (Down), then 4 (Off).

However, when I configured the Pico remote to use PJ2-4B-XXX-L01, pressing any button on the Pico remote would cause Homebridge to crash on accessory.js:103 because this.buttons[button] would be undefined.

I upgraded to 1.1.1-beta.0 to sidestep this crash and to get the more recently added error logging at accessory:123. When I tried pressing all four buttons with this version, the logs indicate the button IDs to be 8 (~On~ Scene 1), 9 (~Up~ Scene 2), 10 (~Down~ Scene 3), then 11 (~Off~ Scene Off).

I downgraded to 1.0.2 and reconfigured my Pico remote to use PJ2-4B-XXX-L31, and the remote now works almost as expected.

Is the mapping for PJ2-4B-WH-L01P wrong? Or is it a known problem for some Pico remotes to behave differently? (I have confirmed that in the Lutron app on iOS, the Pico remote's controls are displayed as "On", "Up", "Down", and "Off".)

In any case, my specific usage is not blocked. I am primarily sharing this in the hopes that someone else does not have to debug the same issue that I ran into. Thanks so much for maintaining this project!

rnilssoncx commented 2 years ago

Interesting. It's very possible the switch is incorrectly defined - the definitions were from a good samaritan, but I was unable to correct. I'm hesitant to change the definition as there could be valid use cases for it out there.

It sounds like Lutron took the Scene remote and just change the labels... I really didn't anticipate they'd do this soft of reuse, so there's nothing I can do about the incorrect button naming. I'll add this to the backlog and see about added alternate button names for the remote.

Thanks for the feedback!