This is a GraphQL based abstraction layered over the current REST API for smartThings. It also provides the basis for both service and application augmentation
The core external dependancy on this project is Serverless. This does require some setup to connect to your AWS. The best place to start is here. If you are new to serverless then I would advise you also run through a quick tutorial such as this one
npm install .
This will install all the other dependencies and configure the project to run commands
The following command will run the GraphQL API locally on Port 3000.
npm start
The following command will deploy the GraphQL API to AWS based on your configuration.
npm run deploy
The following command will run the unit and integration tests
npm test
The following command will run all the integration tests. Integration tests will test the GraphQl protocol the same way a client or user would via GraphiQL
npm run test:integration
There are multiple deployment options for Homegraph. All of them require the addition of configuration. Configuration can be supplied via .env
file. Which should contain the following keys
SMARTTHINGS_TOKEN=<Your smartThing access token>
FINHUB_KEY=<Finhub.com api key> _this is optional_
CLIMACELL_API=<climacell.com api key> _this is optional_
WTW_API=<what three words api key> _this is optional_
There are three main deployment models
- AWS serverless component (default as described above)
- Standalone Server (see ./integration/server)
- NPM | Yarn package
This provides maximum flexibility for use of Homegraph
=======
Query to get all Locations for account |
Demonstrating the extension of SmartThings via services |