Ep 1: Home Automation System Architecture

Discussion of the online video show SuperHouseTV, where Freetronics co-founder Jonathan Oxer hacks on his house using various Open Source hardware and software. [SuperHouseTV site]
User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 297
Joined: Sat Oct 15, 2011 11:31 am

Re: Ep 1: Home Automation System Architecture

Post by jonoxer » Thu Apr 26, 2012 4:05 am

Hi @mlinnen, interesting comments about using Azure. Personally I wouldn't tie myself to infrastructure that relies 100% on an Internet connection (or, indeed, any services beyond my direct control) to be operational so I agree that would be problematic.

As you say though there are benefits to using those sorts of services, so the trick is getting those benefits without making them a point of failure.

The way Andy (@geekscape) and I are approaching that is using local MQTT servers as the primary point of reference, but "federating" the servers across multiple locations. The ultimate plan is to have:

* Multiple MQTT servers running in the local environment with automatic failover, providing a reliable low-latency messaging system.

* Federation between local and remote MQTT servers, providing exposure of a restricted set of data outside the local environment.

* Segmented access control access the federation infrastructure.

We already have MQTT servers running at our own houses, plus an external MQTT server on a VM running at a hosting provider in the US. We've already achieved federation across multiple MQTT servers, including the application of filters: for example, I can publish temperature sensor data once per second to a topic on my local MQTT server, while having that topic shared to a remote MQTT server but only updated once per minute. The device publishing the sensor data doesn't need to know about that: it simply publishes to the local MQTT server as fast as it wants to, and the filter in the federation mechanism takes care of rate limiting the updates published to the remote server. The result is low latency updates locally where it matters, without blasting out unnecessary data remotely while still getting the benefit of making that data available outside my local system.

There's a whole lot of interesting stuff going on that I'll cover in more detail in a future episode, and of course there's lots still to figure out.
--
Jon

mlinnen
Posts: 3
Joined: Tue Apr 24, 2012 1:09 am

Re: Ep 1: Home Automation System Architecture

Post by mlinnen » Thu May 03, 2012 3:33 am

Sounds a killer future episode on fault tolerant messaging is in the works :)

I do have my current Azure message bus only acting as a remote connection to my house and it also provides some non mission critical services that enhance my home automation. Basically the internal home does not require Azure Service Bus unless you want to connect to it remotely or have a cloud service that wants to send messages to a device in the home. That way mission critical operations can continue to work if I loose internet connectivity.

I have a couple blog posts on the project. It is really just in the beginning stages and is no where as far along as you are.

http://www.protosystem.net/post/2011/07 ... art-1.aspx
http://www.protosystem.net/post/2011/08 ... art-2.aspx
http://www.protosystem.net/post/2011/09 ... art-3.aspx

I like your idea of applying filtering of messages so that the outbound chatter is kept to a minimum but yet it is still useful.

chmanoj4u
Posts: 2
Joined: Sun Sep 23, 2012 4:42 pm

Re: Ep 1: Home Automation System Architecture

Post by chmanoj4u » Sun Sep 23, 2012 4:49 pm

I am a newbie and very much interested in home automation. The introductory video was very helpful in understanding the proposed architecture. I just got a couple design questions:

[*] Can the circuit be designed without removing the current switches. ( As the switches are already installed and would act redundant)

[*] On using the MQTT, can we still provide a web based interface for the communication

Thanks.

-Regards,
Manoj

User avatar
geekscape
Posts: 7
Joined: Tue Nov 01, 2011 4:58 pm
Location: Melbourne, Australia
Contact:

Re: Ep 1: Home Automation System Architecture

Post by geekscape » Sun Sep 23, 2012 5:04 pm

hi Manoj,

> [*] Can the circuit be designed without removing the current switches.
> ( As the switches are already installed and would act redundant)

Probably, but you'd need to leave the current switches "on" for the automation to function.

More detail would be required to provide a definitive answer.

> [*] On using the MQTT, can we still provide a web based interface for the communication

Yes. There are several web browser interfaces to MQTT being developed using JavaScript and web sockets. You should be able to find them using Google and checking them out.

chmanoj4u
Posts: 2
Joined: Sun Sep 23, 2012 4:42 pm

Re: Ep 1: Home Automation System Architecture

Post by chmanoj4u » Mon Sep 24, 2012 4:13 am

Hello Andy

Thanks for the reply.

My main objective is to access the electric appliances from my phone or tablet. I don't want to change the existing switches.

I am thinking of a circuit like two way switch but not sure if that could be implemented.

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 297
Joined: Sat Oct 15, 2011 11:31 am

Re: Ep 1: Home Automation System Architecture

Post by jonoxer » Mon Sep 24, 2012 4:13 am

chmanoj4u wrote:On using the MQTT, can we still provide a web based interface for the communication
As Andy mentioned, there are various MQTT clients that are web-based. There are also libraries and toolkits that you can use to create your own glue: I happen to use PHP a lot, so I have a couple of scripts that use the PHP-MQTT library to connect to my MQTT server. For example, I have a web interface served up that allows events to be published to MQTT when a button is clicked, and I have another script that subscribes to MQTT topics and then calls out to other systems using HTTP (acting as a web client, basically) when it sees certain events.
--
Jon

ahuxtable
Posts: 1
Joined: Sat Dec 22, 2012 7:18 am

Re: Ep 1: Home Automation System Architecture

Post by ahuxtable » Sat Dec 22, 2012 7:30 am

Jon, I'm really interested in what you're doing behind the scenes for the web interface. I am basing my system on a non-central wiring setup with relays and Arduinos mounted at the switch panel and I am using MQTT protocol.

I am designing all the lights to have 'standard' ability without the need of a server (in case of some sort of system failure) in that it should be able to control each relay directly but publish the status via MQTT and also subscribe to 'itself' so it can be remotely controlled. This is where i have a problem in that any web interface does not really know the state of any of the relays but i'm assuming that i should be able to use the 'retained' flag on the MQTT publish to be able to get the state from the broker.

Sort of thinking out loud here but my theory was something along the lines of having a regular refresh (via ajax or similar) of the switch status and then have it to be able to publish the status too. Have you done any work on this?

Great work BTW - Very inspiring!

matbor
Posts: 8
Joined: Fri Jul 13, 2012 2:11 am

Re: Ep 1: Home Automation System Architecture

Post by matbor » Tue Jun 04, 2013 12:45 pm

@ahuxtable

How did you go with the setup of your web interface status? Having similar issues atm.

Bordwalk2000
Posts: 4
Joined: Tue Oct 06, 2015 3:47 pm

Re: Ep 1: Home Automation System Architecture

Post by Bordwalk2000 » Tue Oct 06, 2015 3:57 pm

I really hope you do a follow up video on your Home Automation Architecture. I would love to see a video showing explaining about your multiple MQTT servers on your LAN and how you set up your federation to publish data to a remote MQTT Servers on a hosting provider.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest