francispoisson / hilo

Hilo integration for Home Assistant
The Unlicense
26 stars 8 forks source link

Most thermostat temperatures showing 0 degrees + Errors in the log #51

Closed MsMaximeSeguin closed 2 years ago

MsMaximeSeguin commented 2 years ago

Hello,

I recently updated HA and encountered this bug where all the Temps are showing 0°c.

I'm running HA 2021.11.5 on docker and the most recent version of this repo. Last version was 2021.11.1 and appeared to be working well? Not sure though. I tried reverting back to an earlier version of the custom component and it's still appear to do the same.

When checking in the logs I got 2 error and 1 warning.

Thanks, Maxime

home-assistant.log

Logger: homeassistant.components.sensor Source: custom_components/hilo/sensor.py:116 Integration: Sensor (documentation, issues) First occurred: 10:26:05 PM (2 occurrences) Last logged: 10:26:05 PM

Error adding entities for domain sensor with platform hilo Error while setting up hilo platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 607, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 715, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 486, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 519, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 492, in _stringify_state if (state := self.state) is None: File "/config/custom_components/hilo/sensor.py", line 116, in state return str(int(self._get("Power", 0))) TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'


Logger: homeassistant.helpers.entity Source: custom_components/hilo/api.py:253 Integration: Hilo HA integration (documentation, issues) First occurred: 10:26:35 PM (2 occurrences) Last logged: 10:27:35 PM

Update for binary_sensor.defi_hilo fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 468, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 658, in async_device_update raise exc File "/config/custom_components/hilo/binary_sensor.py", line 37, in _async_update self._state = await self.d._h.get_events() File "/config/custom_components/hilo/api.py", line 253, in get_events start_time = datetime.strptime(r.get("startTimeUTC"), "%Y-%m-%dT%H:%M:%SZ")\ TypeError: strptime() argument 1 must be str, not None


This error originated from a custom integration.

Logger: custom_components.hilo.api Source: custom_components/hilo/api.py:320 Integration: Hilo HA integration (documentation, issues) First occurred: 10:26:05 PM (28 occurrences) Last logged: 10:28:06 PM

check_tarif: Unable to find state for sensor.hilo_energy_total_daily_low

valleedelisle commented 2 years ago

This should be fixed with PR #54.

Regarding sensor.hilo_energy_total_daily_low, this is just a warning. It's to address a race condition where some devices are init'd before the energy sensors are initialized. You should see this only after home assistant is restarted. We should probably remove them at some point.