Here’s a simple Applescript to change the Hue bulbs from red to green, for the holidays. This assumes you have 2 bulbs next to each other, but, by taking out one of the lines below, it will work with 1 bulb. Save it as an application and just let it run!
property startColor : ""
property beginTransisiton : ""
--turn the bulb on
set turnOn to the quoted form of "{\"on\": true,\"bri\": 254}"
do shell script "curl --request PUT --data " & turnOn & " http://yourHueIP/api/yourToken/lights/3/state/"
do shell script "curl --request PUT --data " & turnOn & " http://yourHueIP/api/yourToken/lights/4/state/"
on idle
set startColor to "1400"
set beginTransition to "{\"hue\": " & startColor & ", \"sat\": 254,\"bri\": 254}"
set beginTransisiton to the quoted form of beginTransition
delay 1
do shell script "curl --request PUT --data " & beginTransisiton & " http://yourHueIP/api/yourToken/lights/3/state/"
do shell script "curl --request PUT --data " & beginTransisiton & " http://yourHueIP/api/yourToken/lights/4/state/"
delay 5
set endColor to "25000"
set beginTransition to "{\"hue\": " & endColor & ", \"sat\": 254,\"bri\": 254}"
set beginTransisiton to the quoted form of beginTransition
delay 1
do shell script "curl --request PUT --data " & beginTransisiton & " http://yourHueIP/api/yourToken/lights/3/state/"
do shell script "curl --request PUT --data " & beginTransisiton & " http://yourHueIP/api/yourToken/lights/4/state/"
return 3
end idle
{ 0 comments }