Little home automation (since the very fancy project name) to turn on/off several appliances I've in my home.
Some examples include HTPC, AVR, TV, lights.
Each appliance has a subclass of
Appliance class that permits status change via dedicated methods and emits events on status change.
Expanding is easily, it's just a matter of a subclass!
Appliance interaction is handled via a natural language API available on
curl -X POST \ -H "Content-Type: application/x-www-form-urlencoded" \ -d 'token=[TOKEN]&text=home turn tv off and radio on&trigger_word=home' \ "http://localhost:3000/api/natural"
tokenis a (secret) token to check request validity
textis the natural language sentence
trigger_wordis the (optional) word that triggered recognition and message. It'll be removed from
As you can see, multiple appliances and statuses are present in the same sentence allowing to control multiple appliances with a single message. Possibilities are:
- One appliance and one status: changes selected appliance status
- Multiple appliances and one status: changes status of all appliances
- Multiple appliances and as many statuses: changes status of respective appliance
Slack integration is very deep and allows two-way communication with your home appliances (each of them have a customizable icon).
Message format is fully compatible with Outgoing Webhook so it's very easy to use the exposed HTTP endpoint with Slack and have a bot in no time.
As bonus, endpoint answer is in the Slack accepted format so your bot will answer you!
How do I get set up?
You've several way to get homeautomation running:
You can use
Create a constants file (just the first time)
Create and start the container
docker-compose up -d.
npm i --production
homeautomation will be available on port