Skip to content
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

[homekit] add support for complex accessories #12346

Merged
merged 6 commits into from
Mar 27, 2022

Conversation

yfre
Copy link
Contributor

@yfre yfre commented Feb 22, 2022

HomeKit accessory can be combination of multiple accessories, e.g. fan with light, sensor with battery, irrigation with multiple valves
iOS home app would show such complex accessory as one tile on the home screen that opens a view with multiple controls.

this PR adds support for such complex accessories.

in openHAB complex accessory would be modelled by adding additional HomeKit tag to the group metadata, e.g.

Group           FanWithLight        "Fan with Light"                           {homekit = "Fan,Light"}
Switch          FanActiveStatus     "Fan Active Status"     (FanWithLight)     {homekit = "Fan.ActiveStatus"}
Number          FanRotationSpeed    "Fan Rotation Speed"    (FanWithLight)     {homekit = "Fan.RotationSpeed"}
Switch          Light               "Light"                 (FanWithLight)     {homekit = "Lighting.OnState"}

it is backward compatible. all existing HomeKit configurations have only one tag at group level and should work as before.

Eugen Freiter added 5 commits February 22, 2022 11:41
Signed-off-by: Eugen Freiter <freiter@gmx.de>
Signed-off-by: Eugen Freiter <freiter@gmx.de>
wip
Signed-off-by: Eugen Freiter <freiter@gmx.de>
Signed-off-by: Eugen Freiter <freiter@gmx.de>
Signed-off-by: Eugen Freiter <freiter@gmx.de>
@yfre yfre requested a review from andylintner as a code owner February 22, 2022 11:18
@yfre yfre added the enhancement An enhancement or new feature for an existing add-on label Feb 22, 2022
@yfre yfre requested a review from lolodomo March 5, 2022 15:44
@yfre
Copy link
Contributor Author

yfre commented Mar 14, 2022

@andylintner @lolodomo
could please review this PR.
the UI part for this got merged already openhab/openhab-webui#1317

im afraid, UI configurations that are not supported by the binding could confuse users.

Copy link

@andylintner andylintner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only few typo

Signed-off-by: Eugen Freiter <freiter@gmx.de>
@yfre
Copy link
Contributor Author

yfre commented Mar 27, 2022

Only few typo

thank you lolodomo for the review.

@lolodomo lolodomo merged commit f1176a0 into openhab:main Mar 27, 2022
@lolodomo lolodomo added this to the 3.3 milestone Mar 27, 2022
@JacekKac
Copy link
Contributor

Hi @yfre can you post an example of Valve grouping which are already in a group ?


Group                   gLawn1          "Zraszacz 1"                                            {homekit = "Valve" [homekitValveType="Irrigation", homekitTimer="true"]}
Switch                  Lawn1           "Valve active"                          (gLawn1)        {homekit = "Valve.ActiveStatus, Valve.InUseStatus"}
Number                  Lawn1_duration  "Valve duration"                        (gLawn1)        {homekit = "Valve.Duration" [homekitDefaultDuration = 300]}

Group                   gLawn2          "Zraszacz 2"                                            {homekit = "Valve" [homekitValveType="Irrigation", homekitTimer="true"]}
Switch                  Lawn2           "Valve active"                          (gLawn2)        {homekit = "Valve.ActiveStatus, Valve.InUseStatus"}
Number                  Lawn2_duration  "Valve duration"                        (gLawn2)        {homekit = "Valve.Duration" [homekitDefaultDuration = 300]}


@yfre
Copy link
Contributor Author

yfre commented Apr 17, 2022

Hi @yfre can you post an example of Valve grouping which are already in a group ?


Group                   gLawn1          "Zraszacz 1"                                            {homekit = "Valve" [homekitValveType="Irrigation", homekitTimer="true"]}
Switch                  Lawn1           "Valve active"                          (gLawn1)        {homekit = "Valve.ActiveStatus, Valve.InUseStatus"}
Number                  Lawn1_duration  "Valve duration"                        (gLawn1)        {homekit = "Valve.Duration" [homekitDefaultDuration = 300]}

Group                   gLawn2          "Zraszacz 2"                                            {homekit = "Valve" [homekitValveType="Irrigation", homekitTimer="true"]}
Switch                  Lawn2           "Valve active"                          (gLawn2)        {homekit = "Valve.ActiveStatus, Valve.InUseStatus"}
Number                  Lawn2_duration  "Valve duration"                        (gLawn2)        {homekit = "Valve.Duration" [homekitDefaultDuration = 300]}

so, if you want to get something like this then this is currently not possible. this requires one more accessory type called "IrrigationSystem" which is not supported by homekit binding yet. i have it on my todo list.

image

@JacekKac
Copy link
Contributor

thank you,
i think ( i have only photo of such configuration left) it was build on homebridge without irrigation item support (no settings button at the bottom). Let's try on other items - is it possible to configure 2 homekit = "Lightning" items Lamp 1 and Lamp 2 under one grouped accessories GUI allows to Select Multiple accessories (many types ) but only one type occuring once). If i put "homekit="Lighting, Lighting" in text config GUI addoptes and allows to define 2 separate Lighting groups but it's not working in Home app

@yfre
Copy link
Contributor Author

yfre commented Apr 19, 2022

thank you, i think ( i have only photo of such configuration left) it was build on homebridge without irrigation item support (no settings button at the bottom). Let's try on other items - is it possible to configure 2 homekit = "Lightning" items Lamp 1 and Lamp 2 under one grouped accessories GUI allows to Select Multiple accessories (many types ) but only one type occuring once). If i put "homekit="Lighting, Lighting" in text config GUI addoptes and allows to define 2 separate Lighting groups but it's not working in Home app

multiple accessories of the same type is currently not supported. here we would need to have support group of groups as discussed here

https://community.openhab.org/t/does-openhab-support-grouping-homekit-accessories-in-different-types/132367/4?u=yfre

something like this

group combinedLights {homekit="Lighting, Lighting"}

group light1 (combinedLights) {homekit="Lighting"}
switch light1_switch (light1)

group light2  (combinedLights) {homekit="Lighting"}
switch light2_switch (light2)

it still looks complex to me but i dont have any better ideas for complex items of the same type

NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Apr 27, 2022
* Add complex accessories

Signed-off-by: Eugen Freiter <freiter@gmx.de>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
* Add complex accessories

Signed-off-by: Eugen Freiter <freiter@gmx.de>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
* Add complex accessories

Signed-off-by: Eugen Freiter <freiter@gmx.de>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
@yfre yfre deleted the complex_accessories branch November 15, 2022 21:51
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
* Add complex accessories

Signed-off-by: Eugen Freiter <freiter@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants