Created
August 3, 2021 20:27
-
-
Save organicaudio/5760bfa5ea74399499b214d39d45883e to your computer and use it in GitHub Desktop.
covers key commands / steps to
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## To get started: | |
https://developers.meethue.com/develop/get-started-2/ | |
Bridge API Debugger: | |
`https://$HUE_BRIDGE/debug/clip.htm` | |
### Variables | |
################################## | |
# IP Address of your Hue Bridge | |
HUE_BRIDGE="10.0.0.111" | |
# API Key required to authenticate to your local Hue bridge | |
API_KEY="1028d66426293e821ecfd9ef1a0731df" | |
# The sensor number for the device you want to change states | |
VAR="81" | |
### Commands | |
################################## | |
## Sensors | |
# Get Data on Hue Bridge Sensors | |
# Check Status | |
curl -s http://$HUE_BRIDGE/api/$API_KEY/sensors/$VAR/ | jq '.state .status' | |
# Command - Enable Motion Sensor | |
curl -H 'Content-Type: application/json' -X PUT \ | |
-d '{"status":0}' \ | |
http://$HUE_BRIDGE/api/$API_KEY/sensors/$VAR/state | |
# Command - Disable Motion Sensor | |
curl -H 'Content-Type: application/json' -X PUT \ | |
-d '{"status":1}' \ | |
http://$HUE_BRIDGE/api/$API_KEY/sensors/$VAR/state | |
## Lights | |
# Get lights data | |
Address: | |
`https://<bridge ip address>/api/1028d66426293e821ecfd9ef1a0731df/lights` | |
Method: *GET* | |
# Get information about a Specific Light | |
Address: | |
`https://<bridge ip address>/api/1028d66426293e821ecfd9ef1a0731df/lights/1` | |
Method *GET* | |
# Change state of Individual Light | |
Address: | |
`https://<bridge ip address>/api/1028d66426293e821ecfd9ef1a0731df/lights/1/state` | |
Body: `{"on":false}` | |
Method: *PUT* | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment