ARCHIVED FORUM -- March 2012 to February 2022READ ONLY FORUM
This is the second Archived Forum which was active between 1st March 2012 and 23rd February 2022
I've written some new custom strings for controlling the Philips Hue with the MLGW. I've written a command to gradually turn off the lights over five minutes and another one to gradually turn on the lights over 5 minutes. This could be a nice way of gently lowering the lights for sleep and to gentle turn on the lights for waking up. A transition time value of 3000 is for 5 minutes. 6000 is for 10 minutes. 9000 is for 15 minutes. Often, computer code inserted into posts on this forum posts incorrectly. I'll try anyway. If it doesn't post correctly and anyone wants me to email them the strings, just PM me.
To gradually turn off the lights:
PUT /api/<username>/groups/0/action HTTP/1.1\0D\0AContent-Length: 39\0D\0AContent-Type: application/x-www-form-urlencoded\0D\0A\0D\0A{\"on\": false, \"transitiontime\": 3000}
To gradually turn on the lights:
PUT /api/<username>/groups/0/action HTTP/1.1\0D\0AContent-Length: 38\0D\0AContent-Type: application/x-www-form-urlencoded\0D\0A\0D\0A{\"on\": true, \"transitiontime\": 3000}
It seems that the command lines posted correctly.
You can also transition to a specific hue, brightness, and saturation. Here is a command that will gradually turn all lights to grey:
Normal 0 false false false EN-US JA X-NONE PUT /api/<username>/groups/0/action HTTP/1.1\0D\0AContent-Length: 55\0D\0AContent-Type: application/x-www-form-urlencoded\0D\0A\0D\0A{\"on\": true, \"bri\": 46, \"hue\": 39816, \"sat\": 253}
You can also gradually transition to a specific Scene. Here is an example of a command that would transition all lights to the "Relax" Scene:
Normal 0 false false false EN-US JA X-NONE PUT /api/<username>/groups/0/action HTTP/1.1\0D\0AContent-Length: 55\0D\0AContent-Type: application/x-www-form-urlencoded\0D\0A\0D\0A{\"scene\": \"1dd4b4869-on-0\", \"transitiontime\": 3000}
As I feared, the last 2 posts added language in front of the command lines. The command lines should all begin with "PUT."
beojeff: You can also transition to a specific hue, brightness, and saturation. Here is a command that will gradually turn all lights to grey: Normal 0 false false false EN-US JA X-NONE PUT /api/<username>/groups/0/action HTTP/1.1\0D\0AContent-Length: 55\0D\0AContent-Type: application/x-www-form-urlencoded\0D\0A\0D\0A{\"on\": true, \"bri\": 46, \"hue\": 39816, \"sat\": 253}
Correction: This is the correct command to transition all lights to grey:
Normal 0 false false false EN-US JA X-NONE
PUT /api/<username>/groups/0/action HTTP/1.1\0D\0AContent-Length: 81\0D\0AContent-Type: application/x-www-form-urlencoded\0D\0A\0D\0A{\"on\": true, \"bri\": 46, \"hue\": 39816, \"sat\": 253, \"transitiontime\": 3000}