-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add vendor characteristics for Home Accessory Architect #48
Conversation
I'd like to see the homekit_controller changes too please. A link to a branch is fine. |
Cheers. I'm new to HAA so could you explain how this works? Is there a description of how the HAA app works? How does this get exposed by the homekit bridge? Also any tips on navigating the code? I can see |
Also |
And if ultimately the plan is to expose this from iOS, can we do this without creating entities in HASS? Or is there value in them existing as entities in HASS? |
Here's where the custom trigger is defined: https://github.com/RavenSystem/esp-homekit-devices/blob/44da5bd3e3aa30b369a03add6822e5c602c46cbf/devices/HAA/header.h#L590 When the "Setup" or "Update" characteristic value gets set to that trigger, the device will go into setup mode (accessible at the device IP address on port 4567) or initiate an over the air update. This is the code that enabled the "Setup" and "Update" switches to work in the HAA app: RavenSystem/esp-homekit-devices@HAA_5.0.10...HAA_5.0.11 The HAA app exposes the "Setup" and "Update" switches under a "HAA Setup" section. For me, having the "Setup" and "Update" switches exposed in HASS is more useful than having it exposed in iOS. I'm planning on creating an automation to bulk update all my HAA devices within HASS. I'll probably exclude them from being imported into iOS. |
Lovely - the compare diff is super useful. For some reason code search isn't finding everything. Probably want to implement this as a button rather than a switch. And probably want to add support for the new conf/diag types. But we can worry about that for the HA review. I am AFK but will merge when I'm back at desk. Might be tomorrow now. |
awesome, sounds good! |
Codecov Report
@@ Coverage Diff @@
## main #48 +/- ##
=======================================
Coverage 85.52% 85.53%
=======================================
Files 47 47
Lines 3371 3373 +2
=======================================
+ Hits 2883 2885 +2
Misses 488 488
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Release with this PR pushed to pypi. |
Can you point me to some example code to implement this as a button instead of a switch? Also, not sure how to do the new conf/diag types; could you also point me to some examples there as well? |
Sure thing! So first of all, both of these things are new to homekit_controller so I can't point you to examples there, but looking at the work you did on the figuring out how i'd have added SimpleSwitch I think you'll have no problems at all adding them. The conf/diag types are "entity categories". The docs say:
Crucially they won't show up on auto generated dashboards, but are visible on the device page in settings, and you can still use them in automations. |
As for button:
It's not implemented in homekit_controller either so you'll need to add a new platform. Thats honestly not much more work than what you already did for simpleswitch. The newest platform i added to homekit_controller was number. So this is probably a good PR to look at:
|
I also wanted to call out how this
I think we could do something similar to avoid the special casing your current SimpleSwitch has. E.g.
And the default write value would probably be the number |
Thanks for all the comments. I'll give it a shot and let you know when I have something for you to look at! |
@Jc2k everything seems to be working now. I implemented the HAA Update and Setup characteristics as config category buttons instead of switches. I'm not sure how to write the button test though... could you take a look here? https://github.com/home-assistant/core/compare/dev...jaredhobbs:add-haa-vendor-extensions?expand=1#diff-891b30bebf509570e7a8cf0d874113a98c2fface798ca0e7bc2721481ab62828R45 |
The test looks pretty darn close to me, nothing screams out as a obvious cause for the failure. I'll have a proper look when I'm at my desk tomorrow! |
fixed the test. I had the wrong entity. anyway, here's the pr for the HASS changes: home-assistant/core#59750 |
I have changes to homekit_controller too but it requires these changes... Should I wait until these changes are released on Pypi so I can update the required version in homekit_controller before opening a PR over there?
This change exposes the Update and Setup custom characteristics from Home Accessory Architect.
Addresses RavenSystem/esp-homekit-devices#1441