hue lights strip fade in over time

Posted on
Tue Nov 27, 2018 11:34 pm
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

hue lights strip fade in over time

Hi... sorry if this has been asked, but I can't seem to find the solution

I've been using your plugin for a while (love it)

what i want to do... basically fade a hue light on from 0-50% over a 30 min period


what I have tried
add an action group - set brightness with ramp rate
select my hue device
set brightness to 50
set ramp rate to 540 (I'm guessing 9 minutes is the max)

what happens...
I run the action group, the light turns on to 50%


your help would be appreciated.

Thanx

dave

Posted on
Tue Nov 27, 2018 11:36 pm
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

Re: hue lights strip fade in over time

what happens...
I run the action group, the light turns on to 50% instantly, then will start to increase from a lower percentage over 540 seconds.

What am I doing wrong?

Posted on
Thu Nov 29, 2018 12:58 pm
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

Re: hue lights strip fade in over time

if it helps... this is what the log file looks like

Code: Select all
Nov 29, 2018 at 10:54:02 AM
   Action Group                    hue lightstrip fade in
   Sent Hue Lights                 "masterBedroom - LightStrip" on to 100 with RGB values 0, 0 and 255 at ramp rate 0.0 sec.
   Sent Hue Lights                 "masterBedroom - LightStrip" on to 10 at ramp rate 0.0 sec.
   Sent Hue Lights                 "masterBedroom - LightStrip" on to 50 at ramp rate 540.0 sec.

Nov 29, 2018 at 10:54:25 AM
   Updated                         "masterBedroom - LightStrip" on to 11
   Updated                         "masterBedroom - LightStrip" on to 12
   Updated                         "masterBedroom - LightStrip" on to 13
   Updated                         "masterBedroom - LightStrip" on to 14

Posted on
Fri Nov 30, 2018 7:51 am
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: hue lights strip fade in over time

It’s probably because items in action groups are executed (near)simultaneously, not sequentially. Try setting the ramp rate first and then after a short delay setting the brightness to 50%.

I don’t use this functionality so it’s just a guess but maybe it will get you on the right track.

Terry


Sent from my iPhone using Tapatalk

Posted on
Fri Nov 30, 2018 4:28 pm
CliveS offline
Posts: 761
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: hue lights strip fade in over time

Try this but put it in an external file, not an embedded file.

It will give you the 30 Minutes fade in required and you are right 540 seconds is the max but this script will get round that.

30 Nov 2018, 21:18:00
Action Group new action group
Sent Hue Lights "Conservatory Light" off at ramp rate 0.0 sec.
Sent Hue Lights "Conservatory Light" on to 17 at ramp rate 540.0 sec.
30 Nov 2018, 21:18:36
Updated "Conservatory Light" on to 2
30 Nov 2018, 21:19:39
Updated "Conservatory Light" on to 3
30 Nov 2018, 21:20:00
Updated "Conservatory Light" on to 4
30 Nov 2018, 21:20:53
Updated "Conservatory Light" on to 5
30 Nov 2018, 21:21:35
Updated "Conservatory Light" on to 7
30 Nov 2018, 21:22:00
Updated "Conservatory Light" on to 8
30 Nov 2018, 21:22:59
Updated "Conservatory Light" on to 9

Cut out the next 20 minutes of log!!

30 Nov 2018, 21:41:00
Updated "Conservatory Light" on to 43
30 Nov 2018, 21:41:54
Updated "Conservatory Light" on to 44
30 Nov 2018, 21:42:26
Updated "Conservatory Light" on to 45
30 Nov 2018, 21:43:29
Updated "Conservatory Light" on to 47
30 Nov 2018, 21:44:00
Updated "Conservatory Light" on to 48
30 Nov 2018, 21:44:18
Updated "Conservatory Light" on to 49
30 Nov 2018, 21:45:37
Updated "Conservatory Light" on to 50

Code: Select all

import time

plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
rate = 540

if plug.isEnabled():
   plug.executeAction("setBrightness", indigo.devices["Conservatory Light"].id, props={"brightness":00, "rate":0})
   time.sleep(2)   
   plug.executeAction("setBrightness", indigo.devices["Conservatory Light"].id, props={"brightness":17, "rate":rate})
   time.sleep(rate)
   plug.executeAction("setBrightness", indigo.devices["Conservatory Light"].id, props={"brightness":34, "rate":rate})
   time.sleep(rate)
   plug.executeAction("setBrightness", indigo.devices["Conservatory Light"].id, props={"brightness":50, "rate":rate})


CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Fri Nov 30, 2018 10:16 pm
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

Re: hue lights strip fade in over time

Thanx for that... that does get me the desired 30 mins, however, same fundamental problem...

instant on to 17, then begins brighten from 1
instant on to 34, then begins brighten from 17
instant on to 50, then begins brighten from 34

your suggestion prompted me to do this (from within a file)

Code: Select all
import time
from time import sleep

plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
bright = 2

for i in range(25):
     plug.executeAction("setBrightness", indigo.devices["masterBedroom - LightStrip"].id, props={"brightness":bright, "rate":0})
     bright = bright+2
     sleep(72)


just checking my delays, but should be close:)

d

Posted on
Sat Dec 01, 2018 4:47 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: hue lights strip fade in over time

Hi Dave.

Yea, for a 30 minute fade, you'd have to use a script like CliveS suggested. The 540 second limit in the Hue Lights plugin is somewhat arbitrary because I couldn't find any Hue API documentation on exactly how long a transient time is allowed by the Hue bridge. So the limit is intended to maintain consistency with other Indigo supported hardware (namely the INSTEON dimmers which has a 540 second max transition time).

As for the lights initially coming on to a higher value than the destination brightness, that's likely a bug in either the light behavior itself or how the Hue bridge sends the ZigBee commands to the lights. The Hue Lights plugin sends all parameters related to a brightness change request in a single command to the Hue bridge. So if you select an Indigo action to brighten a Hue bulb to 50% brightness with a ramp rate of 540 seconds, the Hue Lights plugin sends a single command to the Hue bridge that tells it to set the light to 50% brightness with a transition time of 540 seconds. If there's a way to prevent the light from going on to a brighter level before starting the transition, I wasn't able to find info on that in the Hue API.

Sorry I couldn't help more. I'm glad the Python scripting option appears to be working as a workaround though.

Posted on
Sat Dec 01, 2018 5:04 am
CliveS offline
Posts: 761
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: hue lights strip fade in over time

Nathan,
Could you not use

Code: Select all
   plug.executeAction("setBrightness", indigo.devices["Conservatory Light"].id, props={"brightness":00, "rate":0})
   time.sleep(2)   
   plug.executeAction("setBrightness", indigo.devices["Conservatory Light"].id, props={"brightness":xx, "rate":rate})


That worked fine when I was writing the script, what I don't understand is why my script increased gradually over 30 minutes as seen by the log but when @bsp9493 ran it he still got
instant on to 17, then begins brighten from 1
instant on to 34, then begins brighten from 17
instant on to 50, then begins brighten from 34

all I can think is he has an RGB device and mine was plain original white.

anyway he got it working and his code looks more eloquent than mine :)

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Sat Dec 01, 2018 9:39 am
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

Re: hue lights strip fade in over time

Thanx Nathan... kinda figured it was something to do with hue itself as the command and the logic makes sense..

Nice gradual transition from off to 50% brightness this morning:).

Now to see if i can get fancy and transition some sunrise colours in there - LOL

Thanx again guys!

d

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests