Lorenzo via Pexels
Editor's picks Self Hosting Smart Home

Monitor your Smart Home to improve reliability

Implement Automated Analysis and Alerting

System monitoring involves not only measuring and recording metrics but also doing some automated analysis to detect anomalies and create alerts when an action is required.

Pretty graphs and animated icons aside… even the flashiest dashboards get boring on day 3, especially when anomalies are few and far between. Do you really expect to monitor those graphs long-term? How much do you trust yourself to pay close attention and pick up on anomalies when things do fail?


Advertisement Begins

Advertisement End


I’d much rather have a computer do this analysis and alert me with precise, actionable notifications that already contain all the information required to begin further analysis. Introducing…

Alerta – System Monitoring Dashboard

I implemented the system dashboard called Alerta which uses a push approach to monitoring. Rather than pinging devices individually from a central server, Alerta relies on each device checking in periodically with a heartbeat request.

Alerta Heartbeat Dashboard
Alerta Heartbeat Dashboard

This heartbeat is a simple message saying “Hey I’m still here and operating normally”. If a heartbeat is missed, Alerta automatically generates an alert to indicate a problem with the device. For example, when my security light operates normally, it sends periodic heartbeats to Alerta. Of course, this is only possible when it is operating normally and connected to Wifi. If there is any Wifi issue it is unable to send the heartbeat message. Alerta reacts to this by raising an alert. Should the device start working again, the alert is automatically removed as manual intervention is no longer required.

You can see a sample alert in the images below.

Heartbeat monitoring for Tasmota devices


Kitchen Multi-Timer Pro

Now you’re cooking

Multi Timer Pro is your ultimate meal prep companion, keeping track of multiple cooking times and making adjustments on the fly. Give it a try today and become a better home cook!

Get it on Google Play


My lights run on Tasmota – a popular IoT firmware that hardly needs introduction in the home automation community. Unfortunately, Tasmota is not capable to sending HTTP heartbeat requests itself because it is built on a comprehensive MQTT API. As a workaround, I created a small service called <a href="https://github.com/danobot/alerta-mqtt-gateway" target="_blank" rel="noreferrer noopener">alerta-mqtt-gateway</a> that listens to specific MQTT topics and relays a heartbeat to Alerta every time a message is received.

The following is an extract from my configuration file. It monitors a Tasmota device on tele/tv_led/STATE and two RF devices transmitting on home/gw/433toMQTT.

topics:
  tele/tv_led/STATE:
    origin: tv_led
    timeout: 130

  home/gw/433toMQTT:
    type: json
    attribute: value
    listeners:
      - value: 2678906
        heartbeat:
          origin: mtn-living-room
          timeout: 604800
          tags: 
            - motion
      - value: 13690522
        heartbeat:
          origin: mtn-living-room-secondary
          timeout: 604800
          tags: 
            - motion

Note that you might have to adjust your Tasmota device’s TelePeriod setting to send status information more frequently. The timeout value indicates how long Alerta should wait for the next heartbeat before raising an alert.

On the next page, we talk about Home Assistant and Lovelace integration.

Continue your adventure here

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

DON’T MISS OUT!
Subscribe To Newsletter
Be the first to get latest updates and exclusive content straight to your email inbox.
Stay Updated
Give it a try, you can unsubscribe anytime.
close-link