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

sensors stop updating #52

Open
dacorde opened this issue Jun 25, 2024 · 18 comments
Open

sensors stop updating #52

dacorde opened this issue Jun 25, 2024 · 18 comments

Comments

@dacorde
Copy link

dacorde commented Jun 25, 2024

From last 2 days I have realized temperature sensors get frozen with not data updated during hours. I looks to happen like twice per day. I have manually downgraded to 0.8.3 and it looks to work now.
Changes could be related, apart from 0.9.1., with HA 2024.6.4
Hardware: X245 - T-148
Anyone more with this issue?

@dave-code-ruiz
Copy link
Contributor

Can you try updating file to this PR??

kikediazfernandez@421e733

Please post results

@dacorde
Copy link
Author

dacorde commented Jun 27, 2024

Thanks for the provided solution!
After modified the line it looks to work and temperatures keep updated.
I will monitor it for a few hours and will post it only in case is not stopping.

imagen

@dacorde
Copy link
Author

dacorde commented Jun 28, 2024

Not working! after I reloaded integration with PR it stopped updating temperatures around 2 hours later.
Temperatures not updated from then and they are incorrect compared with thermostats.
WhatsApp Image 2024-06-28 at 09 26 36

@dave-code-ruiz
Copy link
Contributor

Ok, i need you to show logs here. i need you review ERROR and WARNINGS (and DEBUG if you can) it is posible something goes wrong here , i have not this model uponor and i can not test it in my home

Por cierto, es agradable encontrar españoles por aqui, saludos.

@dave-code-ruiz
Copy link
Contributor

please edit file manifest.json and add one line :

"iot_class": "local_polling",

@dacorde
Copy link
Author

dacorde commented Jun 28, 2024

I have added the above line to manifest.json and will reload.

Is this the way to add debug in config.yalm:
logger:
logs:
custom_components.uponor: debug

I will monitor it, but maybe I will need help how to extract warnings, errors and log data. I will ask if needed.

Saludos!!

@dacorde
Copy link
Author

dacorde commented Jun 28, 2024

Not updating sensor for around 1 hour.
`Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:1033
integration: Climate (documentation, issues)
First occurred: 18:23:00 (43 occurrences)
Last logged: 19:05:00

Updating uponor climate took longer than the scheduled update interval 0:01:00

This error originated from a custom integration.

Logger: custom_components.uponor.climate
Source: custom_components/uponor/climate.py:162
integration: Uponor (documentation, issues)
First occurred: 18:22:07 (5 occurrences)
Last logged: 18:22:25

Uponor thermostat was unable to update: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1259
First occurred: 18:21:41 (6 occurrences)
Last logged: 18:22:10

Update of switch.uponor_cooling_mode is taking over 10 seconds
Update of climate.dormitorio_principal is taking over 10 seconds
Update of climate.despacho_david is taking over 10 seconds
Update of climate.bano_principal is taking over 10 seconds
Update of climate.bano_naza is taking over 10 seconds

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:941
First occurred: 18:22:05 (2 occurrences)
Last logged: 18:22:05

Logger: homeassistant.components.switch
Source: helpers/entity_platform.py:1033
integration: Switch (documentation, issues)
First occurred: 18:22:01 (1 occurrences)
Last logged: 18:22:01

Updating uponor switch took longer than the scheduled update interval 0:00:30

Update for switch.uponor_away fails
Update for switch.uponor_cooling_mode fails
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 715, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 467, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 462, in _make_request
httplib_response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/http/client.py", line 1423, in getresponse
response.begin()
File "/usr/local/lib/python3.12/http/client.py", line 331, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/http/client.py", line 292, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/socket.py", line 707, in readinto
return self._sock.recv_into(b)
^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 801, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/util/retry.py", line 552, in increment
raise six.reraise(type(error), error, _stacktrace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/packages/six.py", line 769, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 715, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 467, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 462, in _make_request
httplib_response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/http/client.py", line 1423, in getresponse
response.begin()
File "/usr/local/lib/python3.12/http/client.py", line 331, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/http/client.py", line 292, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/socket.py", line 707, in readinto
return self._sock.recv_into(b)
^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1289, in async_device_update
await self.async_update()
File "/config/custom_components/uponor/switch.py", line 48, in async_update
await self._state_proxy.async_update()
File "/config/custom_components/uponor/init.py", line 287, in async_update
self._data = await self._hass.async_add_executor_job(lambda: self._client.get_data())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/uponor/init.py", line 287, in
self._data = await self._hass.async_add_executor_job(lambda: self._client.get_data())
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/UponorJnap/UponorJnap.py", line 9, in get_data
r = requests.post(url=self.url, headers={"x-jnap-action": "http://phyn.com/jnap/uponorsky/GetAttributes"},
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 682, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`

@ErikSabel
Copy link

Same problem overhere sinds a couple of days.
After stop intergration, and then re-activate, it works 1.5 days before it stops again

dave-code-ruiz added a commit to dave-code-ruiz/homeassistant-uponor that referenced this issue Jul 4, 2024
dave-code-ruiz added a commit to dave-code-ruiz/homeassistant-uponor that referenced this issue Jul 4, 2024
@dave-code-ruiz
Copy link
Contributor

dave-code-ruiz commented Jul 4, 2024

Can you try updating file to this PR??

#53

Please post results, i create warning messages if create a lot of api calls and i create new attribute last_update , i try to change update calls doing only one in same time

@dacorde
Copy link
Author

dacorde commented Jul 4, 2024

Once updated, it kept updating a couple of sensors temperature changes, but nothing again for a hour (I even put some heat of a sensor to force it but it was not updated). all warnings with las PR below (3rd one is a error I am highlighting).

I have to mention version 0.8.3 works in my case although this version just gives some message when I change thermostats but working well: Failed to call service climate/set_temperature. Detected that custom integration 'uponor' calls async_dispatcher_send from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#async_dispatcher_send at custom_components/uponor/__init__.py, line 156: async_dispatcher_send(self._hass, SIGNAL_UPONOR_STATE_UPDATE). Please report it to the author of the 'uponor' custom integration.
I am back to 0.8.3 until next try. Regarding the warning above, I made this change at line 156 init.py and this modified 0.8.3 is working perfect in my case (don't get me wrong I have no idea about python, it was chatGPT...)

        self._hass.async_add_job(async_dispatcher_send, self._hass, SIGNAL_UPONOR_STATE_UPDATE)
    #   Previous: async_dispatcher_send(self._hass, SIGNAL_UPONOR_STATE_UPDATE)

Log with last PR, following your intructions:

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1266
First occurred: 00:05:48 (1 occurrences)
Last logged: 00:05:48

Update of climate.bano_principal is taking over 10 seconds


Logger: homeassistant.components.switch
Source: helpers/entity_platform.py:1031
integration: Switch (documentation, issues)
First occurred: 00:13:10 (1 occurrences)
Last logged: 00:13:10

Updating uponor switch took longer than the scheduled update interval 0:00:30

___________
ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This error originated from a custom integration.

Logger: custom_components.uponor.climate
Source: custom_components/uponor/climate.py:163
integration: Uponor (documentation, issues)
First occurred: 00:13:05 (1 occurrences)
Last logged: 00:13:05

Uponor thermostat was unable to update: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

__________

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1266
First occurred: 00:12:48 (4 occurrences)
Last logged: 00:12:50

Update of climate.despacho_naza is taking over 10 seconds
Update of climate.bano_naza is taking over 10 seconds
Update of climate.cocina is taking over 10 seconds
Update of switch.uponor_away is taking over 10 seconds


Logger: homeassistant.components.switch
Source: helpers/entity_platform.py:1031
integration: Switch (documentation, issues)
First occurred: 00:17:10 (12 occurrences)
Last logged: 00:22:40

Updating uponor switch took longer than the scheduled update interval 0:00:30



Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:1031
integration: Climate (documentation, issues)
First occurred: 00:17:38 (6 occurrences)
Last logged: 00:22:38

Updating uponor climate took longer than the scheduled update interval 0:01:00


Logger: homeassistant.components.switch
Source: helpers/entity_platform.py:1031
integration: Switch (documentation, issues)
First occurred: 00:17:10 (35 occurrences)
Last logged: 00:34:10

Updating uponor switch took longer than the scheduled update interval 0:00:30


Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:1031
integration: Climate (documentation, issues)
First occurred: 00:17:38 (17 occurrences)
Last logged: 00:33:38

Updating uponor climate took longer than the scheduled update interval 0:01:00


Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:1031
integration: Climate (documentation, issues)
First occurred: 00:37:38 (12 occurrences)
Last logged: 00:48:38

Updating uponor climate took longer than the scheduled update interval 0:01:00



`Logger: homeassistant.components.switch

Source: helpers/entity_platform.py:1031
integration: Switch (documentation, issues)
First occurred: 00:37:10 (25 occurrences)
Last logged: 00:49:10

Updating uponor switch took longer than the scheduled update interval 0:00:30

dave-code-ruiz added a commit to dave-code-ruiz/homeassistant-uponor that referenced this issue Jul 5, 2024
@dave-code-ruiz
Copy link
Contributor

dave-code-ruiz commented Jul 5, 2024

Ok, You put me behind the clue, thanks (i use your chatGPT solution, hehe)

I create mix version between 0.8.3 and my PR, i update my PR with new commit changes.

Please try my PR version and post results

@dacorde
Copy link
Author

dacorde commented Jul 5, 2024

Already running new mix PR (3fdc4bb). First impressions (15min): sensors look to get updated, thermostast work and no log yet (even no warnings). I will follow-up it along the day.

I only have this general warning, realted to all future deprecations, most in 2025, to be considered in the future:

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:184
First occurred: 17:33:25 (16 occurrences)
Last logged: 17:40:52
Detected that custom integration 'uponor' calls async_add_job, which is deprecated and will be removed in Home Assistant 2025.4; Please review https://developers.home-assistant.io/blog/2024/03/13/deprecate_add_run_job for replacement options at custom_components/uponor/init.py, line 314: self._hass.async_add_job(async_dispatcher_send, self._hass, SIGNAL_UPONOR_STATE_UPDATE), please create a bug report at https://github.com/asev/homeassistant-uponor/issues

@dacorde
Copy link
Author

dacorde commented Jul 5, 2024

2 hours later, it is working Ok and there are not new logs.

@dave-code-ruiz
Copy link
Contributor

For thanks for collaboration:

Buy Me A Coffee

asev added a commit that referenced this issue Jul 5, 2024
@dave-code-ruiz
Copy link
Contributor

I only have this general warning, realted to all future deprecations, most in 2025, to be considered in the future:

Logger: homeassistant.helpers.frame Source: helpers/frame.py:184 First occurred: 17:33:25 (16 occurrences) Last logged: 17:40:52 Detected that custom integration 'uponor' calls async_add_job, which is deprecated and will be removed in Home Assistant 2025.4; Please review https://developers.home-assistant.io/blog/2024/03/13/deprecate_add_run_job for replacement options at custom_components/uponor/init.py, line 314: self._hass.async_add_job(async_dispatcher_send, self._hass, SIGNAL_UPONOR_STATE_UPDATE), please create a bug report at https://github.com/asev/homeassistant-uponor/issues

Ok, this week i will see it

@dave-code-ruiz
Copy link
Contributor

Hi @dacorde , can you try new PR file to solves deprecated call async_add_job ?

@dacorde
Copy link
Author

dacorde commented Jul 9, 2024

I have overwritten "init.py" with your PR.
When changing temperature I have the error below, although it works and temperature is updated in thermostat.

This error originated from a custom integration.

Logger: custom_components.uponor
Source: custom_components/uponor/__init__.py:301
integration: Uponor (documentation, issues)
First occurred: 23:36:20 (39 occurrences)
Last logged: 23:55:59

Uponor thermostat was unable to update: a coroutine was expected, got None
Uponor thermostat was unable to update: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Screenshot_2024-07-09-23-46-37-156_io homeassistant companion android

@dave-code-ruiz
Copy link
Contributor

Hi @dacorde , please, try new PR file to solves deprecated call async_add_job

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

3 participants