Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Radiotechniman/727a3c1ef5beb5423772fa4a5e32f9e5 to your computer and use it in GitHub Desktop.
Save Radiotechniman/727a3c1ef5beb5423772fa4a5e32f9e5 to your computer and use it in GitHub Desktop.
High speed, flickering candle bulb effect for any number of Philips Hue bulbs
set HUB to "192.168.1.216" --change for your bridge IP
set USER to "newdeveloper"
repeat
repeat with bulb from 1 to 2 -- Change if you have more bulbs or want to use a subset
set hue to (random number from 5000 to 12750)
set sat to (random number from 150 to 255)
set bri to (random number from 50 to 255)
set transitiontime to (random number from 1 to 3) -- Increase range for slower transitions
set query to "{\"sat\":" & sat & ",\"hue\":" & hue & ",\"bri\":" & bri & ",\"transitiontime\":" & transitiontime & "}"
set command to "curl --request PUT --data '" & query & "' http://" & HUB & "/api/" & USER & "/lights/" & bulb & "/state/ --connect-timeout 5"
log command
do shell script command
end repeat
delay (random number from 1 to 3) / 10 -- Increase range for slower color changes
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment