Skip to content

Instantly share code, notes, and snippets.

@kopiro
Created March 15, 2021 19:12
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 kopiro/cafc5f1d0ddf219d61e021a82d995ae2 to your computer and use it in GitHub Desktop.
Save kopiro/cafc5f1d0ddf219d61e021a82d995ae2 to your computer and use it in GitHub Desktop.
Switch a Philips Hue group on/off
#!/bin/bash
key=''
url="http://Philips-Hue.local/api/$key/groups/3"
/usr/bin/curl "$url/action" -X PUT -d "{\"on\":$(/usr/bin/curl "$url" | /usr/local/bin/jq "if (.state.all_on) then false else true end")}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment