Closed pperle closed 1 month ago
Additionally, the state_class
attribute has been added in accordance with Home Assistant’s energy view requirements, ensuring the sensors can be properly displayed in the energy dashboard.
lot of errors in the log:
Logger: homeassistant.helpers.entity Source: helpers/entity.py:942 First occurred: 20:05:25 (63 occurrences) Last logged: 20:06:55
Update for sensor.energy_consumed_at_last_reset_2 fails Update for sensor.time_of_last_energy_reset fails Update for sensor.time_of_last_energy_reset_2 fails Update for sensor.time_energy_consumed_last_updated_2 fails Update for sensor.battery_percentage_2 fails Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 404, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1061, in _validate_conn conn.connect() File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 419, in connect self.sock = ssl_wrapsocket( ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/util/ssl.py", line 462, in ssl_wrap_socket ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_intls) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/util/ssl.py", line 504, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/ssl.py", line 455, in wrap_socket return self.sslsocket_class._create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/ssl.py", line 1042, in _create self.do_handshake() File "/usr/local/lib/python3.12/ssl.py", line 1320, in do_handshake self._sslobj.do_handshake() TimeoutError: _ssl.c:983: The handshake operation timed out
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 802, 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 770, in reraise raise value File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 716, in urlopen httplib_response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 407, in _make_request self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 358, in _raise_timeout raise ReadTimeoutError( urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='192.168.179.71', port=8443): Read timed out. (read timeout=10)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/config/custom_components/dirigera_platform/base_classes.py", line 76, in async_update self._json_data = await self._hass.async_add_executor_job(self._get_by_id_fx, self._json_data.id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/hub/hub.py", line 229, in get_outlet_by_id outlet = self._get_device_data_byid(id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/hub/hub.py", line 158, in _get_device_data_byid return self.get("/devices/" + id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/hub/hub.py", line 112, in get response = requests.get( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, 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 713, in send raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='192.168.179.71', port=8443): Read timed out. (read timeout=10)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update await self.async_update() File "/config/custom_components/dirigera_platform/base_classes.py", line 141, in async_update await self._device.async_update() File "/config/custom_components/dirigera_platform/base_classes.py", line 80, in async_update raise HomeAssistantError(ex, DOMAIN, "hub_exception") homeassistant.exceptions.HomeAssistantError: (ReadTimeout(ReadTimeoutError("HTTPSConnectionPool(host='192.168.179.71', port=8443): Read timed out. (read timeout=10)")), 'dirigera_platform', 'hub_exception')
Logger: homeassistant.helpers.entity Source: helpers/entity.py:942 First occurred: 20:05:25 (18 occurrences) Last logged: 20:06:25
Update for sensor.multi_sensor_voc_index fails Update for sensor.multi_sensor_humidity fails Update for sensor.multi_sensor_temperature fails Update for sensor.multi_sensor_current_pm2_5 fails Update for sensor.multi_sensor_max_measured_pm2_5 fails Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 404, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1061, in _validate_conn conn.connect() File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 419, in connect self.sock = ssl_wrapsocket( ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/util/ssl.py", line 462, in ssl_wrap_socket ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_intls) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/util/ssl.py", line 504, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/ssl.py", line 455, in wrap_socket return self.sslsocket_class._create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/ssl.py", line 1042, in _create self.do_handshake() File "/usr/local/lib/python3.12/ssl.py", line 1320, in do_handshake self._sslobj.do_handshake() TimeoutError: _ssl.c:983: The handshake operation timed out
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 802, 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 770, in reraise raise value File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 716, in urlopen httplib_response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 407, in _make_request self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 358, in _raise_timeout raise ReadTimeoutError( urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='192.168.179.71', port=8443): Read timed out. (read timeout=10)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/config/custom_components/dirigera_platform/sensor.py", line 174, in async_update self._json_data = await self._hass.async_add_executor_job(self._hub.get_environment_sensor_by_id, self._json_data.id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/hub/hub.py", line 245, in get_environment_sensor_by_id environment_sensor = self._get_device_data_byid(id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/hub/hub.py", line 158, in _get_device_data_byid return self.get("/devices/" + id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/hub/hub.py", line 112, in get response = requests.get( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, 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 713, in send raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='192.168.179.71', port=8443): Read timed out. (read timeout=10)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update await self.async_update() File "/config/custom_components/dirigera_platform/base_classes.py", line 141, in async_update await self._device.async_update() File "/config/custom_components/dirigera_platform/sensor.py", line 181, in async_update raise HomeAssistantError(ex, DOMAIN, "hub_exception") homeassistant.exceptions.HomeAssistantError: (ReadTimeout(ReadTimeoutError("HTTPSConnectionPool(host='192.168.179.71', port=8443): Read timed out. (read timeout=10)")), 'dirigera_platform', 'hub_exception')
Logger: homeassistant.components.sensor.recorder Source: components/sensor/recorder.py:254 integration: Sensor (documentation, issues) First occurred: 20:05:10 (4 occurrences) Last logged: 20:05:10
The unit of sensor.total_energy_consumed (kWh) cannot be converted to the unit of previously compiled statistics (V). Generation of long term statistics will be suppressed unless the unit changes back to V or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this The unit of sensor.energy_consumed_at_last_reset (kWh) cannot be converted to the unit of previously compiled statistics (V). Generation of long term statistics will be suppressed unless the unit changes back to V or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this The unit of sensor.total_energy_consumed_2 (kWh) cannot be converted to the unit of previously compiled statistics (V). Generation of long term statistics will be suppressed unless the unit changes back to V or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this The unit of sensor.energy_consumed_at_last_reset_2 (kWh) cannot be converted to the unit of previously compiled statistics (V). Generation of long term statistics will be suppressed unless the unit changes back to V or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
and more
Merged
Corrected the classification of energy sensors that were incorrectly identified as power sensors. This change updates the unit of measurement from volts (
V
) to kilowatt-hours (kWh
) and corrects the device class fromSensorDeviceClass.POWER
toSensorDeviceClass.ENERGY
.