core: filter sensor component failing at start

Home Assistant release with the issue: 0.96.0

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.): Archlinux

Component/platform: Filter Sensor

Description of problem: After upgrade to 0.96.0 my filter sensor is no longer starting up.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

sensor:
  - platform: filter
    name: bathroom norm humidity
    entity_id: sensor.bathroom_relative_humidity
    filters:
      - filter: time_simple_moving_average
        window_size: 48:00:00
        precision: 1

Traceback (if applicable):

Jul 19 10:09:54 piggy hass[1877]: 2019-07-19 10:09:54 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform filter is taking over 10 seconds.
Jul 19 10:11:50 piggy hass[1877]: 2019-07-19 10:11:50 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Jul 19 10:11:50 piggy hass[1877]: Traceback (most recent call last):
Jul 19 10:11:50 piggy hass[1877]:   File "/usr/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 363, in _async_add_entity
Jul 19 10:11:50 piggy hass[1877]:     await entity.async_added_to_hass()
Jul 19 10:11:50 piggy hass[1877]:   File "/usr/lib/python3.7/site-packages/homeassistant/components/filter/sensor.py", line 223, in async_added_to_hass
Jul 19 10:11:50 piggy hass[1877]:     self._entity, prev_state, state, False)
Jul 19 10:11:50 piggy hass[1877]:   File "/usr/lib/python3.7/site-packages/homeassistant/components/filter/sensor.py", line 157, in filter_sensor_state_listener
Jul 19 10:11:50 piggy hass[1877]:     filtered_state = filt.filter_state(copy(temp_state))
Jul 19 10:11:50 piggy hass[1877]:   File "/usr/lib/python3.7/site-packages/homeassistant/components/filter/sensor.py", line 334, in filter_state
Jul 19 10:11:50 piggy hass[1877]:     filtered = self._filter_state(FilterState(new_state))
Jul 19 10:11:50 piggy hass[1877]:   File "/usr/lib/python3.7/site-packages/homeassistant/components/filter/sensor.py", line 485, in _filter_state
Jul 19 10:11:50 piggy hass[1877]:     * prev_state.state
Jul 19 10:11:50 piggy hass[1877]: TypeError: can't multiply sequence by non-int of type 'float'

Additional information:

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (6 by maintainers)

Most upvoted comments

Ok – So this is more an issue with the history recording. I had a 45GB big Sqllite3 database… Removing that seems to solve this problem.

Thanks for all the support!

To me it is very clear that the problem lies in sensor.bathroom_relative_humidity which is not providing a number but a sequence.

Can you use the developers tool to check the current state of sensor.bathroom_relative_humidity ? I’m betting it has a string instead of a number…