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
Question: Fade In/Out 6 Lights #373
Comments
Sure, you could create HomeKit scenes for each of your transitions. If you create them in Eve, you can include Transitiontime. Once created, you can recall the scene from any HomeKit app (or automation). Controlling two lights simultaneously from a HomeKit scene will probably look OK, setting six lights, you might experience that not all lights seem to change at the same time. To overcome this, create groups on your Hue bridge or deCONZ gateway, and expose these groups to HomeKit (as Lightbulbs), and use those instead of the lights in the HomeKit scenes. I'm not sure you'd be able to automate recalling the scenes at the appropriate timing in a loop from HomeKit. Depending on your use case, I would either write a simple bash script, like: #!/bin/bash
# Groups
group_all=1
group_outer=2
group_middle=3
group_inner=4
# Transition time in seconds
transition=10
# Transitiontime in 0.1 secons
transitiontime=$((transition * 10))
ph put /groups/${group_all}/action '{"on": true, "bri": 1, "xy": [0.5, 0.5]}'
while true ; do
ph put /groups/${group_outer}/action "{\"bri\":254, \"transistiontime\": ${transitiontime}}'
sleep ${transition}
ph put /groups/${group_outer}/action "{\"bri\":1, \"transistiontime\": ${transitiontime}}'
sleep ${transition}
ph put /groups/${group_middle}/action "{\"bri\":254, \"transistiontime\": ${transitiontime}}'
sleep ${transition}
ph put /groups/${group_middle}/action "{\"bri\":1, \"transistiontime\": ${transitiontime}}'
sleep ${transition}
ph put /groups/${group_inner}/action "{\"bri\":254, \"transistiontime\": ${transitiontime}}'
sleep ${transition}
ph put /groups/${group_inner}/action "{\"bri\":1, \"transistiontime\": ${transitiontime}}'
sleep ${transition}
done This script would run on your Raspberry (where deCONZ is running as well). To start or stop the sequence, you would have start of kill this script. Not very nice, but sufficient for a one-time use like a party (I used something like this during Xmas to alternate my lights between red and green - ho ho ho). For full control from HomeKit, program the sequence in Hue bridge or deCONZ gateway rules:
There's no graphic environment to maintain bridge/gateway rules. I use bash scripts calling |
Thanks for the code, Erik. I'm not currently running deCONZ gateway; I use a hardware Hue Bridge as well as your plugin. Is deCONZ gateway pretty easy to configure? |
I will give deCONZ gateway a shot. Thanks again for a fantastic plugin! |
Hi @ebaauw, I created a scene in deconz that includes a 10min transition for a lights-group. Starting it from there, it's exactly what I want. Is there a way to expose this scene to homebridge similar to the "groups"? I didn't figure out, yet, how to trigger it with a time-based rule from homekit. |
fyi. for a quick workaround I'm calling the api "curl -i -X PUT http://192.168.x.x/api/xxxxx/groups/5/scenes/1/recall" using the homebridge-script2 plugin |
homebridge-hue doesn't expose bridge/gateway scenes to HomeKit. As a workaround, I create a CLIPGenericFlag sensor, which homebridge-hue exposes as a Switch to HomeKit. On the bridge/gateway, I create a rule to recall the "on" scene when the flag is set and another one to recall the "off" scene when the flag is cleared. To trigger timed transitions from HomeKit, include the custom Transition Time characteristic in the HomeKit scene. This is in the service homebridge-hue creates for the bridge/gateway. Apple's Home app doesn't support this, so you need to create the scene in Eve or another HomeKit app. After that, you can recall it alright from Apple's Home app. I suppose I could try and expose scenes to HomeKit. They would be mapped to Switch, which would revert automatically to Off after the scene has been recalled (cf. the Volume Change characteristic in homebridge-zp). Currently, neither the Hue nor deCONZ API reports whether a scene is still active, and there's no way to un-recall a scene. Note however, that every other Hue app tends to create a lot of scenes, so this could lead to a lot of switches. I could try and expose the scenes as additional services to the group, to limit the number of accessories created, but then the scenes are bound to the same HomeKit room as the group. This might work well for deCONZ, where scenes are created under a group, but not for Hue, where all scenes are stored under |
thank you for your detailed answer! Maybe a whitelist in the config section could only allow certain scenes to be exposed. |
Hello and sorry if I didn't search enough to answer this question. I read closed issue #131 which helped quite a bit.
I have both your plugin running via Homebridge on a RPi as well as a 2nd generation Hue Bridge. I have 6 hue color bulbs in a straight line. I am trying to have all bulbs start at the same color 0% brightness, then the outer most 2 bulbs transition to 100% and fade down to 0%, followed by the next inner most 2 bulbs that transition to 100% and down to 0%, and finally the last 2 (and then repeat). Your plugin is fantastic for controlling individual bulbs in a group for this purpose. I'm just trying to figure out the most efficient way to accomplish this task. I will probably use the Eve app to create my scenes with transition times but since you are very knowledgable with regards to Hue, I'm wondering if you have any thoughts on the best way to accomplish this. Thanks in advance.
The text was updated successfully, but these errors were encountered: