Hi community,
I need urgent help regarding this error which happens when trying to reload template entities (from the dev tools section):
Logger: homeassistant.components.websocket_api.http.connection
Source: setup.py:490
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 01:52:32 (3 occurrences)
Last logged: 02:19:25
[546186835808] unsupported operand type(s) for +=: 'float' and 'datetime.timedelta'
[547470548208] unsupported operand type(s) for +=: 'float' and 'datetime.timedelta'
[546987027824] unsupported operand type(s) for +=: 'float' and 'datetime.timedelta'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1820, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1857, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 874, in admin_handler
await result
File "/usr/src/homeassistant/homeassistant/components/template/__init__.py", line 51, in _reload_config
await async_reload_integration_platforms(hass, DOMAIN, PLATFORMS)
File "/usr/src/homeassistant/homeassistant/helpers/reload.py", line 53, in async_reload_integration_platforms
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/reload.py", line 98, in _resetup_platform
await _async_reconfig_platform(platform, root_config[integration_platform])
File "/usr/src/homeassistant/homeassistant/helpers/reload.py", line 138, in _async_reconfig_platform
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 238, in async_setup
await self._async_setup_platform(async_create_setup_task)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 299, in _async_setup_platform
with async_start_setup(hass, [full_name]):
File "/usr/local/lib/python3.10/contextlib.py", line 142, in __exit__
next(self.gen)
File "/usr/src/homeassistant/homeassistant/setup.py", line 490, in async_start_setup
setup_time[integration] += time_taken
TypeError: unsupported operand type(s) for +=: 'float' and 'datetime.timedelta'
I absolutely don’t get where that points at or originates from.
Template entities render fine when starting HA.
But once reloading them manually above error is shown…
…and ALL template entities are not rendering - meaning unavailable!
- I compared recent changes to all template entities (all my *.yaml files) and could only find these added lines to three template sensors:
a.
availability: "{{ states('sensor.network_throughput_in_end0') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] }}"
b.
availability: "{{ states('sensor.network_throughput_out_end0') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] }}"
c.
availability_template: >-
{{
states('sensor.plug_a') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] and
states('sensor.plug_b') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] and
states('sensor.plug_c') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] and
states('sensor.plug_d') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] and
states('sensor.plug_e') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] and
states('sensor.plug_f') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] and
states('sensor.plug_g') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] and
states('sensor.plug_h') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] and
states('sensor.plug_i') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] and
states('sensor.plug_j') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] and
states('sensor.plug_k') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', ''] and
states('sensor.plug_l') not in ['NULL', 'null', 'none', 'undefined', 'unavailable', 'unknown', '']
}}
I don’t think that’s relevant, isn’t it.
-
2nd change due to a HA restart after 15 days: custom integrations have been updated. Also not relevant as this error is about template entities, right?
-
3rd change was adding a device to an integration. Also not related to template entities at all I think.