ebaauw / homebridge-hue

Homebridge plugin for Philips Hue
Apache License 2.0
898 stars 91 forks source link

Hidden hue scenes are displayed in HK #995

Closed Nastras closed 3 years ago

Nastras commented 3 years ago

Issue

Hi, @ebaauw

I have created a rule via the Hue Essential app for my motion sensor that this turns off the light after 5 min without movement. This rule creates a sensor in the backend of the type "CLIPGenericStatus" (image 1).

Image 1 C918B6E3-7727-4188-B561-6EC54583482D

I have already excluded this type via config.json (image 2).

Image 2 9ADE4B6E-D00E-4AEF-A5D7-F1C190290198

Nevertheless this sensor is displayed as a switch at my light group (image 3) of the room in Homekit (image 4).

Image 3 BC6C3E04-35D7-4018-8B7F-E47268DD19D7

Image 4 D1BAF83A-BEB4-4132-8E8A-23456FB8942D

I would have expected that this switch is not shown to me due to the exclusion in config.json. Do I need to blacklist this virtual sensor in the REST API or do I have an error or is it a bug?

Log Messages

Debug Files

homebridge-hue.json.gz

ebaauw commented 3 years ago

Nevertheless this sensor is displayed as a switch at my light group (image 3) of the room in Homekit (image 4).

You're looking at another resource; CLIPGenericStatus isn't displayed as switch. Double-check (in Eve) the Resource characteristic to see for which resource this switch is created. Looking at your dump file, I think it's for the Motion sensor 5 recover scene in the Lampen Kรผche group.

Nastras commented 3 years ago

Thank you for the quick reply. Since no new scene was displayed in all Hue apps I did not assume that it is a scene that was created hidden. I only noticed that he has created a new sensor.

If I want to hide this scene in HK I have to do this via the blacklist?

ebaauw commented 3 years ago

I don't currently support /scenes resources in blacklists (nor in whitelists). The Hue API and deCONZ API differ how they expose scenes, so I'd need to add support separately. Hue probably being straightforward, but not sure how to do this for deCONZ (which exposes scenes under /groups/GroupId/scenes/SceneId).

The Hue API documentation doesn't provide an obvious way to mark a scene hidden. What apps, besides the official Hue app did you check? Could you list the output of ph get /scenes/ysWVFN0YieKIvE6? Assuming I can recognise them, I think it makes sense for Homebridge Hue not to expose hidden scenes?

Nastras commented 3 years ago

Good morning!

That the scene can not be hidden via the blacklist I have also noticed yesterday shortly after your first response ๐Ÿ˜…

I have attached you a screen of ph get /scenes/ysWVFN0YieKIvE6. Also from iconnect hue and hue essential where I checked if the scene is displayed in the gui. The official hue app I do not use it should be necessary to check it there too let me know shortly and I install it.

With deconz I don't have the problem myself because I haven't created any rules there. But basically this problem should also exist there.

I also think that it makes no sense to display hidden scenes via homebridge-hue. Would be cool if we/ you can find a solution for this.

3A782009-9CAA-498C-B45B-766F36402F8C BF4DD706-89DF-4DE9-A862-D1853EE029A6 A74CA463-B341-4BC2-918C-B45717004716

Nastras commented 3 years ago

I noticed something else. When I create the same rule via iconnect hue it looks identical in the gui. However, in the API both differ although I have selected the light group of the room each time. iConnect hue creates a scene of type LightScene and hue essential makes it a scene of type GroupScene.

The funny thing is that the rule created by iConnectHue does not work in reality. So the motion detector does not turn off the light. The rule from hue essential works perfectly.

The scene of iConnect hue is not displayed in hk by homebridge-hue in the room group.

Nastras commented 3 years ago

created with hue essential:

1C874962-CDA0-462D-94CC-516D113611CE 9EBBE77F-C0FF-49DB-86AD-B346F7C57997 8B343E7B-BE00-4460-AEEE-2B713E5AA2F9

Nastras commented 3 years ago

created with iconnect hue:

02F739E7-8C36-491A-961A-56620DBF2040 DE86B7EB-5A5F-494E-BAF7-0CB43447EB97 9E53DA2C-A760-44BD-B825-1C409191F982

Nastras commented 3 years ago

8DEFCDD7-6F15-4916-9984-575B1344CE57 1DC05EFA-2BB1-4124-AFA3-85C0CDA23AE1

ebaauw commented 3 years ago

The scene of iConnect hue is not displayed in hk by homebridge-hue in the room group.

By design, LightScene scenes are exposed under (the accessory for) /groups/0; GroupScene scenes under (the accessory for) the corresponding group.

I see no easy clue as to which scenes are supposed to be hidden. The API offers appdata as a means for apps to record specific data per scene, but that format is app-dependent. I doubt iConnectHue knows which scenes created by Hue Essentials should be hidden or v.v. I could imagine the Hue app simply hiding all scenes created by other apps, or rather, using other usernames. Note that the owner no longer shows the actual username (API key), but a UUID created from the username (except for the username used in the API call).

Nastras commented 3 years ago

If it is not so easy to recognize which scenes should be hidden, what about the approach to do this manually via the blacklist?

ebaauw commented 3 years ago

Was already working on that.

Unfortunately, deCONZ doesn't support /scenes resources, and you cannot link the resource where deCONZ keeps the scene, so this only works with a Hue bridge.

Nastras commented 3 years ago

It is a pity that it does not work with deconz. But for my case I am helped with hue. Thank you! You have a good wire to the guys from dreden-elektronik maybe they extend the API in the future to this function?

ebaauw commented 3 years ago

In v0.13.16.

Nastras commented 3 years ago

Tested and it works perfectly! Thanks for the fast extension ๐Ÿ‘๐Ÿ’ช๐Ÿ‘Œ