I just tried it and the effect is very cool =)
I will include this in next releases as optional parameter of the standard Control.ColorHsb command:
case "Control.ColorHsb":
string[] values = parameter.Split(',');
double transition = 5;
if (values.Length > 3) transition = ((int)(double.Parse(values[3]) * 10));
bridgeapicall(lightnumber, "{ "on" : true" +
", "hue" : " + (int)(double.Parse(values[0], System.Globalization.CultureInfo.InvariantCulture) * 65536) +
", "sat" : " + (int)(double.Parse(values[1], System.Globalization.CultureInfo.InvariantCulture) * 255) +
", "bri" : " + (int)(double.Parse(values[2], System.Globalization.CultureInfo.InvariantCulture) * 255) +
", "transitiontime" : " + transition.ToString() + "}");
Program.RaiseEvent(module, "Status.Level", (double.Parse(values[2], System.Globalization.CultureInfo.InvariantCulture)).ToString(), "Hue Light");
Program.RaiseEvent(module, "Status.ColorHsb", parameter, "Hue Light");
break;
This is the Javascript equivalent of your sunrise script:
var light = hg.Modules.WithName("Light 1");
light.Off();
// First transition to red, 5 seconds
light.Command("Control.ColorHsb").Set("0,1,.8,5");
hg.Pause(5);
// Second transition to orange, 5 seconds
light.Command("Control.ColorHsb").Set("0.08,1,.8,5");
hg.Pause(5);
// Last transition to bright white, 10 seconds
light.Command("Control.ColorHsb").Set("0.13,0,1,10");
Raspberry takes up to 20 seconds to save a C# program, so sometimes it's better using other languages =)
g.