// projects / modbus

ClimateMonitor: real-time climate dashboard for Modbus RTU

Reads temperature and humidity sensors (XY-MD02, XY-MD04 and similar) over RS-485 and shows them live, with Mollier diagram, wood moisture, history, notifications and MQTT. Everything is set up in the browser. Open source.

GitHub stars Latest release Tests Last commit License Buy Me a Coffee

Latest version: v2.3.0 · · Changelog

// features

What it does

Runs on a Raspberry Pi or a Linux, Windows or macOS machine with a USB/RS-485 interface. Built with Python, Dash and Plotly.

  • Multiple sensors and buses

    Several USB/RS-485 interfaces, each with several Modbus slaves. Buses are read in parallel. A sensor that does not answer does not hold up the others. Per sensor: data type (int16 to float32), byte order and calibration offset for temperature and RH.

  • Live dashboard

    New values every second. Two views: Board (every sensor as a row with a 24-hour trend) and Meters (one panel per sensor). Dark and light theme, switched in the header and remembered per browser. Works on phones and tablets.

  • Calculated values

    Dew point (Magnus formula), absolute humidity, Humidex and a comfort score from 0 to 6 following the Environment Canada standard.

  • Mollier diagram

    Saturation line, RH curves and comfort zone, with every sensor as a point in its own colour. Zoom and pan with Plotly.

  • Wood moisture

    Equilibrium moisture content per sensor following the USDA Wood Handbook, with its own diagram: temperature against RH, with lines of equal wood moisture. Correction per wood species. An average over 24 hours by default follows how slowly wood reacts, so short peaks do not raise an alarm. Your own coloured zones in the diagram, such as comfort or mould risk: + Zone starts with a square; drag the corners, drag the dot in the middle of a side to add a corner and double-click a corner to remove it. Works with mouse and touch. On or off in Settings.

  • History and replay

    Stored in SQLite with a table per day and WAL mode, built to run for years. Pick a period and drag through time to replay the climate in the Mollier diagram.

  • Notifications

    Telegram and/or e-mail when a limit is exceeded, for all sensors or per sensor, with alarm delay and hysteresis. Each limit can have a warning and an alarm, for example at 18 % and 20 % wood moisture. Zones notify on leaving (desired zone) or entering (danger zone), with a margin against repeated notifications. Limits show as dashed lines in the time chart: yellow for warning, red for alarm. Also when values recover and when a sensor goes offline. The alarm window in the header lists everything active; each alarm can be muted for 15 minutes up to 24 hours.

  • MQTT

    Values per sensor to an MQTT broker, for Home Assistant, Node-RED or SCADA. With TLS, login and a last will for the online status.

  • Everything in the browser

    Set buses, sensors, limits, zones, timezone, language and data retention in plain form fields, without editing files or restarting. Pick the serial port from the adapters found; Scan bus finds which sensors answer. Protected with an admin password.

  • Runs as a service

    Install scripts for Linux/Raspberry Pi (systemd) and Windows. Starts at boot, also without logging in. Interface in five languages: NL, EN, DE, FR and ES. Works fully offline.

// screenshots

What it looks like

Screenshots use demonstration data.

  • Board view with wood moisture column, dark theme
    Board view with wood moisture column, dark theme
  • Meters view, light theme
    Meters view, light theme
  • Phone, dark theme
    Phone, dark theme
  • Phone, light theme
    Phone, light theme
  • Mollier diagram with comfort zone and all sensors
    Mollier diagram with comfort zone and all sensors
  • Wood moisture diagram with limits at 18 and 20 % and zones
    Wood moisture diagram with limits at 18 and 20 % and zones
  • Zone editor in the wood moisture diagram
    Zone editor in the wood moisture diagram
  • Historical replay in the Mollier diagram
    Historical replay in the Mollier diagram
  • Settings: buses and sensors, with data type, byte order and offset
    Settings: buses and sensors, with data type, byte order and offset
  • Settings: limits with level, and zones
    Settings: limits with level, and zones

// installation

Install

  • 01Download

    You need Python 3.10+ and a Modbus RTU sensor on RS-485. Clone the repository: git clone https://github.com/CervezaStallone/ClimateMonitor.git

  • 02Install

    Create a virtual environment, install the dependencies with pip install -r requirements.txt and copy .env.example to .env.

  • 03Start

    Start with python app.py and open http://127.0.0.1:8050/. Set the admin password in Settings and add your buses and sensors.

  • 04As a service

    For devices that run unattended: sudo ./deploy/linux/install-service.sh on Linux or Raspberry Pi, or deploy\windows\install-service.ps1 as Administrator on Windows.