apwelsh / hubitat

MIT License
26 stars 12 forks source link

Add support for Friends of Hue Switches and workaround for held button API issues. #20

Closed pocketgeek closed 2 years ago

pocketgeek commented 2 years ago

Well this turned out to be a rabbit hole...

The API for Friends of Hue switches is either broke or was limited on purpose.

For whatever reason the API for 'Friends of HUE' Switches changed somewhere around December 2021. Home Assistent issue on it: https://github.com/home-assistant/core/issues/61671 Now the only messages that are sent for these are initial_press and short_release. And better yet, you always get two 'short_release' messages. One about 1 second after the 'initial_press' message, even if you are still holding the button, and one after you actually let go of the button. This made it necessary to just ignore the first 'short_release' message after the 'initial_press' message. In my testing the initial short_release message usually comes about 1 second later, necessitating the hold timer being 2 seconds.

apwelsh commented 2 years ago

Updated the HubitatPackageManager json file, and added you as the author. Credit cited where credit is due. :) Thanks.