Vergus Virgil — ESP32-S3 Smart Water Monitor with Native Zigbee, Telegram and Home Assistant MQTT Discovery

Vergus Virgil — ESP32-S3 Smart Water Monitor

with Native Zigbee, Telegram and

Home Assistant MQTT Discovery


Hi everyone,

I'm an Italian plumber who codes.
I built Vergus Virgil because I got tired
of seeing flood damage that could have
been prevented with a smarter system.

This is not a weekend project —
it's been running in production
for several months and has evolved
into something I'm proud to share
with this community.



:wrench: WHAT IT DOES

Vergus Virgil monitors your water system
and automatically closes a motorized valve
when it detects an anomaly — in under 50ms.

It combines three detection layers:

  1. Flow anomaly detection
    EMA + Z-Score statistical algorithm
    that learns your consumption patterns
    and detects leaks, drips and
    unusual flow behavior

  2. Physical flood sensors
    Native Zigbee coordinator (XIAO ESP32-C6)
    supports SONOFF SNZB-05P, Aqara and any
    Zigbee 3.0 IAS Zone flood sensor
    — no hub, no server,
    no Zigbee2MQTT needed

  3. External sensors via open JSP protocol
    Any ESP32/ESP8266 can send alerts via
    simple HTTP POST JSON —
    WiFi companion sensor included


:gear: TECHNICAL HIGHLIGHTS

  • ESP32-S3 WROOM N16R8 (main controller)
  • XIAO ESP32-C6 (native Zigbee coordinator)
    connected via UART — standalone,
    no external server required
  • FreeRTOS dual-core architecture:
    Core 1: safety tasks (valve < 50ms)
    Core 0: network tasks (Telegram, MQTT)
  • Multi-level watchdog
  • Fail-safe valve (closes on power loss)
  • UPS compatible

:house: HOME ASSISTANT INTEGRATION

Native MQTT Discovery — zero configuration:

  • Sensors: flow rate, volume, temperature,
    anomaly score
  • Binary sensors: alarm, valve state,
    frost protection
  • Controls: emergency valve, reset alarms
  • Works alongside any existing HA setup

:mobile_phone: TELEGRAM BOT

Full control without HA:
/status — live system status
/report_week — weekly consumption stats
/report_month — monthly consumption stats
/valve_open — open valve manually
/valve_close — close valve (emergency)
/reset — reset active alarms
/zigbee pair — pair new Zigbee sensor
/holiday on|off — vacation mode
/limit on|off — consumption limit


:thermometer: ADDITIONAL FEATURES

  • Frost protection with DS18B20
  • Vacation scheduler (7 days × 3 time slots)
  • Consumption limits (daily/weekly/monthly)
  • Valve anti-blocking automatic cycle
  • Valve fault diagnosis
  • 30-day circular buffer statistics
  • OTA firmware updates
  • Local web interface for sensor management
  • MQTT Setup page via web UI
  • Telegram Setup page via web UI
  • EMA Engine sensitivity presets
    (Low / Medium / High + Advanced mode)


:electric_plug: OPEN PROTOCOL — VirgilJSP

Vergus Virgil uses an open JSON sensor
protocol. Any device can integrate
with a simple HTTP POST:

POST http://vergus-virgil.local/json
{
"id": "kitchen",
"name": "Kitchen",
"alarm": 1,
"control": 1,
"battery": 87
}

:warning: Arduino library VirgilJSP is currently
in development and will be available
on GitHub soon.

:warning: Note: Vergus Virgil firmware is
closed source. The JSP protocol is
open and documented — anyone can
build compatible sensors using
the VirgilJSP library.




:package: VERGUS ECOSYSTEM

Vergus Virgil is the first product
of Vergus — a solo maker journey
built on the idea that real problems
deserve unexpected solutions.

Four elements. Four products.

:droplet: Vergus Virgil → water monitoring
(this project)
:fire: Vergus Ignis → fire & CO detection
(roadmap)
:globe_showing_europe_africa: Vergus Tellus → smart chicken coop automation
(roadmap)
:dashing_away: Vergus Aura → weather & environment
(roadmap)


:hammer_and_wrench: STATUS

Currently in beta — looking for testers.

:pushpin: Coming soon:
├── VirgilJSP Arduino library
└── Full documentation

The splash screen logo was hand-crafted
pixel by pixel by Aura —
a small detail that makes it feel
like a real product. :blush:

Happy to answer questions and
hear feedback from the community.

Built with :heart: by an Italian plumber
who codes — Vergus

1 Like

:new_button: UPDATE — VirgilJSP Library Released

I just published VirgilJSP — the open
Arduino library that implements the
Virgil JSON Sensor Protocol.

:package: GitHub:

Any ESP32/ESP8266 can now send JSP
messages to Vergus Virgil in 3 lines:

#include <VirgilJSP.h>
VirgilJSP s("id", "name", "host");
s.sendAlarm(true);

Or build your own JSP hub with
VirgilJSPReceiver.

Compatible with ESPHome, Tasmota,
Shelly Gen4 and any webhook-capable device.

:new_button: UPDATE — Complete Web Dashboard Released

Vergus Virgil now ships with a full
14-page web dashboard — making the
OLED display completely optional.

:bar_chart: Monitoring:

  • Real-time flow, volume, temperature,
    anomaly score
  • Consumption stats (24h/week/month/total)
  • Remote sensors with battery level
  • WiFi / MQTT / Zigbee status

:gear: Full configuration via browser:

  • MQTT broker + HA Discovery
  • Telegram bot setup
  • Sensor management (JSP protocol)
  • Zigbee pairing and device management
  • OTA firmware update
  • Flow parameters & calibration
  • Consumption limits
  • Frost protection
  • Vacation scheduler (7 days × 3 slots)
  • Date/Time with NTP sync
  • EMA Engine presets + advanced tuning
  • Network diagnostics & event log

The dashboard is local-only by design —
all remote control goes through Telegram,
requiring no port forwarding,
no cloud, no subscription.

With 14 configuration pages covering
every aspect of the system, the OLED
becomes optional — enabling a simpler
and more affordable hardware variant.

English translation in progress.

Here are a screenshot below

Built with :heart: — Vergus

Bravo! Excellent!