tutorial

Uptime monitoring for Domoticz home automation system

Domoticz is a lightweight home automation controller that manages everything from temperature sensors and motion detectors to smart plugs and energy meters. ...

Domoticz is a lightweight home automation controller that manages everything from temperature sensors and motion detectors to smart plugs and energy meters. It runs on hardware as small as a Raspberry Pi, serving as the always-on brain of your home. When Domoticz goes offline — because of a power glitch, SD card failure, network issue, or process crash — your automations stop, your sensors go dark, and any security monitoring it feeds falls silent.

This tutorial covers production-grade uptime monitoring for Domoticz using Vigilmon. We will walk through:

  • Monitoring the Domoticz JSON API health endpoint
  • Monitoring the Domoticz web interface
  • SSL certificate monitoring for remote access
  • Webhook alerts for DOWN/UP events
  • Docker and Raspberry Pi deployment considerations

Prerequisites

  • Domoticz running on Linux, Raspberry Pi, or Docker (stable or beta release)
  • A free account at vigilmon.online

Part 1: Identify the Domoticz health endpoint

Domoticz exposes a JSON API on its built-in web server. The /json.htm?type=command&param=getversion endpoint returns version information and is a reliable liveness probe.

Default ports

| Access type | URL | |-------------|-----| | HTTP | http://domoticz-host:8080/json.htm?type=command&param=getversion | | HTTPS | https://domoticz-host:443/json.htm?type=command&param=getversion |

Verify the endpoint

curl -s "http://localhost:8080/json.htm?type=command&param=getversion"

Expected response:

{
  "status": "OK",
  "title": "GetVersion",
  "version": "2024.7",
  "hash": "ab12cd34",
  "build_time": "2024-07-01 09:12:34"
}

The field "status": "OK" is the key signal. If Domoticz is running and healthy, it always returns this field. If the process is hung or the database is locked, the endpoint times out or returns an error.

Simpler endpoint: server ping

Domoticz also responds to a lightweight ping at the root:

curl -I http://localhost:8080/

A 200 or 302 response (redirect to the login page) confirms the built-in web server is alive.


Part 2: Configure remote access

If Vigilmon needs to reach Domoticz from outside your LAN, expose it via a reverse proxy. Do not expose the Domoticz port directly to the internet — the built-in server lacks rate limiting and TLS support.

nginx reverse proxy

# /etc/nginx/sites-available/domoticz
server {
    listen 443 ssl;
    server_name domoticz.example.com;

    ssl_certificate /etc/letsencrypt/live/domoticz.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/domoticz.example.com/privkey.pem;

    # Allow the health endpoint without auth
    location /json.htm {
        # Optional: restrict to Vigilmon IPs
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
    }

    # Require auth for the UI
    location / {
        auth_basic "Domoticz";
        auth_basic_user_file /etc/nginx/.htpasswd;
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

This exposes the /json.htm health endpoint publicly while keeping the UI behind basic auth.


Part 3: Set up HTTP monitoring in Vigilmon

Monitor the Domoticz API

  1. Log in to vigilmon.online and click Add Monitor.
  2. Choose HTTP(S) monitor.
  3. Enter: https://domoticz.example.com/json.htm?type=command&param=getversion
  4. Set interval to 1 minute.
  5. Add a keyword check: must contain "status":"OK".
  6. Add your alert channel.
  7. Click Save.

The keyword check distinguishes a real Domoticz response from a proxy error page that still returns HTTP 200.

Monitor the Domoticz web UI

Add a second monitor for the web interface:

  1. Click Add MonitorHTTP(S) monitor.
  2. Enter: https://domoticz.example.com/
  3. Set interval to 2 minutes.
  4. Add a keyword check: must contain Domoticz.
  5. Click Save.

| Monitor | URL | Check | |---------|-----|-------| | Domoticz API | .../json.htm?type=command&param=getversion | keyword: "status":"OK" | | Domoticz UI | https://domoticz.example.com/ | keyword: Domoticz |


Part 4: SSL certificate monitoring

If you expose Domoticz via Let's Encrypt, certificate renewal can fail silently. Add an SSL monitor so you get alerted before the certificate expires:

  1. In Vigilmon, click Add Monitor.
  2. Choose SSL monitor.
  3. Enter your domain: domoticz.example.com
  4. Set alert threshold to 14 days before expiry.
  5. Add your alert channel.

If you also expose Domoticz via a dynamic DNS service (e.g., DuckDNS), add an SSL monitor for that hostname too.


Part 5: Webhook alerts

Vigilmon sends a webhook payload on every DOWN and UP transition. Add a receiver to your infrastructure:

// webhook-receiver.ts
import express from 'express';

const app = express();
app.use(express.json());

app.post('/webhook/vigilmon', (req, res) => {
  const { monitor_name, status, url, response_code, checked_at } = req.body;

  if (status === 'down') {
    console.error('[VIGILMON] Domoticz DOWN', {
      monitor: monitor_name,
      url,
      code: response_code,
      at: checked_at,
    });

    // Send push notification, trigger backup controller,
    // notify household members, etc.
    sendAlert(`Domoticz is offline since ${checked_at}`);
  } else if (status === 'up') {
    console.info('[VIGILMON] Domoticz recovered', { monitor: monitor_name });
  }

  res.sendStatus(204);
});

app.listen(3000);

Vigilmon sends this payload:

{
  "monitor_id": "mon_abc123",
  "monitor_name": "Domoticz API",
  "status": "down",
  "url": "https://domoticz.example.com/json.htm?type=command&param=getversion",
  "checked_at": "2026-06-30T08:01:00Z",
  "response_code": 0,
  "response_time_ms": 30001
}

A response_code of 0 with a long response_time_ms indicates a timeout — the most common failure mode for a crashed Domoticz process or a rebooting Raspberry Pi.


Part 6: Docker deployments

# docker-compose.yml
version: "3.8"

services:
  domoticz:
    image: domoticz/domoticz:stable
    restart: unless-stopped
    ports:
      - "8080:8080"
      - "443:443"
    volumes:
      - ./domoticz_config:/opt/domoticz/userdata
    environment:
      - TZ=Europe/Amsterdam
    healthcheck:
      test: >
        ["CMD", "curl", "-sf",
         "http://localhost:8080/json.htm?type=command&param=getversion"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s

Check container health:

docker inspect domoticz --format='{{.State.Health.Status}}'

If Docker reports unhealthy, the Domoticz process has stopped responding even though the container is still running. Your Vigilmon monitor will detect this at the next check interval from the outside.


Part 7: Raspberry Pi monitoring considerations

Most Domoticz installations run on Raspberry Pi hardware. Hardware failures — SD card corruption, power supply voltage drop, overheating — can cause Domoticz to become unresponsive without the OS crashing cleanly. Vigilmon's external HTTP polling catches these cases where local monitoring cannot.

Recommended monitoring stack for Raspberry Pi Domoticz:

| Layer | Tool | What it catches | |-------|------|-----------------| | External uptime | Vigilmon | Process crash, network failure, SD card hang | | Internal process | systemd domoticz.service | Automatic restart on crash | | Hardware health | vcgencmd measure_temp | CPU throttling due to heat | | Storage | df -h + cron alert | SD card full (kills Domoticz DB writes) |

Enable the systemd service for automatic restart:

# /etc/systemd/system/domoticz.service
[Unit]
Description=Domoticz Home Automation
After=network.target

[Service]
ExecStart=/home/pi/domoticz/domoticz -www 8080 -sslwww 0
Restart=always
RestartSec=10
User=pi
WorkingDirectory=/home/pi/domoticz

[Install]
WantedBy=multi-user.target
sudo systemctl enable domoticz
sudo systemctl start domoticz

With systemd restart and Vigilmon polling, you get both automatic recovery and external alerting when recovery fails or takes longer than expected.


Summary

Your Domoticz deployment now has four layers of monitoring:

  1. JSON API monitor — confirms the Domoticz process and its HTTP server are alive, polled every 60 seconds by Vigilmon.
  2. UI monitor — confirms the web interface is reachable for remote management.
  3. SSL monitor — alerts you 14 days before your certificate expires, before remote access fails.
  4. Webhook/Slack alerts — DOWN and UP events are delivered to your notification channel within one check interval.

Vigilmon handles check scheduling, multi-region polling, alert routing, and uptime history. You get notified within 60 seconds of any Domoticz failure — whether it's a process crash, a frozen SD card, or a network partition.


Monitor your Domoticz home automation system free at vigilmon.online

#domoticz #smarthome #iot #homeautomation #monitoring #raspberrypi

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →