One of the challenges of building a great home automation system that does the right thing all the time without you needing
to tell it what to do is the problem of figuring out what state the house is in.
Some of the many possible states include:
Not occupied
Not occupied and the residents are out for the evening
Not occupied and the residents have gone on vacation
Occupied
Occupied but everyone is asleep
Occupied and there are dinner guests
Occupied and there is a party going on
Occupied and there are guests staying over
States might affect how long the heating stays on for, whether the driveway lights are left on or whether they go off once everyone is home.
In order to recognize the correct state a home automation system needs many different sensor inputs. My own home has over 200 sensors including door sensors, motion sensors, driveway sensors, under-floor strain-gauges and IR beams. It also uses WIFI-sniffing to detected the coming and going of mobile phones and other mobile devices that connect to WIFI.
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".
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.
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.
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.