Closed jpasqua closed 3 years ago
The problem in your code is that you're misinterpreting the value you pass to PROGRAMMABLE SWITCH EVENT characteristic when you define it. Looks like you're just assigning them sequentially like it is a button ID, while in reality it is a event state and should have values 0, 1 or 2. That's why when you add fourth one (with value 3), iOS considers whole accessory configuration to be invalid and refuses to pair. Change all values to zeros and it should work. For details on meaning of particular state values please check HAP specification.
PERFECT! Thank you for the help.
[Update: Worked well]
I've been working on a dynamic version of the button example to have multiple buttons on a single device (Wemos D1 Mini). I was having some difficulty so I decided to remove as much complexity as possible and make it statically configured. It works fine with one button, two buttons, and three buttons, but when I add a fourth I get an error from the Home app: "Unable to Add Accessory. Accessory is out of compliance." See screenshot. I've also included the log output below.
It doesn't seem likely to me that there is a hard limit of 3, but it does seem very likely that I'm missing something obvious.
My stripped down code is available here
Any hints are appreciated.