Sitemap | Select Language: English - Nederlands - Français - Deutsch |
By bogaert
Ever thought on connecting your home to a cognitive system? I gave it a trial! Here a brief description on how I made it work. |
Within the house we have different protocols, being IEB for the house appliances, MiLight to control the colour of the lightning, a specific datalogger for the solar panels, Sonos for audio, and some IP cameras. My focus for this experiment was to connect in the first place with the EIB bus. The diagram bellows outlines how the connection is realised. |
On the home side: The EIB bus can be reached through an EIB/IP router. To build the connection I used a small ARM based linux box. On that box I downloaded, compiled, and installed the eibnetmux server (http://eibnetmux.sourceforge.net/) and the MQTT client (http://www.eclipse.org/paho/). The next step was to connect both. Therefore, I wrote a small program in C that does the following: - Reading of a configuration file, containing o MQTT credentials o EIB credentials o List of devices (eib addresses and the corresponding device names and parameters to be used) - Setup a connection to the eibnetmux server - Setup a connection to the MQTT client - Subscribe to the MQTT service of Bluemix - Listen to the eib bus and for each event write a message to the MQTT client - For every message received through MQTT analyse and create an event on the eib bus The small linux box is acting as a gateway device, so the connection with the Watson service requires a one-time setup for the gateway itself. Thereafter the devices added by the Internet of Things platform automatically at their first published event. |
On the backend side I used Bluemix, where I created a Node.js application and attached the Watson Internet of Things (IoT) Platform. In the IoT platform I created the gateway device and used the credentials on the house side. Below a screenshot of the populated devices in the IoT platform: |
Once the connection worked I could see the data coming into the NoSql database. I used the Watson IoT boards functionality to get a glimpse of the data coming in live. Below the standard usage overview board, shows the number of devices and the data usage of the system. On a second board I added the live temperatures coming from the outdoor temperature measurement and from the heat water system measurement. I also added to status indicators for the lights on the right hand side. |
The nice thing about using MQTT is the possibility to return message without the need to expose the gateway to the internet. As the MQTT client at the gateway subscribes to the MQTT server it will receive all messages published by the platform. I experimented with the service by using node.js to write an MQTT message that is received by the gateway and that contains an instruction to write to the eib bus. By doing so I am able to control for example the lights remotely without any opening in the DMZ at home. screenshot |
So, what's next? Maybe connect the solar plant and start doing some trend analysis on the data? |
- bogaert's blog
- Log in to post comments