-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Expose bridge/gateway scenes to HomeKit #475
Comments
Big thumbs up for this one. I was actually thinking about opening an issue for this topic with almost the same idea behind it for the last 2 weeks. I think this will benefit the whole setup a lot, as I must say creating all those scenes in Homekit is a pain. I setup all scenes both in Homekit AND deCONZ because the configruation options in deCONZ are better especially when combined with switch config like IKEA 5-button remote or Hue dimm switch (i.e. toggle on/off on one button, toggle/cycle through scenes etc). I think exposing group scenes as additional services is the way to go, otherwise we will hit the 99 items limit very quickly. The question is, will it be just a turn on "switch" or will it reflect the actual activated scene (I don't know if this is possible though). Regarding the
I know this might be a little off topic (and I am happy to open a seperate issue if you like), but I think giving user control over |
In general, deCONZ scenes are to be preferred over HomeKit scenes. Not just from a functional perspective, but also non-functionally: recalling a deCONZ scene results a single Zigbee (broadcast/groupcast) message, whereas recalling a HomeKit scene results in up to three Zigbee (unicast) messages per light in the scene (see #15 (comment)).
That limit has been raised by Apple to 150 (but I still need workarounds not to hit it ;-). I think Zigbee provides a means (per light) to check whether it still reflects the state of the last scene recalled, but the REST API doesn't expose this. I haven't tested how reliable this is, and whether all light types/manufacturers actually support this. You would have to check this for all lights in the scene, to check whether the scene is still active, much like
That's actually a good idea: only expose scenes for whitelisted groups, or for all not-blacklisted groups when
Yes, for people who appreciate the REST API, and understand that it exposes resources, which you whitelist or blacklist. For less tech savvy people (who don't even understand json), this is a nightmare. For me as well - this is a hobby project and I don't want to spend my time on end-user support. I figure if you understand the REST resources, it's a small step to understanding Eventually, I want homebridge-hue to provide a user interface that shows the devices (as opposed to resources) connected to the Hue bridge/deCONZ gateway, and allow to check which to expose and, where appropriate, how to expose them. Using dynamic platform accessories (see #4), this would be persisted in I could provide that UI (somewhat awkwardly) through HomeKit, but you only want a HomeKit administrator to access it. HomeKit seems to provide a facility for that, but no-one seems to know how to use it (see homebridge/homebridge#1389). So the UI probably needs to be through a separate, password protected, web server (like homebridge-config-ui-x). Unfortunately, the node modules they use to render the web UI are written in C/C++, causing a load of installation issues on containers, virtual machines, and exotic platforms. That's a no-go for me as well. So I need to find a native JavaScript module to generate a web UI, or write my own. Not my favourite past time; I started with HomeKit in the first place, so I wouldn't have to create my own UI. Anyway, I would need to refactor homebridge-hue first, to switch to the dynamic platform accessory model. |
That's actually a good idea! Exposing scenes from groups which are whitelisted or expose scenes from all groups except those which are blacklisted when using The only thing which might be tricky (at least when you make white- and blacklist configurable through So maybe as a first step implement exposing scenes as discussed above and just make it configurable through REST API / Regarding regarding your "hobby project"... You do an amazing job on this (and the Sonos) project.. Thanks again! |
v0.11.32 supports deCONZ scenes:
Please let me know if this works for you. Hue bridge scenes are a bit more elaborate, as scenes are stored as common |
Actually, this doesn't work: too many tiles in Apple's Home app and Siri wants to recall all scenes when setting a room on. So I better expose the scenes as custom EDIT in v0.11.34. |
I'd like to test this feature, my config looks like this: >> cat /var/lib/homebridge/config.json
{
"bridge": {
"name": "Phoscon gateway",
"username": "---------",
"port": 51826,
"pin": "--------"
},
"description": "Phoscon deCONZ -> HomeKit Bridge",
"platforms": [
{
"platform": "Hue",
"host": "127.0.0.1",
"users": {
"---------------------": "--------------"
},
"rooms": true,
"sensors": true,
"scenes": true,
"excludeSensorTypes": ["Daylight", "CLIP", "Geofence", "ZLLSwitch", "ZGPSwitch"],
"lights": true,
"waitTimeUpdate": 100
}
]
} But I cannot see any resource available for the scenes I have setup. For example: >> ph -H 127.0.0.1 get /groups/2/scenes
{
"1": {
"lights": [
"3",
"4"
],
"name": "Reading",
"transitiontime": 10
},
"2": {
"lights": [
"3",
"4"
],
"name": "Sleeping",
"transitiontime": 10
}
} Doesn't show up in Eve or Home apps. Did I miss something? |
Yes, you need to expose groups, see above:
|
I confirm that this works for me. It simplified most HomeKit scenes I had to a single command, which is great. A curiosity: is there a way to emulate the "All off" functionality from deconz's web interface through this mechanism? I did not find any way other than setting up an equivalent scene where all lights are in. |
Expose |
Yes, I did that. Group 0 is exposed. If I set a new HomeKit scene (through Eve), in which the power on group 0 is set to OFF, then this has no effect on the lights. So, effectively, I have no way to turn off all lights at once. The only way I found so far was to create a scene inside a group using all lights, that sets everything to OFF. If I do that, I can call this scene through Eve and all lights will turn off. The annoying issue with this solution is that if I add a new light, I have to remember to update this scene as well, so it turns off as expected. |
deCONZ v2.05.66? It has some issues with |
Hi Eric, Over from the linked post above. Yes for me the idea of a momentary switch to trigger a Hue Bridge scene would be best. I wouldn’t really want them to appear as scenes in Homekit, just the ability to turn them on is enough. My usage case would be something like
|
My issue is how to configure what scenes to expose and how. Hue bridge scenes are defined independently from groups (unlike deCONZ scenes); any group could be used to recall the scene, changing only the lights that are both in the scene as well as in the group. So, by default, I would expose every scene under every (exposed) group. Note that Siri gets hopelessly confused when exposing scenes as HomeKit switches - she’ll activate all scenes when you ask her to turn on a room. That’s why I use a custom characteristic to expose them (same as for enabling/disabling schedules). In Eve these look just like switches, but in Home, they’re not visible. The workaround for this is to create (in Eve) a HomeKit scene with the custom switch, which is visible In and can be activated from Home. Note that with homebridge-hue, you could also create a fading scene in HomeKit. It exposes transitiontime under the bridge accessory. Again, Home doesn’t support this, but if you create the scene in Eve, Home will happily activate it. |
Your last part is probably my easiest way to sort this. Does it support blink and colour loop too? |
You can keep the lights exposed natively, but you would have to expose lights or groups thru homebridge-hue as well; the transitiontime needs to be added to the Hue API call to change the light or group. I don’t support colorloop, but that would be an easy enhancement. I blink the lights when you identify them in HomeKit, but I’ve never seen a HomeKit app that lets you add |
I think I cracked it. The Hue app creates scenes for a particular room. This room (or rather: the group for this room) is encoded in the
|
v0.11.48 supports Hue bridge scenes and colorloop. |
Hi there! How do i get to see my hue scenes after i updated to v0.11.48. I have set: "scenes": true, "groups": true and "rooms": true in config.json; |
They're exposed under the accessory for the (room) group. They use a custom characteristic (or Siri would activate all scenes when you ask her to turn on a room), so you need to use a decent HomeKit app, like Eve, instead of Apple's Home. To recall the Hue bridge scenes from Siri or Home, create a HomeKit scene in Eve, with the custom characteristic to recall the bridge scene. |
See #158, #373, #472.
Expose Hue bridge/deCONZ gateway scenes as HomeKit switches, cf. Home Assistant.
To prevent creating too many HomeKit accessories, these switches would be created as additional services under the group accessories. This makes sense for scenes linked to a group, like deCONZ gateway scenes and
GroupScene
Hue bridge scenes. It doesn't make sense forLightScene
Hue bridge scenes, which are stored under special group 0 (this is different from group 0 on the deCONZ gateway), but can be recalled using any group. These should probably be exposed under each group.Adding a
scenes
key to config.json is easily done. However, as every other Hue app tends to create its own scenes, the number of scenes becomes overwhelming pretty quickly. We probably need a whitelist/blacklist mechanism to control which scenes are exposed. Hue bridge scenes can be added to resourcelinks, but I don't think deCONZ scenes can. We would probably need support for the Hue bridge API'sscenes
resources in deCONZ, see dresden-elektronik/deconz-rest-plugin#1471.The text was updated successfully, but these errors were encountered: