An open API service indexing awesome lists of open source software.

https://github.com/nstevens1040/set-phillipshue

Work in progress Windows PowerShell cmdlet to set the hue, brightness, saturation, effect, and power state of Phillips Hue light bulbs.
https://github.com/nstevens1040/set-phillipshue

dotnet-framework hue philips philips-hue philips-hue-api philips-hue-bridge philips-hue-bulbs philips-hue-lighting philips-hue-lights powershell powershell-cmdlets powershell-script windows-powershell

Last synced: 4 months ago
JSON representation

Work in progress Windows PowerShell cmdlet to set the hue, brightness, saturation, effect, and power state of Phillips Hue light bulbs.

Awesome Lists containing this project

README

          

# Set-PhillipsHue
Windows PowerShell cmdlet to set the hue, brightness, saturation, effect, and power state of Phillips Hue light bulbs.

I was able to implement [this](https://stackoverflow.com/a/22649803) in C# in order to convert RGB values into XY values.

Script assumes you've set a **PHILIPS_HUE_URI** environment variable to:

```
http:///api//lights
```

## Quick Start
After you have set your **PHILIPS_HUE_URI** environment variable you can use **Windows PowerShell** (*not PowerShell Core*) to make this script available to you by running the following commands.
```ps1
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex (irm https://raw.githubusercontent.com/nstevens1040/Set-PhillipsHue/main/Set-PhilipsHue.ps1)
```
## Example
Let's say you have a connected light named **Hue Blow**. It's already turned on, but you want to change the color to blue, set the saturation to 254, and set the brightness to 254. To accomplish that, you would run the following command.
```ps1
Set-PhilipsHue -LightName 'Hue Blow' -Color blue -Brightness 254 -Saturation 254
```
## Get-Help Set-PhillipsHue -Full
```ps1

NAME
Set-PhilipsHue

SYNTAX
Set-PhilipsHue [-LightName] [[-Color] {red | orange | yellow | chartreuse | electric green | spring green
| aqua | azure | blue | violet | fuchsia | bright pink}] [[-Brightness] ] [[-Effect] {none | colorloop}]
[[-PowerState] {On | Off}] [[-Saturation] ] []


PARAMETERS
-Brightness

Required? false
Position? 2
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false

-Color

Required? false
Position? 1
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false

-Effect

Required? false
Position? 3
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false

-LightName

Required? true
Position? 0
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false

-PowerState

Required? false
Position? 4
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false

-Saturation

Required? false
Position? 5
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).


INPUTS
None


OUTPUTS
System.Object

ALIASES
None

REMARKS
None
```