jordanruthe / homeassistant-phyn Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mizterb/homeassistant-phyn
This project forked from mizterb/homeassistant-phyn
Please look if need merge "Water flow rate class update" patches from pull request from fork by @timbba80 here -> timbba80#1
PS: @timbba80 also have merged a Finish (FI) language translation to his fork as part of that pull request.
If possible please see if can implement a check for software updates and an option to initiate the software update if available.
PS: The goal would be to not have to use the Pyth app to perform software updates.
Copy from feature request submitted to upstream by @starsoccer -> MizterB#9
Curious if there are any plans to add support for water entities to this integration. For instance if phyn thinks a shower is on it would be nice if there was shower entity that would be represented showing its active and(assuming possible), how much water its using
I have not installed yet, but I'm guessing the URL for the repository in the README is wrong, and it should be this repo?
HomeAssistant converts US customary units to Metric units automatically in many cases. Unfortunately not all, and with the new brilliant capabilities to see real time values such as real time flow, this becomes more visible. The flow is set to gpm - Gallons per minute. In a metric setup, this should be converted to "l/min" - Liters per minute - (or "lpm" depending on source).
Even better if it would be possible to set on your own to use "bar" instead of "kPa", if that feels like a more natural unit for pressure in water systems at least to me...
Of course both of these can be circumvented through helpers or templates, but if there is a way to make at least the first happen automatically to honor the system settings, then that would at least clearly be useful.
Requesting control to enable and disable the ”automatic shutoff” function to turn it OFF or ON.
Request support for Phyn Smart Water Sensor (PW1) leak detection product -> https://phyn.com/products/smart-water-sensor
FYI, @opq8 has implemented it in his fork here:
https://github.com/opq8/homeassistant-phyn/tree/development
https://github.com/opq8/homeassistant-phyn/blob/development/README.md
Phyn Smart Water Sensor (PW1):
Coming soon!
The following warning is appearing in system logs:
Entity sensor.phyn_pp1_current_water_flow_rate (<class 'custom_components.phyn.devices.pp.PhynCurrentFlowRateSensor'>) is using state class 'measurement' which is impossible considering device class ('water') it is using; expected None or one of 'total_increasing', 'total'; Please update your configuration if your entity is manually configured, otherwise report it to the author of the 'phyn' custom integration
The warning is resolved if class PhynCurrentFlowRateSensor (in pp.py) is updated from:
_attr_device_class = SensorDeviceClass.WATER to:
_attr_device_class = SensorDeviceClass.VOLUME_FLOW_RATE
Can currently only see sensors for the average water flow-rate, water pressure, water temperature in this Phyn integration.
Is it possible to add real-time sensors as well for the water flow-rate, the water pressure, and the water temperature?
At least the water pressure and water temperature need to be real-time to be of any real use as those are key values to keep track of to prevent leaks or damage to appliances and frozen pipe bursts.
PS: The original Phyn app/software does show real-time data and for example warns of "High Base Pressure Alert" if the average water pressure is higher than 80 psi over the past 24-hour period or warns of "High-Pressure Warning" if the water pressure is much higher than normal for more than 1-minute and gives the recommendation to install a PRV (Pressure Reducing Valve), just as it gives a "Freeze Warning" or "Freeze Emergency" warnings depending if the temperature is too low or a combination of lower temperature and high pressure during a shorter period.
References:
https://phynsupport.my.salesforce-sites.com/FAQ/article_Datacategory1?id=3
https://helpcenter.phyn.com/help/what-is-a-pressure-regulating-valve-prv
Please consider also supporting classic Phyn Smart Water Assistant with Cold and Hot Water Lines; Phyn Smart Water Assistant (PC1):
https://phyn.com/products/phyn
FYI, kasik96 has a pull request for it here which adds initial support for the original project -> MizterB#14
PS: Good idea is to combine Phyn Smart Water Assistant (PC1) with Phyn Plus (PP1/PP2) to get both hot and cold + shutoff valve.
Copy of bug report from @snairolf to upstream MizterB#7 in regards to the "Phyn Smart Water Sensor" leak sensor type product which also features air temperature
and air humidity
sensors in addition to the water leak detector sensor -> https://phyn.com/products/smart-water-sensor
The smart sensors seem to expose 'daily water usage', 'average water flow rate', 'average water pressuer', 'average water temperature', whereas in the app 'air temperature' and 'air humidity' and 'detected leak' are shown.
Here is the dump for a sensor:
{'auto_shutoff_eligible': 0, 'auto_shutoff_enable': True, 'battery_level': {'ts': 1693731332897, 'v': 75}, 'created_ts': 1654705582265, 'device_id': 'REMOVED', 'fw_version': '10803000', 'humidity': {'ts': 1693731329, 'v': 61}, 'hw_version': '0', 'name': 'Kitchen Sink', 'network_name': 'REMOVED', 'online_status': {'ts': 1684124769281, 'v': 'online'}, 'partner': 'phyn', 'product_code': 'PW1', 'sd_status': {'ts': 1693731332897, 'v': 'G'}, 'serial_number': 'REMOVED', 'signal_strength': 73, 'temperature': {'ts': 1693731329, 'v': 82}, 'timezone': 'REMOVED', 'users': ['REMOVED']}
I keep getting connection errors and then the sensors don't update. Reloading the integration fixes it, but sometimes only for a few minutes. This is on v2024.1.3
Happy to help debug.
Hi. I tried to shift from the rsocko fork to this fork to get the latest features, but I get the following error after hot-replacing. Understandable in one way, but is there any way to fix this without starting from scratch. Tried starting from scratch as well, but that also did not work... My device is a Phyn.
Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 21:21:28 (2 occurrences)
Last logged: 21:22:35
Error setting up entry V10 for phyn
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/phyn/__init__.py", line 32, in async_setup_entry
phyn_brand=entry.data["Brand"].lower(), session=session,
~~~~~~~~~~^^^^^^^^^
KeyError: 'Brand'
Please implement the option to initiate a “Plumbing Check” and get a "Plumbing Check Leak" alert from Phyn’s Plumbing Check.
https://phynsupport.my.salesforce-sites.com/FAQ/article_detail1?id=ka01I000000S2rzQAC&Sid=1
https://phynsupport.my.salesforce-sites.com/FAQ/article_detail1?id=ka01I000000S2rfQAC&Sid=1
https://phynsupport.my.salesforce-sites.com/FAQ/article_detail1?id=ka01I000000S2raQAC&Sid=1
PS: If possible please also add an option to configure scheduling of automatic “Plumbing Check” as can do in the Phyn app.
Is it possible to fetch Alert Notifications for Phyn Plus similar to the Flume integration and make them available via binary sensors?
https://www.home-assistant.io/integrations/flume#notifications
https://www.home-assistant.io/integrations/flume
According to Phyn there should be alerts for the Phyn Plus 1st-gen and Phyn Plus 2nd-gen (unsure of other Phyn products):
Reference:
Request from @Hedda. This is now complete
Copy from issue posted to upstream by @pickett -> MizterB#3
I was getting an error when trying to first initialize saying User Not Found. I couldn't figure it out but then later realized that the Home Assistant UI on iPad defaults to first letter capitalized for email so if my email username with Phyn was "[email protected]" when I first typed it in, the iPad HA app made it "[email protected]".
Turns out, that was enough to cause an API error. So you might want to make everything lowercase on submit?
Suddenly started receiving "Failed to setup" with the following in the logs
2024-02-11 23:33:12.087 ERROR (MainThread) [custom_components.phyn] Unexpected error fetching phyn-coordinator data: 'NoneType' object is not iterable
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/phyn/update_coordinator.py", line 62, in _async_update_data
await device.async_update_data()
File "/config/custom_components/phyn/devices/pw.py", line 111, in async_update_data
await self._update_device()
File "/config/custom_components/phyn/devices/pw.py", line 136, in _update_device
self._water_statistics.update(item)
TypeError: 'NoneType' object is not iterable
2024-02-11 23:33:12.101 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Linwood for phyn
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/phyn/__init__.py", line 75, in async_setup_entry
await coordinator.async_setup()
File "/config/custom_components/phyn/update_coordinator.py", line 68, in async_setup
await device.async_setup()
File "/config/custom_components/phyn/devices/pp.py", line 166, in async_setup
return self._device_state["sov_status"]["v"]
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'sov_status'
and this littered throughout the logs
2024-02-12 10:34:53.259 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/phyn/devices/pp.py", line 253, in on_device_update
entity.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 966, in async_write_ha_state
raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for <entity unknown.unknown=unknown>
Integration version: v2024.1.6
Home Assistant Core: 2024.2.1
Supervisor: 2024.01.1
OS: 11.5
Frontend: 20240207.1
Please consider implementing the use of the new valve
entity to present shutoff valves as OPEN/CLOSE "valve" instead of as an ON/OFF "switch":
https://www.home-assistant.io/integrations/valve/
https://www.home-assistant.io/integrations/valve/#device-class
https://www.home-assistant.io/integrations/valve/#valve-control-services
https://www.home-assistant.io/integrations/valve/#service-valveset_position
This device type in Home Assistant is meant to provide a clearer defined interface to control valves such as water, gas, or air valves.
This might be a breaking change but not a huge change and it could be worth it to have a more properly suited device class.
If supported in then users can at least manually modify any switch
device type that controls a valve device type and device class so it is presented as a valve by changing it to valve
in the customize section of the UI or device config in configuration.yaml
:
https://www.home-assistant.io/docs/configuration/customizing-devices/
Initially this new valve entity so far support the following device classes:
Anyway, this new valve
entity, device class, and valve control services for use were added in Home Assistant 2024.1
https://www.home-assistant.io/blog/2024/01/03/release-20241/#new-entity-type-valve
Added by cibernox as entity type and device type for valves, which can be used by integrations to expose different type of valves.
A brand new entity type has been added to Home Assistant: Valve!
Integrations can use this entity type to expose valves, such as a valve on a radiator, pool, sprinkler system, and main house gas or water line.
Currently, the Shelly integration supports it and now provides a valve entity for the Valve addon for Shelly Gas AddOn Manipulator. Additionally, support for it has been added to MQTT, and the valve entities also work with Amazon Alexa and Google Assistant.
Tip: Do you have a switch entity that controls a valve? You can now change the entity type to valve in the entity settings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.