cyberjunky / home-assistant-custom-components

My custom components for Home Assistant
MIT License
71 stars 19 forks source link

error message when BoilerInTemp is null #22

Closed wwolkers closed 5 years ago

wwolkers commented 5 years ago

my boilerstatus gives an error constantly:

2019-03-10 17:46:34 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.toon_boiler_intemp fails Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 220, in async_update_ha_state await self.async_device_update() File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 348, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/toon_boilerstatus/sensor.py", line 161, in update self._state = float(boilerstatus["boilerInTemp"]) TypeError: float() argument must be a string or a number, not 'NoneType'

of course I should comment out the boilerInTemp in my config, but it would be nice if this was not an error but a warning, with some information in there.

Here's my boilervalues.txt

{"sampleTime":"10-03-2019 17:45:00","boilerSetpoint":28.44,"roomTempSetpoint":20.5,"boilerPressure":6,"roomTemp":20.5,"boilerOutTemp":36,"boilerInTemp":null,"boilerModulationLevel":11}

cyberjunky commented 5 years ago

Wouter, I have added checks for all values now. Does it solve your issue too?

wwolkers commented 5 years ago

The error is gone yes, this issue can be closed.