{"id":50761142,"url":"https://github.com/cobra91/wifipool-ha-mqtt","last_synced_at":"2026-06-11T10:01:23.491Z","repository":{"id":363417014,"uuid":"1262185778","full_name":"cobra91/wifipool-ha-mqtt","owner":"cobra91","description":"Connect WiFiPool pool devices (pH probes, dosing pumps, relais) to Home Assistant via local MQTT.  Replaces cloud dependency and REST polling with real-time MQTT discovery","archived":false,"fork":false,"pushed_at":"2026-06-08T19:49:40.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T21:23:18.637Z","etag":null,"topics":["diy","esp8266","home-assistant","home-assistant-configuration","homeautomation","iot","mosquitto","mqtt","pool","smart-home","tasmota","wifipool"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cobra91.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-07T17:21:57.000Z","updated_at":"2026-06-08T19:49:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cobra91/wifipool-ha-mqtt","commit_stats":null,"previous_names":["cobra91/wifipool-ha-mqtt"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/cobra91/wifipool-ha-mqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobra91%2Fwifipool-ha-mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobra91%2Fwifipool-ha-mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobra91%2Fwifipool-ha-mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobra91%2Fwifipool-ha-mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cobra91","download_url":"https://codeload.github.com/cobra91/wifipool-ha-mqtt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobra91%2Fwifipool-ha-mqtt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34192870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diy","esp8266","home-assistant","home-assistant-configuration","homeautomation","iot","mosquitto","mqtt","pool","smart-home","tasmota","wifipool"],"created_at":"2026-06-11T10:01:11.361Z","updated_at":"2026-06-11T10:01:23.480Z","avatar_url":"https://github.com/cobra91.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WiFiPool → Home Assistant — Local MQTT Integration\n\n![HA version](https://img.shields.io/badge/HA-2024.12%2B-blue)\n![License](https://img.shields.io/badge/License-MIT-green)\n![Platform](https://img.shields.io/badge/Platform-Raspberry%20Pi%20%7C%20ESP8266-orange)\n\n**Disconnect your WiFiPool devices from the cloud and switch to real-time local MQTT.**\n\nThis project provides everything you need to connect [WiFiPool](https://play.google.com/store/apps/details?id=wifipool.mobile) pool equipment (pH probes, dosing pumps, relays) to [Home Assistant](https://www.home-assistant.io/) via a local [Mosquitto](https://mosquitto.org/) MQTT broker — replacing REST polling and eliminating cloud dependency.\n\n## Why this project?\n\nThe WiFiPool app ships custom Tasmota firmware on ESP8266-based modules for pool management (pH monitoring, relay control, dosing pumps). This firmware:\n\n- Publishes to the WiFiPool cloud MQTT broker\n- Does not support standard Tasmota MQTT discovery (SetOption19)\n- Uses a custom FullTopic with a fixed hash prefix\n- Disables several standard Tasmota commands (`Version`, `MqttTopic` → `\"Unknown\"`)\n\nThis project reverse-engineers these quirks and provides a complete MQTT integration with Home Assistant.\n\n## Architecture\n\n```\n┌─────────────┐      MQTT (real-time)         ┌──────────────────┐\n│  pH Probe    │ ────────────────────────────► │                  │\n│  (ESP8266)   │                               │  Mosquitto       │\n│  Sonde       │                               │  (local broker)  │\n└─────────────┘                               │  port 1883       │\n                                               │                  │\n┌─────────────┐      MQTT (real-time)          │                  │\n│  Dosing Pump │ ────────────────────────────► │                  │\n│  (Shelly)    │ ◄──────────────────────────── │                  │\n│  Pompe       │      (ON/OFF commands)         │                  │\n└─────────────┘                               └────────┬─────────┘\n                                                        │\n                                               MQTT Discovery\n                                                        │\n                                               ┌────────▼─────────┐\n                                               │  Home Assistant   │\n                                               │  - 10 sensors     │\n                                               │  - 1 switch       │\n                                               │  - automations    │\n                                               └──────────────────┘\n```\n\n## What you get\n\n| Entity | Type | MQTT Topic Source |\n|--------|------|-------------------|\n| WiFiPool pH ADC | sensor (raw) | `stat/\u003ctopic\u003e/STATUS10` → `StatusSNS.ANALOG.A0` |\n| WiFiPool pH | sensor (pH) | `stat/\u003ctopic\u003e/STATUS10` → calibration formula |\n| WiFiPool Probe Uptime | sensor (s) | `stat/\u003ctopic\u003e/STATUS11` → `Status.UptimeSec` |\n| WiFiPool Probe RSSI | sensor (dBm) | `stat/\u003ctopic\u003e/STATUS11` → `Status.Wifi.RSSI` |\n| WiFiPool Probe Heap | sensor (KB) | `stat/\u003ctopic\u003e/STATUS11` → `Status.Heap` |\n| Pump Power | sensor (W) | `stat/\u003ctopic\u003e/STATUS10` → `StatusSNS.ENERGY.Power` |\n| Pump Voltage | sensor (V) | `stat/\u003ctopic\u003e/STATUS10` → `StatusSNS.ENERGY.Voltage` |\n| Pump Uptime | sensor (s) | `stat/\u003ctopic\u003e/STATUS11` → `Status.UptimeSec` |\n| Pump RSSI | sensor (dBm) | `stat/\u003ctopic\u003e/STATUS11` → `Status.Wifi.RSSI` |\n| Pump State | sensor | `stat/\u003ctopic\u003e/STATUS11` → `Status.Power` |\n| Pump Control | switch (outlet) | `cmnd/\u003ctopic\u003e/POWER` ↔ `stat/\u003ctopic\u003e/RESULT` |\n\n## Prerequisites\n\n- **Home Assistant** 2024.12+ (native MQTT discovery, no YAML legacy platform support)\n- **Mosquitto broker add-on** installed and running in HA\n- **WiFiPool devices** accessible on your local network (IPs known)\n- **Python 3.10+** with `paho-mqtt` (for the setup script)\n\n## Quick Start\n\n### 1. Install Mosquitto\n\nIn Home Assistant → **Settings → Add-ons → Mosquitto broker** → Install.\n\nAdd a login in the add-on configuration:\n\n```json\n{\n  \"logins\": [\n    {\n      \"username\": \"tasmota\",\n      \"password\": \"YOUR_PASSWORD_HERE\"\n    }\n  ]\n}\n```\n\nSave and restart the add-on.\n\n### 2. Configure your WiFiPool devices\n\nReplace values with your own IPs, usernames and passwords.\n\n```bash\n# pH Probe\nIP_PROBE=\"192.168.1.XXX\"\nUSER_PROBE=\"admin\"\nPASS_PROBE=\"YOUR_PASSWORD\"\n\n# Pump / Relay\nIP_PUMP=\"192.168.1.YYY\"\nUSER_PUMP=\"admin\"\nPASS_PUMP=\"YOUR_PASSWORD\"\n\n# Local MQTT broker\nMQTT_HOST=\"192.168.1.ZZZ\"  # Your HA / Raspberry Pi IP\nMQTT_USER=\"tasmota\"\nMQTT_PASS=\"YOUR_PASSWORD\"\n```\n\n### 3. Point devices to your local MQTT broker\n\n```bash\n# pH Probe\ncurl \"http://${IP_PROBE}/cm?user=${USER_PROBE}\u0026password=${PASS_PROBE}\u0026cmnd=MqttHost%20${MQTT_HOST}\"\ncurl \"http://${IP_PROBE}/cm?user=${USER_PROBE}\u0026password=${PASS_PROBE}\u0026cmnd=MqttPort%201883\"\ncurl \"http://${IP_PROBE}/cm?user=${USER_PROBE}\u0026password=${PASS_PROBE}\u0026cmnd=MqttUser%20${MQTT_USER}\"\ncurl \"http://${IP_PROBE}/cm?user=${USER_PROBE}\u0026password=${PASS_PROBE}\u0026cmnd=MqttPassword%20${MQTT_PASS}\"\n\n# Pump\ncurl \"http://${IP_PUMP}/cm?user=${USER_PUMP}\u0026password=${PASS_PUMP}\u0026cmnd=MqttHost%20${MQTT_HOST}\"\ncurl \"http://${IP_PUMP}/cm?user=${USER_PUMP}\u0026password=${PASS_PUMP}\u0026cmnd=MqttPort%201883\"\ncurl \"http://${IP_PUMP}/cm?user=${USER_PUMP}\u0026password=${PASS_PUMP}\u0026cmnd=MqttUser%20${MQTT_USER}\"\ncurl \"http://${IP_PUMP}/cm?user=${USER_PUMP}\u0026password=${PASS_PUMP}\u0026cmnd=MqttPassword%20${MQTT_PASS}\"\n```\n\n### 4. Disable Tasmota safety rules\n\nWiFiPool firmware enables rules that cut relays on MQTT/WiFi disconnect. If you manage safety via HA automations, disable them:\n\n```bash\ncurl \"http://${IP_PUMP}/cm?user=${USER_PUMP}\u0026password=${PASS_PUMP}\u0026cmnd=Rule1%20off\"\ncurl \"http://${IP_PUMP}/cm?user=${USER_PUMP}\u0026password=${PASS_PUMP}\u0026cmnd=Rule2%20off\"\n```\n\n### 5. Get your custom FullTopic\n\nWiFiPool firmware uses a custom FullTopic. Retrieve it:\n\n```bash\ncurl \"http://${IP_PROBE}/cm?user=${USER_PROBE}\u0026password=${PASS_PROBE}\u0026cmnd=FullTopic\"\n# Response: {\"FullTopic\":\"\u003cHASH\u003e/%prefix%/%topic%/\"}\n```\n\nNote the `\u003cHASH\u003e` (16 hex characters) and the device topics (`1024EE`, `81AC17`, etc.).\n\n### 6. Configure Tasmota polling rules\n\nWiFiPool firmware does NOT auto-publish sensor data on `tele/` topics. You must set a Tasmota rule to poll `Status 10` and `Status 11` periodically:\n\n```bash\n# pH Probe — poll every minute\ncurl \"http://${IP_PROBE}/cm?user=${USER_PROBE}\u0026password=${PASS_PROBE}\u0026cmnd=Rule1%20ON%20Time%23Minute%20DO%20Backlog%20Status%2010%3B%20Status%2011%20ENDON\"\ncurl \"http://${IP_PROBE}/cm?user=${USER_PROBE}\u0026password=${PASS_PROBE}\u0026cmnd=Rule1%201\"\n\n# Pump — poll every minute\ncurl \"http://${IP_PUMP}/cm?user=${USER_PUMP}\u0026password=${PASS_PUMP}\u0026cmnd=Rule1%20ON%20Time%23Minute%20DO%20Backlog%20Status%2010%3B%20Status%2011%20ENDON\"\ncurl \"http://${IP_PUMP}/cm?user=${USER_PUMP}\u0026password=${PASS_PUMP}\u0026cmnd=Rule1%201\"\n```\n\nThis publishes `stat/\u003ctopic\u003e/STATUS10` (sensor data) and `stat/\u003ctopic\u003e/STATUS11` (device state) every minute.\n\n### 7. Run the setup script\n\n```bash\npip install paho-mqtt\npython3 scripts/setup.py \\\n  --mqtt-host 192.168.1.ZZZ \\\n  --mqtt-user tasmota \\\n  --mqtt-pass YOUR_PASSWORD \\\n  --prefix \"YOUR_FULLTOPIC_HASH\" \\\n  --topic-sonde \"1024EE\" \\\n  --topic-pompe \"81AC17\"\n```\n\nThe script publishes MQTT discovery configs to your broker. Home Assistant auto-detects the entities.\n\n### 8. Restart Home Assistant\n\nIf entities don't appear immediately, restart HA.\n\n## pH Calibration\n\nThe default calibration formula assumes a typical WiFiPool pH probe:\n\n```\npH = 10.1 + (ADC × (3.42 - 10.1) / 1024)\n```\n\nCalibration points:\n- **pH 10.1** → ADC = 0\n- **pH 3.42** → ADC = 1024\n\n**Calibrate with your own probe!** Use pH 4.0 and pH 7.0 buffer solutions:\n\n1. Measure ADC at pH 4.0 → `adc_low`\n2. Measure ADC at pH 7.0 → `adc_high`\n3. Formula: `pH = 7.0 + (adc - adc_high) × (4.0 - 7.0) / (adc_low - adc_high)`\n\nYou can pass custom calibration points to the setup script:\n\n```bash\npython3 scripts/setup.py --ph-high 10.1 --ph-low 3.42 ...\n```\n\n## Automations (optional)\n\nExample automations are provided in `ha-examples/`:\n\n- **Auto dosing** — activates pump when pH exceeds target range\n- **Safety shutdown** — cuts pump if pH drops too low\n- **Critical alert** — immediate notification for out-of-range pH\n- **Offline detection** — alerts when a device stops publishing\n- **Filtration safety** — prevents dosing without active filtration\n\n## Troubleshooting\n\n### Devices \"not authorised\" in Mosquitto logs\n\nDevices are connecting without credentials. Make sure `MqttUser` and `MqttPassword` are set on each device, and the credentials match a login in the Mosquitto add-on configuration.\n\n### Entities with weird names (`sonde_ph_wifipool_...`)\n\nHA prefixes entity names with the device name. Edit the entity registry in HA to rename them, or use the `--object_id` mapping in the setup script.\n\n### Switch doesn't stay ON\n\nWiFiPool firmware has Tasmota rules (Rule1/Rule2) that cut relays on connection loss. Disable them (see step 4).\n\n### Data not updating\n\nDefault `Teleperiod` is 60 seconds. You can reduce it:\n\n```bash\ncurl \"http://${IP_PROBE}/cm?user=${USER_PROBE}\u0026password=${PASS_PROBE}\u0026cmnd=Teleperiod%2030\"\n```\n\n## WiFiPool Firmware Technical Details\n\n| Property | Detail |\n|----------|--------|\n| **Base** | Tasmota (custom build) |\n| **FullTopic** | `0632c57610d90cb8e169d9f487747890/%prefix%/%topic%/` (fixed hash) |\n| **Topic format** | `%06X_%06X` (uppercase hex MAC address) |\n| **FriendlyName** | \"WifiPool IoT\" (×8 slots) |\n| **SetOption19** | Accepts ON/OFF but standard discovery does NOT work |\n| **Disabled commands** | `Version`, `MqttTopic`, `MqttRestart` → `\"Unknown\"` |\n| **SleepMode** | Dynamic, Sleep=50 |\n| **Cloud topic** | `\u003ctopic\u003e@\u003cuuid\u003e` (WiFiPool cloud broker format) |\n\nSee [`docs/FIRMWARE_NOTES.md`](docs/FIRMWARE_NOTES.md) for the full reverse-engineering details.\n\n## License\n\nMIT — Free to use, modify, and redistribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobra91%2Fwifipool-ha-mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobra91%2Fwifipool-ha-mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobra91%2Fwifipool-ha-mqtt/lists"}