core icon indicating copy to clipboard operation
core copied to clipboard

P1 Monitor integration does not work with version 2022.9.5

Open josb1905 opened this issue 1 year ago • 7 comments

The problem

The P 1Monitor integration work perfect with HA core version 2022.8.7 when upgrade it to version 2022.9.5 the integration fails.

None of the "sensor.p1_monitor_power... " sensors are available in version 2022.9.5. When restore back of version 2022.8.7 the sensors are available again.

What version of Home Assistant Core has the issue?

2022.9.5

What was the last working version of Home Assistant Core?

2022.8.7

What type of installation are you running?

Home Assistant OS

Integration causing the issue

P1 Monitor

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

josb1905 avatar Sep 19 '22 15:09 josb1905

Added log information:

2022-09-19 16:46:35.004 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Timeout occurred while connecting to P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 66, in request response = await self.session.request( File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 559, in _request await resp.start(conn) File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 898, in start message, payload = await protocol.read() # type: ignore[union-attr] File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 616, in read await self._waiter asyncio.exceptions.CancelledError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 65, in request async with timeout(self.request_timeout): File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 129, in aexit self._do_exit(exc_type) File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 212, in _do_exit raise asyncio.TimeoutError asyncio.exceptions.TimeoutError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 84, in _async_update_data SERVICE_SMARTMETER: await self.p1monitor.smartmeter(), File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 98, in smartmeter data = await self.request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Timeout occurred while connecting to P1 Monitor device 2022-09-19 17:04:49.007 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Timeout occurred while connecting to P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 66, in request response = await self.session.request( File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 559, in _request await resp.start(conn) File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 898, in start message, payload = await protocol.read() # type: ignore[union-attr] File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 616, in read await self._waiter asyncio.exceptions.CancelledError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 65, in request async with timeout(self.request_timeout): File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 129, in aexit self._do_exit(exc_type) File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 212, in _do_exit raise asyncio.TimeoutError asyncio.exceptions.TimeoutError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 84, in _async_update_data SERVICE_SMARTMETER: await self.p1monitor.smartmeter(), File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 98, in smartmeter data = await self.request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Timeout occurred while connecting to P1 Monitor device 2022-09-19 17:56:33.006 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Timeout occurred while connecting to P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 66, in request response = await self.session.request( File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 559, in _request await resp.start(conn) File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 898, in start message, payload = await protocol.read() # type: ignore[union-attr] File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 616, in read await self._waiter asyncio.exceptions.CancelledError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 65, in request async with timeout(self.request_timeout): File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 129, in aexit self._do_exit(exc_type) File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 212, in _do_exit raise asyncio.TimeoutError asyncio.exceptions.TimeoutError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 84, in _async_update_data SERVICE_SMARTMETER: await self.p1monitor.smartmeter(), File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 98, in smartmeter data = await self.request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Timeout occurred while connecting to P1 Monitor device

josb1905 avatar Sep 19 '22 16:09 josb1905

Hey there @klaasnicolaas, mind taking a look at this issue as it has been labeled with an integration (p1_monitor) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

Which version of P1 Monitor are you using? My HA development instance (2022.10.dev) works fine with P1 Monitor (1.3.1), at the moment I can't get anything from the logs that can help me further with debugging.

klaasnicolaas avatar Sep 19 '22 17:09 klaasnicolaas

The system and P1 Monitor information as requested:

Besturingsysteem versie:Linux-5.4.72+-armv6l-with-debian-10.6 Python versie:3.7.3

P1 Mon Versie:202012-1.0.0

Software patch:1 CPU model:ARMv6-compatible processor rev 7 (v6l) CPU hardware:BCM2835 CPU revision:9000c1 Raspberry Pi model:Raspberry Pi Zero W Rev 1.1

josb1905 avatar Sep 19 '22 18:09 josb1905

Add more log info. The PI monitor has no watermeter connected. 2022-09-20 18:22:18.195 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:22:18.199 WARNING (MainThread) [homeassistant.config_entries] Config entry 'P1 Monitor' for p1_monitor integration not ready yet: Error occurred while communicating with P1 Monitor device; Retrying in background 2022-09-20 18:22:18.765 WARNING (MainThread) [homeassistant.components.tuya] Unknown HVAC mode 'eco' for device Badkamer; assuming it as off 2022-09-20 18:22:18.769 WARNING (MainThread) [homeassistant.components.tuya] Unknown HVAC mode 'eco' for device Hal; assuming it as off 2022-09-20 18:22:18.773 WARNING (MainThread) [homeassistant.components.tuya] Unknown HVAC mode 'eco' for device Eethoek; assuming it as off 2022-09-20 18:22:19.579 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:22:30.020 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:22:50.661 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:23:30.990 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:24:45.842 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:24:45.843 WARNING (MainThread) [homeassistant.config_entries] Config entry 'P1 Monitor' for p1_monitor integration not ready yet: Error occurred while communicating with P1 Monitor device; Retrying in background 2022-09-20 18:24:51.838 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:25:46.751 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:25:46.752 WARNING (MainThread) [homeassistant.config_entries] Config entry 'P1 Monitor' for p1_monitor integration not ready yet: Error occurred while communicating with P1 Monitor device; Retrying in background 2022-09-20 18:25:52.325 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:26:02.606 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:26:23.448 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:27:04.074 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:28:24.381 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:29:45.075 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:30:22.967 ERROR (Thread-6 (_thread_main)) [tuya_iot] Unexpected disconnection.16 2022-09-20 18:30:22.974 ERROR (Thread-6 (_thread_main)) [tuya_iot] Unexpected disconnection.16 2022-09-20 18:31:06.704 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:32:27.029 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:33:47.415 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device 2022-09-20 18:35:07.765 ERROR (MainThread) [homeassistant.components.p1_monitor] Unexpected error fetching p1_monitor data: Error occurred while communicating with P1 Monitor device Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 74, in _request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('http://192.168.178.53/api/v2/watermeter/day?json=object&limit=1') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/p1_monitor/init.py", line 102, in _async_update_data data[SERVICE_WATERMETER] = await self.p1monitor.watermeter() File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 132, in watermeter data = await self._request( File "/usr/local/lib/python3.10/site-packages/p1monitor/p1monitor.py", line 80, in _request raise P1MonitorConnectionError( p1monitor.exceptions.P1MonitorConnectionError: Error occurred while communicating with P1 Monitor device

josb1905 avatar Sep 20 '22 16:09 josb1905

So it tries to request the water meter data but failed, but the integration should be able to deal with it and stops requesting the water meter if no water meter has been connected to P1 monitor. What do you see when you open the API url?

klaasnicolaas avatar Sep 20 '22 18:09 klaasnicolaas

I think I now know where it goes wrong, a fix is being worked on 😉

klaasnicolaas avatar Sep 21 '22 14:09 klaasnicolaas

That is good news.

josb1905 avatar Sep 23 '22 18:09 josb1905

@klaasnicolaas any progress on this issue?

HarryKodden avatar Sep 27 '22 19:09 HarryKodden

There is a PR open to fix it, but I haven't been able to adjust the tests for it yet: https://github.com/klaasnicolaas/python-p1monitor/pull/233

After that it's just version bumping here in core and it's solved 😉

klaasnicolaas avatar Sep 27 '22 19:09 klaasnicolaas

I still want to do some extra testing with an instance where it goes wrong to make sure I haven't missed anything, can one of you contact me via Discord (Mister Nicolaz#7558) or the community forum?

klaasnicolaas avatar Sep 27 '22 21:09 klaasnicolaas

Hi Klaasnicolaas, I have time to test the fix. Let me know where I can download the new instance with the fix.

Kind regards, Josb

josb1905 avatar Sep 28 '22 08:09 josb1905

That's not how it goes, I want to test directly from the python package with a device that has problems (hence the request for a DM). The instances that I always test with so far do not give any problems with and without a water meter, but they do run a newer version of P1 Monitor.

klaasnicolaas avatar Sep 28 '22 09:09 klaasnicolaas

An update on the progress to resolve this issue.

By default, the integration automatically checks whether you are using a water meter, if so you will get those entities, if not it will be ignored. With the latest versions of P1 Monitor you get a 200 request with an empty list [], but with older versions the request gets a 404 and that situation is not taken into account in both the package and the integration.

As a result, whoever runs an older version of P1 Monitor will receive an error and the integration will not handle this properly.

Expect it to not take long for a fix to be released.

klaasnicolaas avatar Nov 04 '22 16:11 klaasnicolaas