Pool Math for Home Assistant
Creates sensors for pools being managed with Trouble Free Pools's Pool Math apps including Pool Math iOS and Pool Math Android. From the Trouble Free Pool website:
- Pool Math makes swimming pool care, maintenance and management easy by tracking chlorine, pH, alkalinity and other levels to help calculate how much salt, bleach and other chemicals to add.
- Pool Math performs all the calculations you need to keep your chlorine, pH, calcium, alkalinity, and stabilizer levels balanced.
- Trouble Free Pool is a registered 501(c)3 non-profit who displays NO advertising on our site nor is our advice compromised by financial incentives.
Supported Pool Math Values
- pH
- Free Chlorine (FC)
- Combined Chlorine (CC)
- Total Alkalinity (TA)
- Calcium Hardness (CH)
- Cyanuric Acid (CYA)
- Salt
- Borates
- Calcite Saturation Index (CSI)
- Temperature
Note: this requires a Trouble Free Pool Pool Math Premium subscription to access your pool or spa's data from the Pool Math cloud service.
Installation
Make sure Home Assistant Community Store (HACS) is installed, then add the repository: rsnodgrass/hass-poolmath
Configuration
Under Settings of the Pool Math iOS or Android application, find the Sharing section. Turn this on, which allows anyone with access to the unique URL to be able to view data about your pool. Your pool's URL will be displayed, use that in the YAML configuration for the poolmath sensor.
sensor:
- platform: poolmath
url: https://troublefreepool.com/mypool/6WPG8yL
NOTE: This updates the state from PoolMath every 15 minutes to keep from overwhelming their service, as the majority of Pool Math users update their data manual after testing rather than automated. The check interval can be changed in yaml config by adding a 'scan_interval' for the sensor.
Example Lovelace UI
entities:
- entity: sensor.swimming_pool_fc
name: Free Chlorine
- entity: sensor.swimming_pool_ph
name: pH
- entity: sensor.swimming_pool_ta
name: Total Alkalinity
- entity: sensor.swimming_pool_cya
name: CYA
- entity: sensor.swimming_pool_ch
name: Hardness
type: entities
title: Pool
show_header_toggle: false
Support
Community Support
- How to use the Pool Math app?
- For issues with the Pool Math apps, see forums or contact poolmath@troublefreepool.com
Feature Requests
- move all communication/interfaces to Pool Math into separate pypoolmath package that can be maintained separately
- on HA start, if the Pool Math cloud service is not available, no sensors are created (they get created later when service returns); ideas how to improve this:
- if Pool Math service is down, just create ALL sensors hardcoded in POOL_MATH_SENSOR_SETTINGS (or check to see if RestoreEnttiy has entries for those) ... this might be easiest, and could just be standard startup procedure
- update PoolMathServiceSensor to also use RestoreEntity and recreate all sensors that were saved in its state
- make the HA yaml configuration for this a platform, rather than a sensor config...e.g.:
poolmath:
sources:
- url: https://api.poolmathapp.com/share/tfp-168502
name: "Swimming Pool"
- url: https://troublefreepool.com/mypool/6WPG8yL
name: "Spa"