Logger: homeassistant.config
Source: config.py:464
First occurred: 5:08:41 PM (3 occurrences)
Last logged: 5:19:35 PM
Invalid config for [sensor.template]: [attributes] is an invalid option for [sensor.template]. Check: sensor.template->sensors->pl_low_btc->attributes. (See /config/integrations/…/entities/sensors/stocks_templates.yaml, line 0). Please check the docs at Template - Home Assistant
You’re right; that was due to my mistake. I forgot to wrap the sensor’s entity_id in quotes. I have corrected the example above.
BTW, be advised that it’s preferable to use the states() to get an entity’s state value as opposed to attempting to get it directly using this format: states.sensor.whatever.state
The reason is because if the entity doesn’t exist, the template fails with an error. In contrast, states() will simply report None and the template continues with its evaluation. For more information, refer to the States section of the documentation.