Originally my home automation system was constructed as a tree: The
house contains Floors, Floors contain Rooms, Rooms contain lights and
sensors. That worked quite well for a number of years but there was
always the issue of doors. Which room is a door in? An easy answer was
to put it in both rooms, but now collections of doors like 'Interior
Doors' had two copies of every door, whenever one door closed another
one closed too!
Since then I've been migrating to a directed graph instead of a tree.
The sole relationship used in the tree (representing 'contains') is
being replaced with a variety of relationships like 'connected to',
'open to', 'audible from', 'visible from', 'above', 'below', ... that
can express more interesting facts about the house.
This complicates the display of the house in the web view. Instead of
traversing a tree it needs to perform a breadth-first search of the
graph level-by-level using some relationship types but not others. It
also complicates navigation as the breadcrumb bar needs to represent the
shortest path back up the tree, not necessarily the one you followed to
get here.
At this point I didn't have a way to visualize the graph, but recently I
connected the graph up to an API and added another page to the
Angular.js application for the house. This new page uses d3.js and
webcola to render a force-directed graph layout. You can see some of the
results here.
As you can see the system is fairly complex. Currently this graph is
showing both physical devices and logical devices. I plan to add an
option to show just one or the other.
I've been working on home automation for over 15 years and I'm close to achieving my goal which is a house that understands where everyone is at all times, can predict where you are going next and can control lighting, heating and other systems without you having to do or say anything. That's a true "smart home".
Digital Twin are an online representation of a real world object, a copy of its properties in the digital world and a way to send updated and commands to it. In effect I've been making them for years but now they have a trendy name.
An overview of the many sensors I've experimented with for home automation including my favorite under-floor strain gauge, through all the usual PIR, beam and contact sensors to some more esoteric devices like an 8x8 thermal camera.
Why automated learning is hard for a smart home. The perils of over-fitting, under-fitting and how the general unpredictable nature of life makes it hard to build a system that learns your behavior.
One way to reduce the volume of sensor data is to remove redundant points. In a system with timestamped data recorded on an irregular interval we can achieve this by removing co-linear points.
Home automation systems need to respond to events in the real world. Sometimes it's an analog value, sometimes it's binary, rarely is it clean and not susceptible to problems. Let's discuss some of the ways to convert these inputs into actions.
Another super useful function for handling sensor data and converting to probabilities is the logistic function 1/(1+e^-x). Using this you can easily map values onto a 0.0-1.0 probability range.
In a home automation system we often want to convert a measurement into a probability. The ATAN curve is one of my favorite curves for this as it's easy to map overything onto a 0.0-1.0 range.
Several years ago we did a major remodel. I did all of the finish electrical myself and supervised all of the rough-in electrical. I also put in all of the electrical system and water in our barn. I have opinions ...
An if-this-then-that style rules machine is insufficient for lighting control. This state machine accomplishes 90% of the correct behavior for a light that is controlled automatically and manually in a home automation system.