GraphQL, but for your lights
Because GraphQL is amazing and so is home automation and I'm not choosing between them you can't make me.
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 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 start
- ✅ 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]
- ✅ 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
- ❌ Get a Schedule by ID
- ❌ Get all Schedules
- ❌ Get a Scene by ID
- ❌ Get all Scenes
- ❌ Get a Sensor by ID
- ❌ Get all Sensors
- ❌ Get Sensors that were discovered in the last search for new Sensors
- ❌ Get a Rule by ID
- ❌ Get all Rules
- ❌ Get the Bridge's configuration
- ❌ Get a Resourcelink by ID
- ❌ Get all Resourcelinks
- ❌ Get the Bridge's Capabilities
- ✅ 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]
- ✅ 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
- ❌ Create a Schedule
- ❌ Update a Schedule
- ❌ Delete a Schedule
- ❌ Run a Scene
- ❌ Create a Scene
- ❌ Update a Scene
- ❌ Delete a Scene
- ❌ Create a Sensor
- ❌ Update a Sensor
- ❌ Delete a Sensor
- ❌ Search for new Sensors
- ❌ Create a Rule
- ❌ Update a Rule
- ❌ Delete a Rule
- ❌ Update the Bridge's configuration
- ❌ Create a user
- ❌ Delete a user
- ❌ Create a Resourcelink
- ❌ Update a Resourcelink
- ❌ Delete a Resourcelink
[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.
I'm not affiliated with Philips in any way. I'm just a guy on the internet playing with code ❤️