Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unavailable Sensors After Adding Second Pool #9

Open
OtisPresley opened this issue Oct 3, 2024 · 4 comments
Open

Unavailable Sensors After Adding Second Pool #9

OtisPresley opened this issue Oct 3, 2024 · 4 comments

Comments

@OtisPresley
Copy link

OtisPresley commented Oct 3, 2024

Thanks for adding the capability to add a second pool. I got my second WaterGuru device a couple days ago. When I added it to the app and then reloaded HA, there are some sensors that are now unavailable as follows:

  • Last Measured for the first pool
  • Status for the first pool
  • Free Chlorine for the second pool
  • Free Chlorine Alert for the second pool

That is all I can see. The second pool is a covered spa, so there will be no sensor created for Cyanuric Acid or for Salt. Please let me know what else may be needed.

Log message 1:
`Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:595
integration: Sensor (documentation, issues)
First occurred: 4:50:12 PM (2 occurrences)
Last logged: 4:50:12 PM

Error adding entity sensor.waterguru_spa_free_chlorine for domain sensor with platform waterguru
Error adding entity sensor.waterguru_spa_free_chlorine_alert for domain sensor with platform waterguru
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 595, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 909, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1366, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1071, in __async_calculate_state
if extra_state_attributes := self.extra_state_attributes:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/waterguru/sensor.py", line 226, in extra_state_attributes
a[WaterGuruEntityAttributes.ADVICE] = m.get("alerts")[0].get("advice").get("action").get("summary")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'`

Log message 2:
`This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/waterguru/sensor.py:226
integration: WaterGuru (documentation)
First occurred: 5:20:20 PM (1 occurrences)
Last logged: 5:20:20 PM

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 533, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1071, in __async_calculate_state
if extra_state_attributes := self.extra_state_attributes:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/waterguru/sensor.py", line 226, in extra_state_attributes
a[WaterGuruEntityAttributes.ADVICE] = m.get("alerts")[0].get("advice").get("action").get("summary")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'`

@dwradcliffe
Copy link
Owner

This is not surprising, but we can fix this. Can you send the current diagnostics file?

@dwradcliffe
Copy link
Owner

I've pushed a fix for these specific errors but we might run into more.

@OtisPresley
Copy link
Author

OtisPresley commented Oct 6, 2024

home-assistant_2024-10-06T16-56-49.921Z.log

Hi @dwradcliffe. here is the full log after updating the addon, enabling Debug Logging, and restarting HA. It doesn't look like it is producing errors, but the Last Measured and Status sensors on the original pool are still missing.

The Free Chlorine sensors for the second pool are now showing up normally. Thanks!

image

@OtisPresley
Copy link
Author

Hi @dwradcliffe, this is getting more strange. I recently restarted for HA updates and now am seeing in the first pool, Saturation Index and Saturation Index Alert also missing with no log entries. I restarted HA again just to make sure, and they are still missing.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants