It’s still returning unavailable
.
I wasn’t aware of the Reload Templates requirement but I did that and it returned unavailable
and the 2 below errors in the log:
Logger: homeassistant.components.sensor
Source: core.py:1225
Integration: Sensor (documentation, issues)
First occurred: 8:31:29 PM (4 occurrences)
Last logged: 8:34:59 PM
Error adding entities for domain sensor with platform template
Error while setting up template platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 455, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 731, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 844, in add_to_platform_finish
await self.async_added_to_hass()
File "/usr/src/homeassistant/homeassistant/components/template/sensor.py", line 224, in async_added_to_hass
await super().async_added_to_hass()
File "/usr/src/homeassistant/homeassistant/helpers/template_entity.py", line 408, in async_added_to_hass
await self._async_template_startup()
File "/usr/src/homeassistant/homeassistant/helpers/template_entity.py", line 379, in _async_template_startup
result_info.async_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 953, in async_refresh
self._refresh(None)
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1133, in _refresh
self.hass.async_run_hass_job(self._job, event, updates)
File "/usr/src/homeassistant/homeassistant/core.py", line 607, in async_run_hass_job
hassjob.target(*args)
File "/usr/src/homeassistant/homeassistant/helpers/template_entity.py", line 348, in _handle_results
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 706, in _async_write_ha_state
hass.states.async_set(entity_id, state, attr, self.force_update, self._context)
File "/usr/src/homeassistant/homeassistant/core.py", line 1576, in async_set
state = State(
File "/usr/src/homeassistant/homeassistant/core.py", line 1225, in __init__
raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.unavailable_entities. State max length is 255 characters.
Logger: homeassistant
Source: core.py:1225
First occurred: 8:31:30 PM (2 occurrences)
Last logged: 8:35:00 PM
Error doing job: Exception in callback None()
Traceback (most recent call last):
File "/usr/local/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1133, in _refresh
self.hass.async_run_hass_job(self._job, event, updates)
File "/usr/src/homeassistant/homeassistant/core.py", line 607, in async_run_hass_job
hassjob.target(*args)
File "/usr/src/homeassistant/homeassistant/helpers/template_entity.py", line 348, in _handle_results
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 706, in _async_write_ha_state
hass.states.async_set(entity_id, state, attr, self.force_update, self._context)
File "/usr/src/homeassistant/homeassistant/core.py", line 1576, in async_set
state = State(
File "/usr/src/homeassistant/homeassistant/core.py", line 1225, in __init__
raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.unavailable_entities. State max length is 255 characters.