⚠️ Leakbot Only Allows One Login:: If you use this integration the token your mobile app is connected to becomes invalid and you get logged out. This happens also if you re-log back into the app it invalidates the token for the integration, however the integration should automatically re-authenticate.
An integration for homeassistant (via HACS) to connect to Leakbot via the leakbot cloud api.
The Water Usage Events sensor does not have a current value, this sensor imports the history which is always 2 days out of date. For each 30 min duration if Leakbot detects water usage the value is incremented by 1, there are a total of 48 detectable units in a day which are recorded as night/ morning/ afternoon and evening.
Water Usage Events is used only for showing in the history.
Past Calendar Notifications have no current state, this is because calendar events need a start and end date. Whilst Leakbot notifies of the start quick quickly after the event the end does not get notified for hours and this causes bad historic and event data in the system.
Event Status is however shown in the Leak Status, for example the ones I have seen:
- leak_inactive : No Leak
- high_usage: High Usage
- low_battery: Low Battery
Integration will update every 30 min by default but can be changed in the config options.
NOTES:
- For a new install of the Leakbot device it can take 24 hours before the API will start returning data, before that you will see invalid values.
- There are three sensors: battery status, leak status and leak free days.
- Water Usage Events status does not show in the energy dashboard as this requires a volume unit of measure which we do not have.
- Some translation is done as don't know what other options there are, example goodbattery not seen other states to setup.
- Diagnotic download is not yet available.
The preferred and easiest way to install this is from the Home Assistant Community Store (HACS). Follow the link in the badge above for details on HACS.
Go to HACS and integraitons, then select to download Leakbot from HACS.
Go to the Home Assistant UI, go to "Configuration" -> "Integrations" click "+" and search for "Leakbot" follow the configuration screen.
If you want to see Beta versions open the Leakbot in HACS, after download, and click the three dots on the top right and select re-download. Here you will se an option to see beta versions.
It is possible to show the info and debug logs for the Leakbot integration, to do this you need to enable logging in the configuration.yaml, example below:
Logs do not remove sensitive information so careful what you share, check what you are about to share and blank identifying information. Note the diagnostic info attempts to redact sensitive information.
logger:
default: warning
logs:
# Log for Leakbot
custom_components.leakbot: info
To install manually, if you really want to: I won't support this.
- Using the tool of choice open the directory (folder) for your HA configuration (where you find
configuration.yaml). - If you do not have a
custom_componentsdirectory (folder) there, you need to create it. - In the
custom_componentsdirectory (folder) create a new folder calledleakbot. - Download all the files from the
custom_components/leakbot/directory (folder) in this repository. - Place the files you downloaded in the new directory (folder) you created.
- Restart Home Assistant
- In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Leakbot"
I have set this up to be able to run development or testing using Visual Studio Code with Docker or Podman in line with the integration blueprint.
To setup just copy the .devcontainer-template.json to .devcontainer.json
If using podman uncomment the section runArgs to avoid permission issues. Update BUILD_TYPE to "run" to run an instance of Home Assistant and "dev" to do development with pytest.
Debugging in Pythong 3.12 seems slow to startup: To enable vscode debugging a sample /.vscode/launch.json is:
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
// Example of Debugging Tests.
"name": "Python: Debug Tests",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"purpose": [
"debug-test"
],
"console": "integratedTerminal",
"justMyCode": true,
"env": {
"PYTEST_ADDOPTS": "--no-cov"
}
},
{
// Example of attaching to local debug server
"name": "Python: Attach Local",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
],
}
]
}
If you want to contribute to this please read the Contribution guidelines
Or just raise a feature request, would be useful to have a use-case, what system you have and what you want to get done.

