I was trying to build integrations between Homebridge and Alexa, but I couldn't find anything about Homebridge API, to get accessories & listen to statuses change. So I decided to build my own.
Homebridge API is based on GraphQL spec, currently it supports:
npm i -g homebridge-api
{
"bridge": {
...
},
"api": {
"port": 18110,
"token": "TOP-SECRET-LOL",
"introspection": true,
"playground": true
}
}
Where:
port
GraphQL server porttoken
Token to access the GraphQLintrospection
Enable GraphQL introspection (should disable it for public)playground
Enable GraphQL playground (should disable it for public)Don't forget to set header
Authorization: YOUR-ACCESS-TOKEN-HERE
accessories {
aid
services {
type
characteristics {
iid
type
value
}
}
}
query {
characteristic(aid: "21", iid: "10")
{
value
}
}
subscription {
characteristicChanged(aid: "21", iid: "10")
{
value
}
}