Uncategorized

Open energy monitor home Automation Hub with MQTT, nodeRED, OpenHAB & LightwaveRF

At the fully Charged live event at Silverstone earlier this month we stopped by the open energy monitor mean a chat with Glyn Hudson (check out the NIEVO video below for a taste of the show).

Glyn’s smart home configuration is based around the emonPi and employs MQTT, nodeRED, OpenHAB, LightwaveRF and Google Home.

Over to Glyn for all the good stuff…

I believe automation can play an useful role in assisting to reduce energy consumption. For example being able to control my home central heating system remotely enables me to only turn on the heating when it’s required and not have it running on a set schedule when the house is empty.

As previously mentioned in a blog post, the emonPi (running emonSD pre-built SD card) can function as a powerful home automation hub. Utilising the emonPi as a home automation hub is a good fit for a number of reasons:

It’s already running 24/7 for energy monitoring

It’s optimised for robust long term operation: the root Raspberry Pi file-system is read-only to increase SD card lifespan

It’s already connected to your local network

It’s running Debian Raspbian Jessie therefore installing extra bundles is easy and lots of support is available

Raspberry Pi 3 has plenty of space capacity

Extra radios / accessories can be connected via USB

It’s already running an MQTT server

emonSD pre-built SD card comes pre packed with the following integrations nodeRED, OpenHAB and LightWaveRF

In this post I want to share with you how I use the emonPi in my own home.

Here is a video demo using Google home to control my central heating and gadgets via MQTT:

Read on to learn how this is achieved using an emonPi and open-source software…

There are many many options when it comes to home automation and control. Where possible I prefer open-source solutions which do not depend on any third-party services. All the software services for my home system as I describe in this post runs locally on my emonPi and apart from Google home voice integration does not require an Internet connection to function. A self-hosted open-source solution has the added benefit of increased privacy and security which you are in fully in control of.

MQTT

MQTT lightweight communication protocol is used as the ‘glue’ communication layer between all the following services. See technical/MQTT section of the user guide for more info about how MQTT works on the emonPi.

Energy Monitoring

Emoncms…obviously!

Recently I have been loving using the V2 Emoncms Android app (currently in beta) which supports multiple pages (see forum thread).

Video demo Emoncms Android app V2 beta:

I have also recently enjoyed using the redesigned Emoncms apps module which have just bee released on Emoncms.org. It’s now possible to have more than one MyElectric or MySolarPV ‘app’ per Emoncms account and economy 7 split time of use tariffs are now supported (see forum thread):

Control

Încălzire centrală

To control my gas central heating boiler I use an MQTT WiFi relay which also has a developed in thermostat and scheduler, although I don’t use these features, I just control directly via MQTT. The WiFi Relay has been very reliable, it’s been used daily for the past two years in my home and never once required a reboot.

Plug sockets (lights)

I use LightWave RF plugs to which I have lights and other entertainment gadgets connected e.g. stereo and chromecast. being able to switch a whole plug bank on/off has the advantage of being able to turn gadgets fully off when not in use to minimise any vampire drain.

The emonPi can control LightWave RF gadgets directly via MQTT if an RF OOk modules is fitted. See LightWave RF emonPi user Guide.

LightWave RF gadgets are not perfect, the OOK RF protocol is simplistic, unsecure, occasionally unreliable and state feedback is not available. I am considering swithcing to ESp8266 based Sonoff plug with third party MQTT firmware or EmonESP firmware.

Interface

For the past few years I have been using OpenHAB as the control interface. OpenHAB is pre-loaded onto the emonPi emonSD pre-built image. I am yet to upgrade to OpenHAB V2.0, it looks very nice. However, V1.8 has been very reputable and fits my needs. I use the OpenHAB Android app to access the interface quickly from my phone:

OpenHAB also integrates with my Pebble smartwatch which makes it super easy to turn on/off the heating while out and about:

A while back (early 2016) I dabbled with HomeAssistant, (see blog post). I was quite impressed, I have been following the project and it looks like it’s matured to be an excellent home automation platform. quit possibly a rival to OpenHAB.

Another option for an interface is NodeRED dashboard which is now officially part of the NodeRED project.

The beauty of MQTT is that it’s platform agnostic, it’s possible to have many different interfaces controlling the same control nodes.

Interfață vocală

I’ve recentlyA achiziționat un difuzor declanșat Google Home Voice, cu puțin ajutor de la Ha-Bridge pentru a imita un Bridge Hue Philips, este destul de ușor să obții Google Home pentru a controla gadgeturile locale prin MQTT. Aceeași configurație va funcționa și cu Amazon Echo. Consultați Ghidul de configurare HA-Bridge pentru EMONPI.

Vedeți demo -ul video în partea de sus a acestei postări.

Config Dispozitiv folosind GUI HA-Bridge Pagina Web:

Configurarea aplicației Google Home:

Integrare și automatizare

Folosesc Nodered, care este preîncărcat pe emonpi / emonsd pentru a se integra cu alte servicii, astfel încât să obții cea mai recentă temperatură în aer liber de la Weather Underground, să trimit notificări push (încălzire / oprire a temperaturii) la telefonul meu folosind Pushover. Ambele servicii au fluxuri nodate pre-fabricate, ceea ce face integrarea foarte ușoară. Nodered este preinstalat și configurat pe emonpi / emonsd. Fluxul de exemplu inclus pe EMONPI demonstrează citirea datelor Emonth din MQTT și datele de temperatură externă din metrou subteran.

De asemenea, am un flux nodul care se ocupă de a opri încălzirea atunci când temperatura din camera de zi (așa cum este determinată de Emonth) ajunge la un punct stabilit. Aș fi putut folosi controlerul de termostat de pe releul WiFi pentru a face acest lucru, cu toate acestea, ar fi dificil în casa mea să rulez senzorul de temperatură cu fir de la releul WiFi la camera de zi, de aceea folosesc în schimb o temperatură emonth wireless.

Securitate și acces la distanță

Telecomanda (din afara rețelei locale) poate fi obținută folosind un serviciu DNS dinamic, cum ar fi DuckDNS sau VPN securizat pentru a oferi acces la servicii din exterior. De exemplu, deschid portul 8080 pentru a oferi acces la OpenHab care rulează pe emonpi -ul meu de pe internet. OpenHab are autentificarea pornită și HTTPS poate fi utilizat pentru a crea o conexiune sigură.

În mod alternativ, și, eventual, o soluție mai bună ar putea fi utilizarea serviciului MyopenHab.org pentru a permite telecomanda fără a fi nevoie să deschideți un port extern.

Asistentul de acasă a obținut un exemplu de utilizare a serviciilor Tor Onion pentru a accesa asistentul de acasă care funcționează la nivel local.

Vizitați OpenEnergyMonitor.org

Reprodus din postarea originală pe blog cu permisiunea lui Glyn Hudson.

Imparte asta:
Facebook
Stare de nervozitate
Reddit
LinkedIn
Pinterest
E-mail
Mai mult

WhatsApp
Imprimare

Skype
Tumblr

Telegramă
Buzunar