Filament
GraphQL, but for your lights
Project Status
β UNMAINTAINED
I'm sad to say it, but the project is dead. I'd hoped to find an excuse to dive in again, but it never came. 3rd party apps and integrations became good enough that I no longer got value in maintaining my own automation platform.
Why?
Because GraphQL is amazing and so is home automation. Why not both?
Trying it out
First off, you need lights. The special kind you can control with your smartphone and pretend you're telekinetic. I get mine from Philips. I think you can use other types, but I've never tried.
Assuming you've got some lights, do these things:
- Clone this repo
- Install (
npm install
oryarn install
or whatever the cool kids do these days) - Do
yarn register
. That'll poll your Hue bridge until you press the link button yarn build
yarn start
π
Open your browser to localhost:8080
and try some queries!
Lazy person copy & paste
git clone https://github.com/PsychoLlama/filament.git && cd filament
npm install
echo "Press the giant button on your Hue bridge"
npm run register
npm run build
npm start
Queries
Lights
- β Get a Light by ID
- β Get all Lights
- β Get a Light's name
- β Get a Light's hex color
- β Get a Light's on/off state
- β Get whether a Light is reachable
- β Get a Light's type (e.g. Extended color light)
- β Get a Light's manufacurer, hardware model, and software version
- β Get a Light's (cross-Bridge) unique ID
- β Get Lights that were discovered in the last search for new Lights
- β Get a Luminaire Light's unique ID
- β Get a Light's effect state
- β Get a Light's alert state [1]
Groups
- β Get a Group by ID
- β Get all Groups
- β Get a Group's name
- β Get a Group's hex color
- β Get a Group's Lights
- β Get whether any or all Lights in a Group are on
- β Get a Group's Room class (e.g. Living room, Bedroom)
- β Get a Group's type (e.g. Room, Luminaire, LightGroup)
- β Get a Luminaire Group's hardware model
- β Get a Luminaire Group's unique ID
Schedules
- β Get a Schedule by ID
- β Get all Schedules
Scenes
- β Get a Scene by ID
- β Get all Scenes
Sensors
- β Get a Sensor by ID
- β Get all Sensors
- β Get Sensors that were discovered in the last search for new Sensors
Rules
- β Get a Rule by ID
- β Get all Rules
Configuration
- β Get the Bridge's configuration
Resourcelinks
- β Get a Resourcelink by ID
- β Get all Resourcelinks
Capabilities
- β Get the Bridge's Capabilities
Mutations
Lights
- β Set a Light's hex color
- β Turn a Light on or off
- β Smoothly transition from one state to another
- β Rename a Light
- β Search for new Lights
- β Delete Lights from the Bridge [2]
Groups
- β Set a Group's hex color
- β Turn a Group on or off
- β Smoothly transition from one state to another
- β Rename a Group
- β Set a Group's Lights
- β Set a Group's Room class (e.g. Living room, Bedroom)
- β Create a Group
- β Delete a Group
Schedules
- β Create a Schedule
- β Update a Schedule
- β Delete a Schedule
Scenes
- β Run a Scene
- β Create a Scene
- β Update a Scene
- β Delete a Scene
Sensors
- β Create a Sensor
- β Update a Sensor
- β Delete a Sensor
- β Search for new Sensors
Rules
- β Create a Rule
- β Update a Rule
- β Delete a Rule
Configuration
- β Update the Bridge's configuration
- β Create a user
- β Delete a user
Resourcelinks
- β Create a Resourcelink
- β Update a Resourcelink
- β Delete a Resourcelink
Notes
[1]: The alert state provided by the Hue API contains the last alert sent to the light and not its current state (i.e. whether an alert is active), so this isn't particularly useful.
[2]: Deleting lights can be messy and we haven't needed it, so we haven't added this yet.
Disclaimer
I'm not affiliated with Philips in any way. I'm just a guy on the internet playing with code β€οΈ