Smart Home Query Interface

Whilst looking at the publishing of our home automation software, we realised that we need to spend some more time optimising the code and providing a means to test and diagnose problems. This led to the realisation that we needed an interface to query all aspects of our HCS in real-time, to see how well it was working.

After some initial coding and testing, we realised that this interface could be used to expose everything to the outside and to then make our smart home part of the Internet of Things. This is achieved using technology abstraction, to make the interface both human and machine readable.

We are also looking at other exposure methods (interfaces) such as Constrained Application Protocol(CoAP) and Constrained RESTful Environments (CoRE).

Identity & Trust

We are currently doing a lot of work looking at security and trust models for the Internet of Things.

The smarter our home becomes, the more the data flows and interactions with it start to look like those that occur between people. The personal security and trust models that people use on the Internet start to look more and more relevant too.

Our smart home already has many of the identities that people use (such as a Google ID) and we can already communicate with it using trusted relationships and Google Hangouts. Our XMPP interface allows a natural language (English) interfaction with it now.

Implementation

Our core Home Control System (HCS) process accepts structured messages in the form of events, so we have extended this to support a new event type:
Query,<zone>,<object>,<attribute>

Home Control System

The Home Control System (HCS) can be queried with the zone set to 'HCS'. All aspects of our HCS are exposed as objects, with both human and machine understandable names. The current list of objects exposed are:

Alarm
Alarm status (On or Off).
Average Thread Time
Average time a thread has taken to complete in the current day.
Cooling
Cooling status (On or Off).
Controller Count
Number of controllers.
Database Disk Reads
Number of database disk reads in the current day.
Database Disk Writes
Number of database disk writes in the current day.
Database Reads
Number of database reads in the current day.
Database Writes
Number of database writes in the current day.
Devices Count
Number of devices in zone. House zone is all internal devices. Global zone includes external devices.
Heating
Heating status (On or Off).
Hot Water
Hot Water status (On or Off).
House
Manual house status set (e.g. In, Out, Away or Auto).
Notify
Notifications status (On or Off).
Number Zones
Number of zones in operation.
Last Dawn
Time of last detected dawn event.
Last Dusk
Time of last detected dusk event.
Last Sunrise
Time of last detected sunrise event.
Last Sunset
Time of last detected sunset event.
Maximum Thread Time
Longest time a thread has taken to complete in the current day.
Minimum Thread Time
Shortest time a thread has taken to complete in the current day.
Occupancy Event Count
Number of occupancy events (updates) so in the current day.
Presence Event Count
Number of presence events (updates) so in the current day.
Sensors Count
Number of sensors in zone. House zone is all internal sensors. Global zone includes external sensors.
Status
Actual house status being used (when house status is set to Auto this is determined by occupancy and presence).
Temperature Rate Maximum
Maximum temperature rate rise seen (°C per second). This is not reset and is part of an on-going project to use all of the temperature sensors to detect fires and calibrate them.
Thread Count
Number of threads created to handle incoming events in the current day.
Twilight
Current state of twilight sensor (Dawn or Dusk).
Zone Count
Number of zones, including House and Global zones.

Zones

Each named zone can be queried and the status of any object (sensor or device) within it also.

Number Devices
Number of devices in this zone.
Number Sensors
Number of devices in this zone.

Device

Each device can be queried and all attributes too.

Duration
The time this device has been in its current state, in the form '12d 7h 34m 12s'.
Last On
The date and time this device was last on, in the form '18:54:09 12/09/2013'.
Last Off
The date and time this device was last off, in the form '18:54:09 12/09/2013'.
Status
The current status (e.g. On, Off, etc.).
Timer
The system timer for when it last changed state. This is is used to calculate the duration.
Type
The type of this device (Binary, Variable, etc.).

Sensor

Each sensor can be queried and all attributes too.

Status
The current status (e.g. Open, Closed, etc.).
Timer
The system timer for when it last changed state.
Type
The type of this sensor (Contact, Humidity, PIR, Temperature, etc.).

Examples

Query,Bathroom,Bathroom Humidity,Status

Summary

We have built the query into our HCS process and it supports the passing of queries down through child classes. We are currently populating the methods in these sub-classes, so that an in-bound query addressed to any and every object and attribute can be responded to.

We have written a test process to send queries in to the main HCS process.

Share ...
We are on ...
Facebook Twitter
YouTube Flickr Follow us on Pinterest