Automate home
Yet another home automation project because a smart light is more than just on or off.
Overview
When talking about home automation there are at least two goals you could have in mind:
- let a user interact with the home devices through many interfaces locally or remotely
- let devices interact together and let the system change their state
I believe the other home automation projects fits perfectly the first goal, this project focuses on automation, the second one.
What's the difference between this project model and other home automation projects?
The main difference is the design of an Appliance where, with the name Appliance, I refer to entities like a light, a curtain, a sound player ecc.
One of the simplest Appliances I could imagine is a light with two physical states: on and off.
A light model could be designed like a deterministic state machine; all the other home automation projects I know do it like that.
Or it could be designed like a non deterministic state machine; which is how it is done by this project.
When using a deterministic state machine if you have a light with on/off physical states its model states will be just on/off. When using a non-deterministic state machine it is quite simple to have more model states for an on/off light, as an example, your light could be in an alarmed state and it could start blinking.
Behavior-driven development
I believe logics are the building bricks of a smart home system. Nevertheless, they are complex to build, debug and share and one of this project goals is to make it easier.
Having an Appliance grouping together all its logics simplifies debug and reuse.
All Appliances inner states can be tested with BDD style tests like this.
BDD style tests make it quite easy to understand the behaviour of every Appliance in every possible state and thus make it shareable.
I like to think of this project as a way to share behavioural models for our smart devices more easily.
Documentation
For a deep dive into this project see the documentation.
For a minute guide to this project see the landing page.
Example projects
Using the docker image:
docker pull majamassarini/automate-home:latest