Open zenware opened 4 years ago
Thanks for transcribing my :custard: lol
Something possibly helpful is that lights have groups
Unfortunately the API docs require login: https://developers.meethue.com/develop/hue-api/
GET Requests to /api/<username>/groups
return a response like
{
"1": {
"name": "Living Room",
"lights": [1, 2, 5],
...
},
"..n": {...}
}
So for actions, state-set, and transitions that affect multiple lights at a time you could reference groups by name.
$ huehue light list # Does listing out lights make sense? Is there anything useful other than number to present here?
1, 2, 3, 4, 5, 6, 7
$ huehue group list
There are currently no groups.
$ huehue group add "Living Room" 1,2,5
Added group 1, Living Room with lights 1, 2, and 5
$ huehue group "Living Room" set color=red # There is no built in color DB, this would be some user configured thing in a file.
I suppose I should mention, complete control isn't really required in the CLI, that's what the "library" is for, but I also want a little bit of control in the CLI for playing around a bit and testing some conceptual things. Really the full extent of the CLI power that I care about is being able to address individual lights or light groups/zones and supply state options to those individual lights, groups, zones, or "all lights". Doing things like turning on colorloop mode on and off, setting hue/sat/brightness values, maybe "scene triggering", turning lights on and off, and choosing the transition time between states. Perhaps also shortlist of custom modes like "party mode" or something similar.
Anything more sophisticated, such as schedules, sensors, rules, should be relegated to manual control and further development projects.
I think for now I'm going to try and implement listing lights and some details about their state, bridges, and groups, and allow some flag-based control of properties on the lights.
I may also try to add a color database, probably in the config file for this project.
Example Usage:
huehue OBJECT COMMAND [IDENTIFIER] [OPTION...]
Object type are [light, group, bridge, color]
Commands are [list, add, delete, set, help]
Identifiers are either the ID or a User friendly name of the object in question
Options are any attribute on that object or that can affect the behavior of the command.
huehue light set 2 hue=25000
huehue light set "Master Bedroom Lamp" bri=40
Mainly this is for me to have any tool at all that lets me play with the Hue API in a convenient way but I figured why not also include a CLI to control the lights, should be fun.
My initial thoughts are something like the following
Commentary from ssh.chat