After update to 2024.8 some REST sensor stopped to be created and throws errors into log file. Sensors that are affected contains templated icon attribute. Sensor is visible in Developer Tools->Satets with old, not update value, but with no icon attribute. The same sensor with removed code for icon works fine. Icon template moved to state value (value_template) works fine, so it is not template error (anyhow was working properly in previous versions of core)
What version of Home Assistant Core has the issue?
2024.8
What was the last working version of Home Assistant Core?
2024-08-10 08:56:56.324 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity sensor.condition_0 for domain sensor with platform rest
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 598, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 912, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1365, in add_to_platform_finish
await self.async_added_to_hass()
File "/usr/src/homeassistant/homeassistant/helpers/trigger_template_entity.py", line 162, in async_added_to_hass
await super().async_added_to_hass()
File "/usr/src/homeassistant/homeassistant/components/rest/entity.py", line 43, in async_added_to_hass
self._update_from_rest_data()
File "/usr/src/homeassistant/homeassistant/components/rest/sensor.py", line 187, in _update_from_rest_data
self._process_manual_data(raw_value)
File "/usr/src/homeassistant/homeassistant/helpers/trigger_template_entity.py", line 250, in _process_manual_data
self._render_templates(variables)
File "/usr/src/homeassistant/homeassistant/helpers/trigger_template_entity.py", line 190, in _render_templates
rendered[key] = self._config[key].async_render(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 597, in async_render
compiled = self._compiled or self._ensure_compiled(limited, strict, log_fn)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 798, in _ensure_compiled
assert self.hass is not None, "hass variable not set on template"
^^^^^^^^^^^^^^^^^^^^^
AssertionError: hass variable not set on template
The problem
After update to 2024.8 some REST sensor stopped to be created and throws errors into log file. Sensors that are affected contains templated icon attribute. Sensor is visible in Developer Tools->Satets with old, not update value, but with no icon attribute. The same sensor with removed code for icon works fine. Icon template moved to state value (value_template) works fine, so it is not template error (anyhow was working properly in previous versions of core)
What version of Home Assistant Core has the issue?
2024.8
What was the last working version of Home Assistant Core?
2024.7 (I think)
What type of installation are you running?
Home Assistant OS
Integration causing the issue
RESTful sensor
Link to integration documentation on our website
https://www.home-assistant.io/integrations/sensor.rest/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response