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

[hdpowerview] Add support for scene groups #11534

Merged
merged 16 commits into from
Nov 15, 2021

Conversation

jlaur
Copy link
Contributor

@jlaur jlaur commented Nov 6, 2021

Fixes #11533

Signed-off-by: Jacob Laursen [email protected]

The Hunter Douglas PowerView Hub supports two different scene concepts:

  • Scenes
  • Scene Collections

A scene collection is a collection of scenes and can be used to group multiple scenes and activate them all with a single click or automation. When this feature was available in the Hunter Douglas PowerView app they were called scene groups. This terminology it kept in user-oriented strings, while API name is scene collections.

This PR adds support for activation of scene groups. Scene groups will appear as channels the same way as scenes, like this:
image

@andrewfg
Copy link
Contributor

andrewfg commented Nov 8, 2021

I will have a look at this in the next couple of days.

@andrewfg
Copy link
Contributor

andrewfg commented Nov 9, 2021

@jlaur I looked at your code, and FWIW it seems excellent to me; however ..

  • I don't use scene collections in my physical system so I could not test it in real life
  • I am not an official code reviewer so I cannot formally approve your code either

@jlaur
Copy link
Contributor Author

jlaur commented Nov 9, 2021

@jlaur I looked at your code, and FWIW it seems excellent to me; however ..

  • I don't use scene collections in my physical system so I could not test it in real life
  • I am not an official code reviewer so I cannot formally approve your code either

@andrewfg - thanks for having a look, any additional eyes and feedback is much appreciated no matter who has the stamp. :-) I actually only have a single scene collection as I can't figure out how to create new collections using the PowerView app. It seems that either it's not supported anymore (although I can see and edit the one I already have), or there is a limition of one collection (which would seems strange). Maybe I'll try to create one more using the API directly to at least verify the "limit of one" theory.

@andrewfg
Copy link
Contributor

andrewfg commented Nov 9, 2021

I will do some tests on my hub to try and create such a scene collection.

@andrewfg
Copy link
Contributor

Hmm. I just tried the PowerView app on my Android phone (app version dated October 25, 2021). Since I did not have any Scene Collections before, there was nothing that I could edit. And it seems not possible to create a new one now (the app only has tabs for Rooms, Scenes, and Automations). However I will also try on the iPad app, in case it may be different.

@andrewfg
Copy link
Contributor

^
The PowerView iPad app latest version (from yesterday) also does not have a tab for creating scene collections.

@jlaur
Copy link
Contributor Author

jlaur commented Nov 10, 2021

@andrewfg

The PowerView iPad app latest version (from yesterday) also does not have a tab for creating scene collections.

It was the same activity as scenes, but with a context menu for adding "Scene Groups", as they are called in the app. I can still see and activate my scene group using latest version of the app:
image

It could be a bug or a decision to remove the feature. I'll try to reach out to them.

Nevertheless, I think it's still worth having this feature, and it works with the scene group/collection I and other users might already have. Also it provides a kind of backwards compatibility that could be useful for fully supporting #11516 when users are still having some scene collections. Otherwise they would need to be filtered, so IMHO better to have direct support.

I tried to fire up Postman to try to create a new collection manually, but haven't quite figured out how yet.

GET /api/sceneCollections/27119/

{
    "sceneCollection": {
        "name": "QsO4cm4gb3A=",
        "colorId": 12,
        "iconId": 17,
        "id": 27119,
        "order": 0,
        "hkAssist": false
    }
}

As you can see, this entry doesn't mention the scenesIds it actually contains. So this must be somewhere else - and would be needed for creating a meaningful new collection.

@andrewfg
Copy link
Contributor

^
In my case I have no Scene Collection ... and so ( therefore??) there is no context menu either.

@jlaur
Copy link
Contributor Author

jlaur commented Nov 10, 2021

In my case I have no Scene Collection ... and so ( therefore??) there is no context menu either.

No, I don't have it either - anymore. But used to have it.

@lolodomo
Copy link
Contributor

Conflict has to be fixed.

@jlaur jlaur force-pushed the 11533-hdpowerview-scene-collections branch from cff3f3c to 3b27e46 Compare November 12, 2021 11:49
@jlaur
Copy link
Contributor Author

jlaur commented Nov 12, 2021

@lolodomo - done, ready again.

Renamed for all user-oriented texts/references to be consistent with now abandoned feature of the PowerView app.

Signed-off-by: Jacob Laursen <[email protected]>
@jlaur jlaur changed the title [hdpowerview] Add support for scene collections [hdpowerview] Add support for scene groups Nov 12, 2021
@jlaur jlaur marked this pull request as draft November 12, 2021 15:19
@jlaur jlaur marked this pull request as ready for review November 12, 2021 16:05
@jlaur
Copy link
Contributor Author

jlaur commented Nov 12, 2021

@lolodomo - if you are still actively managing pull requests today perhaps you could have a look at this? We lack original maintainer, but @andrewfg has reviewed as another HD PowerView binding contributor.

Copy link
Contributor

@andrewfg andrewfg left a comment

Choose a reason for hiding this comment

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

LGTM

@lolodomo
Copy link
Contributor

I have two comments, I will push them this evening.

@jlaur jlaur requested a review from lolodomo November 15, 2021 22:04
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.

LGTM

@lolodomo lolodomo merged commit 8c83c27 into openhab:main Nov 15, 2021
@lolodomo lolodomo added this to the 3.2 milestone Nov 15, 2021
@lolodomo lolodomo added the enhancement An enhancement or new feature for an existing add-on label Nov 15, 2021
@andrewfg
Copy link
Contributor

@jlaur albeit rather late, but I think that the official name for 'Scene Collection' in the HD documentaion is/was 'Multiple Room Scene' -- see below..

image

@jlaur
Copy link
Contributor Author

jlaur commented Nov 16, 2021

@andrewfg - do you have a link for that documentation? In the API they are called scene collections, while they are called scene groups in the app. I decided to be consistent with the app as this is probably the only reference for users, i.e. users have most likely created the scene group within the app and now wants to trigger it from openHAB.

I think what you are referring to is multiple room scenes, i.e. scenes including multiple rooms. They are still supported by the app, and it's just a specific kind of scene involving more than one room, so not to be mistaken with scene group. Maybe this feature was added later, thus more or less obsoleted scene groups. Scene groups are still kind of nice IMHO since they can reduce redundancy by having to create scenes for multiple combinations.

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/hd-powerview-binding-connection-error/130552/2

NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Dec 30, 2021
* Add support for scene collections.

Fixes openhab#11533

Signed-off-by: Jacob Laursen <[email protected]>

* Add unit test for parsing of scene collections response.

Signed-off-by: Jacob Laursen <[email protected]>

* Add default i18n properties file.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Update documentation with scene collections.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix formatting.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Split offline tests into separate distinct tests.

Signed-off-by: Jacob Laursen <[email protected]>

* Increase test coverage for scene/scene collection parsing.

Signed-off-by: Jacob Laursen <[email protected]>

* Internationalization of dynamic scene/scene collection channels.

Signed-off-by: Jacob Laursen <[email protected]>

* Rename scene collections to scene groups.

Renamed for all user-oriented texts/references to be consistent with now abandoned feature of the PowerView app.

Signed-off-by: Jacob Laursen <[email protected]>

* Change custom text keys to not collide with framework.

Signed-off-by: Jacob Laursen <[email protected]>

* Avoid multiple thing updates.

Signed-off-by: Jacob Laursen <[email protected]>

* Add missing label/description texts for secondary channel.

Signed-off-by: Jacob Laursen <[email protected]>

* Remove unneeded @nullable annotations.

Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Nick Waterton <[email protected]>
mischmidt83 pushed a commit to mischmidt83/openhab-addons that referenced this pull request Jan 9, 2022
* Add support for scene collections.

Fixes openhab#11533

Signed-off-by: Jacob Laursen <[email protected]>

* Add unit test for parsing of scene collections response.

Signed-off-by: Jacob Laursen <[email protected]>

* Add default i18n properties file.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Update documentation with scene collections.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix formatting.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Split offline tests into separate distinct tests.

Signed-off-by: Jacob Laursen <[email protected]>

* Increase test coverage for scene/scene collection parsing.

Signed-off-by: Jacob Laursen <[email protected]>

* Internationalization of dynamic scene/scene collection channels.

Signed-off-by: Jacob Laursen <[email protected]>

* Rename scene collections to scene groups.

Renamed for all user-oriented texts/references to be consistent with now abandoned feature of the PowerView app.

Signed-off-by: Jacob Laursen <[email protected]>

* Change custom text keys to not collide with framework.

Signed-off-by: Jacob Laursen <[email protected]>

* Avoid multiple thing updates.

Signed-off-by: Jacob Laursen <[email protected]>

* Add missing label/description texts for secondary channel.

Signed-off-by: Jacob Laursen <[email protected]>

* Remove unneeded @nullable annotations.

Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Michael Schmidt <[email protected]>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Jan 28, 2022
* Add support for scene collections.

Fixes openhab#11533

Signed-off-by: Jacob Laursen <[email protected]>

* Add unit test for parsing of scene collections response.

Signed-off-by: Jacob Laursen <[email protected]>

* Add default i18n properties file.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Update documentation with scene collections.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix formatting.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Split offline tests into separate distinct tests.

Signed-off-by: Jacob Laursen <[email protected]>

* Increase test coverage for scene/scene collection parsing.

Signed-off-by: Jacob Laursen <[email protected]>

* Internationalization of dynamic scene/scene collection channels.

Signed-off-by: Jacob Laursen <[email protected]>

* Rename scene collections to scene groups.

Renamed for all user-oriented texts/references to be consistent with now abandoned feature of the PowerView app.

Signed-off-by: Jacob Laursen <[email protected]>

* Change custom text keys to not collide with framework.

Signed-off-by: Jacob Laursen <[email protected]>

* Avoid multiple thing updates.

Signed-off-by: Jacob Laursen <[email protected]>

* Add missing label/description texts for secondary channel.

Signed-off-by: Jacob Laursen <[email protected]>

* Remove unneeded @nullable annotations.

Signed-off-by: Jacob Laursen <[email protected]>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
* Add support for scene collections.

Fixes openhab#11533

Signed-off-by: Jacob Laursen <[email protected]>

* Add unit test for parsing of scene collections response.

Signed-off-by: Jacob Laursen <[email protected]>

* Add default i18n properties file.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Update documentation with scene collections.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix formatting.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Split offline tests into separate distinct tests.

Signed-off-by: Jacob Laursen <[email protected]>

* Increase test coverage for scene/scene collection parsing.

Signed-off-by: Jacob Laursen <[email protected]>

* Internationalization of dynamic scene/scene collection channels.

Signed-off-by: Jacob Laursen <[email protected]>

* Rename scene collections to scene groups.

Renamed for all user-oriented texts/references to be consistent with now abandoned feature of the PowerView app.

Signed-off-by: Jacob Laursen <[email protected]>

* Change custom text keys to not collide with framework.

Signed-off-by: Jacob Laursen <[email protected]>

* Avoid multiple thing updates.

Signed-off-by: Jacob Laursen <[email protected]>

* Add missing label/description texts for secondary channel.

Signed-off-by: Jacob Laursen <[email protected]>

* Remove unneeded @nullable annotations.

Signed-off-by: Jacob Laursen <[email protected]>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
* Add support for scene collections.

Fixes openhab#11533

Signed-off-by: Jacob Laursen <[email protected]>

* Add unit test for parsing of scene collections response.

Signed-off-by: Jacob Laursen <[email protected]>

* Add default i18n properties file.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Update documentation with scene collections.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix formatting.

Signed-off-by: Jacob Laursen <[email protected]>

* Fix CAT: File does not end with a newline.

Signed-off-by: Jacob Laursen <[email protected]>

* Split offline tests into separate distinct tests.

Signed-off-by: Jacob Laursen <[email protected]>

* Increase test coverage for scene/scene collection parsing.

Signed-off-by: Jacob Laursen <[email protected]>

* Internationalization of dynamic scene/scene collection channels.

Signed-off-by: Jacob Laursen <[email protected]>

* Rename scene collections to scene groups.

Renamed for all user-oriented texts/references to be consistent with now abandoned feature of the PowerView app.

Signed-off-by: Jacob Laursen <[email protected]>

* Change custom text keys to not collide with framework.

Signed-off-by: Jacob Laursen <[email protected]>

* Avoid multiple thing updates.

Signed-off-by: Jacob Laursen <[email protected]>

* Add missing label/description texts for secondary channel.

Signed-off-by: Jacob Laursen <[email protected]>

* Remove unneeded @nullable annotations.

Signed-off-by: Jacob Laursen <[email protected]>
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.

[hdpowerview] Support activation of scene collections
4 participants