Phyn integration - Water leak detector

FYI the IKEA BADRING Zigbee water sensor (only $10 each, very small) can be used to shut off the Phyn Plus valve with this integration… loving this integration! THANK YOU to everybody who contributed to this especially jordanruthe and MizterB!

I’d love to try to work on pulling the entity-linked consumption as shown in the Phyn app for a single day. I would like to be able to try to either create entities for each type (sink, shower, toilet) or somehow link them to other existing entities.

[REQUEST] Support for water events connected to entities? · Issue #13 · jordanruthe/homeassistant-phyn

@shdw - in your work have you seen whether and what part of the phyn API might return this information?

Long story short, you could make an entity that aggregates and tracks hourly/daily consumption for the different types, but you couldn’t really record singular events.

I haven’t looked into the apis for this, but it would be trivial to figure it out. The way reporting works in home assistant, I haven’t felt like it would be worth the effort.

The problem is that the events happen in realtime but don’t get announced over the mqtt connection. So, the information would be received after the fact. Home assistant really only cares to record real time information, so you can’t retroactively add an event.

It has been some time since I’ve looked at this, so maybe something has changed on the HA front. But the only way to do it previously was in a way that breaks the HA architecture and make direct database calls, which integrations shouldn’t be doing.

Hi all-
Just wondering if internet connection is needed for the shutoff command.

Basically, if the internet goes out but my network is still up, will the shutoff command work?

I believe it uses the phyn api so if internet goes out it will not work

FYI, jordanruthe made a few small updates so new releases are available from his repo on GitHub:

Are the average temperatures & pressures provided by this integration hourly, daily, or other?

I believe it’s a daily average.

See → GitHub - jordanruthe/homeassistant-phyn: A plugin for Phyn and Phyn by Kohler for HomeAssistant

This integration currently provides the following capabilities:

  • Daily water usage (compatible with Energy dashboard)
  • Averages water temperature, pressure, and flow (realtime not available)
  • Shutoff valve control
  • Away mode control

Did you ever get this automation to work? I’m wondering if it fails because the integration doesn’t support realtime data.

It sure would be useful to have the valve shut off based on conditions. If I read this thread correctly, it seems it’s not possible to get current flow rates thru the API?

I do get realtime flow data with this integration that matches what the Phyn app shows.

I’m new to home assistant and this phyn integration. I’m trying to get total water usage from a date. I have a cistern and want to enter my fill date and see my usage at any time. I’d like to then have it alert me when I hit a certain threshold.

Is this possible as is by sending phyn data from this integration into something else in home assistant or will it be possible if I alter the code?

1 Like

So it is possible to store and manipulate real time data using the Phyn Plus? I’m trying to figure out whether I should buy the Phyn or Flo based on this.

Hi Tim, I have the exact same idea as you. I hope to get mine installed in the coming weeks. Such a hasel to always go outside to measure my cistern level.

I’m not sure which device you have, but generally there is a total water count that you can see the total water usage for each day and take the delta. It also integrates with the energy dashboard.

Is the time increment here per hour? Has anyone tried to increase the polling rate?

The Flume API allows for 120 requests an hour, effectively every 30 seconds.

It depends. The integration tries to establish a MQTT connection which gets updated every 5 seconds. Manual polling is every 60 seconds if MQTT is not working. The stats in the picture above are just aggregated stats from the energy dashboard.

1 Like

Looks like the integration is broken after the HA Core 2025.6.0b6 upgrade. Here is what is in the logs:

Logger: homeassistant.config_entries
Source: config_entries.py:749
First occurred: 7:44:05 AM (2 occurrences)
Last logged: 7:46:57 AM

Error setting up entry Home 1 for phyn
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 749, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/phyn/init.py”, line 56, in async_setup_entry
hass.data[DOMAIN][CLIENT] = client = await async_get_api(
^^^^^^^^^^^^^^^^^^^^
…<3 lines>…
)
^
File “/usr/local/lib/python3.13/site-packages/aiophyn/api.py”, line 235, in async_get_api
await api.async_authenticate()
File “/usr/local/lib/python3.13/site-packages/aiophyn/api.py”, line 174, in async_authenticate
await self._partner_api.authenticate()
File “/usr/local/lib/python3.13/site-packages/aiophyn/partners/kohler.py”, line 67, in authenticate
await self.b2c_login()
File “/usr/local/lib/python3.13/site-packages/aiophyn/partners/kohler.py”, line 123, in b2c_login
matches = re.search(r’code=([^&]+)', resp.headers[‘Location’])
~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: ‘Location’

Thanks for the logs. I just released a new version that should fix this for you.

Awesome, thanks!! All fixed.