Skip to content

Instantly share code, notes, and snippets.

@bdunlay
Last active August 29, 2015 14:07
Show Gist options
  • Save bdunlay/335b4c8f63095372606c to your computer and use it in GitHub Desktop.
Save bdunlay/335b4c8f63095372606c to your computer and use it in GitHub Desktop.
Dim a bulb (1-100)
#!/bin/bash
# USAGE
# turn a bulb on or off:
# dim.sh [1 - 100]
# you need to know the device ID of the bulb you are trying to toggle.
YOUR_DEVICE_ID=12345678
# Set brightness
curl -d 'cmd=DeviceSendCommand&data=<gip><version>1</version><token>1234567890</token><did>'$YOUR_DEVICE_ID'</did><type>level</type><value>'$1'</value></gip>&fmt=xml' 'http://lighting.local/gwr/gop.php'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment