Skip to content

Instantly share code, notes, and snippets.

@janegilring
Created April 3, 2020 03:28
Show Gist options
  • Save janegilring/9d4741114fc8dd4cb3bd25b8023fd40b to your computer and use it in GitHub Desktop.
Save janegilring/9d4741114fc8dd4cb3bd25b8023fd40b to your computer and use it in GitHub Desktop.
Configure color of Philips Hue Lightstrip - example usage: https://twitter.com/JanEgilRing/status/1245433266099965959
function r {
if (-not (Get-Module -Name PoSHue)) {
Import-Module -Name PoSHue
}
$BridgeAPIKey = $env:HueAPIKey
$BridgeIPAddress = '10.0.1.236'
$Bridge = [HueBridge]::New($BridgeIPAddress, $BridgeAPIKey)
$LightName = 'Hue lightstrip plus 1'
$Light = [HueLight]::New($LightName, $BridgeIPAddress, $BridgeAPIKey)
# Red
$Light.SetHueLight(200, 64537, 254)
Write-Host "Configured Philips Hue Work-From-Home Lightstrip to RED" -ForegroundColor Red
}
function g {
if (-not (Get-Module -Name PoSHue)) {
Import-Module -Name PoSHue
}
$BridgeAPIKey = $env:HueAPIKey
$BridgeIPAddress = '10.0.1.236'
$Bridge = [HueBridge]::New($BridgeIPAddress, $BridgeAPIKey)
$LightName = 'Hue lightstrip plus 1'
$Light = [HueLight]::New($LightName, $BridgeIPAddress, $BridgeAPIKey)
# Green
$Light.SetHueLight(200, 24432, 254)
Write-Host "Configured Philips Hue Work-From-Home Lightstrip to GREEN" -ForegroundColor Green
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment