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

https://github.com/adridevelopsthings/philipshue-cli

A cli interface for the philipshue api
https://github.com/adridevelopsthings/philipshue-cli

Last synced: about 1 year ago
JSON representation

A cli interface for the philipshue api

Awesome Lists containing this project

README

          

# philipshue-cli
A cli interface for the philipshue api

## Installation
Download the binary from the releasese page for your operating system or install it with cargo:
```
cargo install --git https://github.com/adridevelopsthings/philipshue-cli
```

### AUR
If you're using arch linux you can get the philipshue-cli from the [AUR](https://aur.archlinux.org/packages/philipshue-cli):
```
yay -S philipshue-cli
```

### Docker
It's also possible to run philipshue-cli with docker:

```
docker run --rm -v ./config:/config ghcr.io/adridevelopsthings/philipshue-cli philipshue-cli login --device-type testdevice
```

# Usage
```
Usage: philipshue-cli

Commands:
login Login to the hue bridge.
get-light Get all data including it's state from a light.
list-lights List all lights, their light number and name.
get-lights List the data from all lights. If you just want to list all light numbers and names use 'list-lights' instead.
change-state Change the state (like if the light is on or off) of a light.
stay-on Turn the light on and (re-)set the state for n seconds every transition-time, if set, otherwise 10 seconds.
help Print this message or the help of the given subcommand(s)

Options:
-h, --help Print help
-V, --version Print version
```
## Login
```
Login to the hue bridge.

Usage: philipshue-cli login [OPTIONS]

Options:
-b, --bridge-url Set the bridge url if discovering is not possible or doesn't work.
-d, --device-type Set the device type to any string. The bridge will associate your credentials with this string. If you don't set the device-type cli#HOSTNAME will be used
```

## Get light
```
Get all data including it's state from a light.

Usage: philipshue-cli get-light

Arguments:
The light number or light name.
```

## List lights
```
List all lights, their light number and name.

Usage: philipshue-cli list-lights
```

## Get lights
```
List the data from all lights. If you just want to list all light numbers and names use 'list-lights' instead.

Usage: philipshue-cli get-lights
```

## Change light state
```
Change the state (like if the light is on or off) of a light.

Usage: philipshue-cli change-state [OPTIONS]

Arguments:
The light number or light name.

Options:
-b, --brightness
--saturation
--hue
-t, --transition-time Transition time in seconds.
-s, --state [possible values: on, off]
```

## Stay on
```
Turn the light on and (re-)set the state for n seconds every transition-time, if set, otherwise 10 seconds.

Usage: philipshue-cli stay-on [OPTIONS] --stay-on-for

Arguments:
The light number or light name.

Options:
-b, --brightness
--saturation
--hue
-t, --transition-time Transition time in seconds.
-s, --stay-on-for Stay on for n seconds.
```

# License
Licensed under either of

* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.