Skip to content

A collection of python scripts that form a monitoring system using a publish/subscribe pattern.

Notifications You must be signed in to change notification settings

jvangorp/home-monitor

Repository files navigation

home-monitor

This repository contains a collection of small scripts that form a monitoring system using a publish/subscribe pattern. This approach is used to receive data streamed by an Eagle gateway (built by Rainforest Automation) and push the data into a message queue for consumption by separate scripts.

Figure 1 shows how the components of this monitoring system fit together. The Eagle gateway polls (via ZigBee link) the BC Hydro meter monitoring my home electrical service and pushes XML fragments containing data via HTTP POST. The eagle-endpoint.py script (built with Flask) receives the XML fragments and pushes them into a RabbitMQ publish/subscribe queue. Other Python scripts (such as demand2bidgely.py) receive the XML fragments from the queue, parse out data of interest and push that data into other services (such as Bidgely, dweet and EmonCMS). Check out the links below for two services that make power data from my home publicly available:

Figure 1: Monitoring system

Figure 1: Monitoring system components.

An overview of the publish/subscribe structure set up with RabbitMQ is shown in Figure 2. A producer application publishes messages to an exchange which feeds all received messages into multiple queues (one for each consumer). RabbitMQ provides a simple mechanism for new consumers to subscribe to an exchange, passing back the name of the queue for that consumer to use. The Python implementation used here closely follows the Python publish/subscribe tutorial posted on the RabbitMQ web site. The eagle-endpoint.py script receives XML fragments from the Eagle gateway and publishes them to an exchange, and consumer scripts subscribe to the exchange to receive these fragments and process them.

Figure 2: Publish/subscribe exchange with queues

Figure 2: Publish/subscribe message queue.

Additional details about the XML fragments generated by the Eagle gateway can be found in the Eagle Uploader API document in the docs folder.

About

A collection of python scripts that form a monitoring system using a publish/subscribe pattern.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages