Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Lightify GU10 - Pair with Hue hub and test
#!/bin/bash
bridgeuser="" # Bridge user, see the API docs for this http://www.developers.meethue.com/documentation/configuration-api#71_create_user
bridgeip="" # Bridge IP address
lamp=$1 # The lamp number, usage ./find-test 5
curl -X POST "http://$bridgeip/api/$bridgeuser/lights"
echo $?
# Press enter once the bulb flashes
read -e
echo "OFF"
curl -s -d "{\"on\":false,\"transitiontime\":0}" -X PUT "http://$bridgeip/api/$bridgeuser/lights/$lamp/state"
sleep 0.5
echo "ON"
curl -s -d "{\"on\":true,\"bri\":1,\"transitiontime\":0}" -X PUT "http://$bridgeip/api/$bridgeuser/lights/$lamp/state"
sleep 0.5
echo "FULL BRIGHTNESS"
curl -s -d "{\"bri\":254,\"transitiontime\":1}" -X PUT "http://$bridgeip/api/$bridgeuser/lights/$lamp/state"
sleep 1
echo "50% BRIGHTNESS"
curl -s -d "{\"bri\":128,\"transitiontime\":1}" -X PUT "http://$bridgeip/api/$bridgeuser/lights/$lamp/state"
sleep 1
echo "5000K"
curl -s -d "{\"ct\":153,\"transitiontime\":2}" -X PUT "http://$bridgeip/api/$bridgeuser/lights/$lamp/state"
sleep 2
echo "2700K"
curl -s -d "{\"ct\":370,\"transitiontime\":2}" -X PUT "http://$bridgeip/api/$bridgeuser/lights/$lamp/state"
sleep 2
echo "10% BRIGHTNESS"
curl -s -d "{\"bri\":25,\"transitiontime\":1}" -X PUT "http://$bridgeip/api/$bridgeuser/lights/$lamp/state"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.