Homehub

Table of Contents

About

Summary

Homehub is an RPC layer for my personal life and personal services, built on top of the Matrix RPC system. Home automation appliances can publish messages on to a bus, and act on messages injected in to bus. Further, the Hub itself contains a rule-based injection system which can act on incoming messages and republish modified messages or new ones entirely. The rules engine has the ability to store small values in an embedded Key Value store bundled with the system.

homehub-topology.png

Use Cases

Keeping electricity costs down

We can build a nest-style thermostat by having our thermostat listen on the homehub bus. The user's mobile would send an event upon leaving work, which would trigger an event to set the thermostat to comfortable temperature levels. The user could also manually inject events in to the bus to change the thermostat if they were going on a long trip.

Sonos-style following music system

A DLNA renderer could inject messages containing a media stream URL in to the system which room sound systems could listen for and act on. In practice, this can be paired, via a ruleset to only play in the room that a user is in.

When users walk in to a room, a connected motion sensor can emit a message to set the current-room key to the new value, and the value store will emit a key change event on to the bus. This change event will cause the rules engine to emit mute and play messages to the appropriate connected devices again.

Movie lighting

When the DLNA renderer starts to play a movie, the house lighting can adjust accordingly. The DLNA renderer injects messages in to the bus when media is playing, and connected lights can dim themselves to ambient lighting for the length of the movie. When the media stops playing, another message will be emitted which the lights will act on to turn back on.

Personal Assistant

  • Send a message to the Personal Assistant to create org-mode capture entries
  • Send a message to the Personal Assistant to have it read AP headlines to you
  • Read my work agenda and inbox statistics to me when I get to the office

Self Hosted SMS infrastructure

  • Automatically read SMSs received when at home
  • Push IRC pings to SMS as notifications
  • SMS any matrix user
  • Get an SMS when there is presence at home and you're not

Core Ideas

Emitted and Ingested messages

At its core, there are two main types of messages, emitted and ingested messages. In order to keep the system as loosely coupled as possible, real-world actions should not be taken on emitted messages. The ruleset engine transforms the message and emits a new message, an ingested message which contains an actual action to be accomplished.


Intuitive Rulesets

Rules can be written in the simple form of "if <EMITTED> then <INGESTED>" style rules; these rules can be strung together and bundled in to rule groupings to create shareable modules. The UI for this will be easy an easy to use RESTful API and web interface built on top of it.

Code

Homehub is a part of the Complete Computing Environment

Author: Ryan Rix

Created: 2015-10-25 Sun 18:58

Validate XHTML 1.0