In my previous post about GreenGoose I
described my initial experiences with this "Internet Of Things in a box"
product. Recently I've been trying their API and have integrated it into
my Home Automation System.
Click image to see it all.
The initial integration was easy, I used the new ASP.NET WebApi Core
Libraries (from Nuget) together with Newtonsoft Json.Net. GreenGoose's
datetime format is somewhat quirky but hopefully they'll move to a more
standard one soon. They are, however, also about to switch to OAuth so
it's going to require some more work when that happens.
Aside from a few simple WebAPI calls and some Json parsing the rest was
just a matter of connecting up the appropriate TimeSeries classes that I
use to track values that vary over time, declaring a few graphs, and
deciding what to log. With that in place I can now spin up a home
automation 'sensor' corresponding to any GreenGoose sensor Id and my
home automation system will add all of the relevant graphs and charts,
triggers and more for that device.
What's interesting is that a single sensor potentially serves a couple
of different purposes. The dog collar sensor for example polls regularly
back to the base station so it can potentially be used to sense both how
much exercise the dog has had but also simply whether the dog is at home
or not which could be really handy for anyone with a dog that's learned
to ignore the invisible fence! Each sensor can, through the TimeSeries
objects also offer additional data and triggers that can be used
elsewhere in the home, for example, an alert if the dog was walked less
than half and hour each day.
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.