The old Raspberry Pi system was initially designed to log the 12V off-grid system as well as house temperatures and mains electric usage.
As we removed the 12V off-grid system around 18 months ago the Raspberry Pi was only logging data from the Wireless Things temperature and environmental sensors and the 1-Wire sensors on the hot water system.
We wanted to be able to also store the data locally and it is accessible using different applications and so we had to either use a local database or another method of sharing and updating the sensor data. A lot of home automation systems now use MQTT to send and receive data and so we decided to use this and installed the Mosquitto open-source MQTT broker https://mosquitto.org/ on the Linux box.
We had a Wireless Things USB to Serial adapter which is mounted as a UART port on Linux and a USB 1-Wire adapter which we connected to our 1-Wire temperature sensors.
To access the 1-Wire sensors we installed OWFS which mounts the sensors in the file system.
Andrew has written a C application which accesses the various sensors and sends this to the MQTT broker.
Mains Energy and Gas Logging
The ESP8266 Mains Energy Monitor project was being uploaded to the reporting website every minute using a python script and cron job. The firmware on this was updated to also publish an MQTT message every 30 seconds to the MQTT broker with the gas and electric meter readings and the mains current usage.
Local Reporting using Home Assistant
For local network reporting, we installed Home Assistant on our Synology Diskstation using a Docker image and this allows all our computers, tablets and phones to view the data using an easy-to-use and updated interface.
The Home Assistant software also allowed us to add our Nest Smoke Alarms and Nest Thermostat data to the reporting pages. Nest do not have any API methods for accessing the thermostat hot water controls or settings which would have made automating the hot water controls much easier as we could have used the sensor data from the solar hot water system to set the times needed to heat the water based on the existing hot water tank temperature. Below are screenshots of the data reporting pages:
Overview / Home page
Downstairs sensors page
Upstairs sensors page
Loft sensors page
Outdoors sensors page
Heating and Hot Water sensors page
Nest Smoke Alarms page
For our online data logger website at http://home.briandorey.com/ Andrew wrote a new python script which has two timers to subscribe to the MQTT broker and upload at different intervals for the mains and gas logger every minute and the temperature sensors and environmental sensors every five minutes.
The source code for the new software and Home Assistant config is available on GitHub at https://github.com/briandorey/MQTT-HomeAssistant