I have a load of template sensors that need to have their entity_id added following the 0.81 upgrade. This is largely down to my garden irrigation system which has two cycles, each with five zones so generating many tens of templated sensors which are used in the front end display.
It is intuitively obvious that where possible using the new homeassistant.update_entity service would be more efficient than including the entity_id - Is this correct and if so is the benefit significant enough to think about?
Also: I thought I should just check; here is an example of one of my template senors. The input_booloean is set by the user, the input_datetime is set by an automation/script. Am I right in thinking that I need to include both of these as entity_ids in the template?
This is a HUGE breaking change for me. luckily I have until next summer to sort it all out!!!
I just looked a bit more closely at the error in the log and it only refers to the icon template. Why is that? This has confused me even more…
I think considering the reach of this breaking change the documentation has not been good…
2018-10-31 08:38:53 WARNING (MainThread) [homeassistant.components.sensor.template] Template sensor cycle1_next_run_time has no entity ids configured to track nor were we able to extract the entities to track from the icon template(s). This entity will only be able to be updated manually.
fwiw with template sensors, and not needing to change the icon,I always set the (fixed) icon through customize, since template sensors don’t have the option of a fixed icon.
@Mariusthvdb is correct. You aren’t using a template in your icon_template. The logs are telling you “Hey I can’t find an entity_id in this template”. Your other template has one, so it won’t complain.
The proper way to adjust an icon (without a template) is through the customize section:
Or… hang on…
Are you saying that this template_sensor is all ok as far as the value_template bit is concerned and that HA was only complaining about the icon bit? Which would make sense of the error message, show up my lack of understanding and mean I have edited a load of my sensors for no reason!
What about if i have a friendly_name_template? Tried moving it to customize (Using packages) - it appears it doesn’t take templates or i am missing something?
WARNING: Template sensor xxx has no entity ids configured to track nor were we able to extract the entities to track from the friendly_name template(s). This entity will only be able to be updated manually.
I Believe hass is complaining about this ‘friendly_name_template’ - Tried moving it to customize but it didn’t work - I suppose ‘friendly_name_template’ is supported under customize?
forecast_1:
friendly_name_template: >
{%- set date = as_timestamp(now()) + (1 * 86400 ) -%}
{{ date | timestamp_custom("Tomorrow (%d/%m)") | replace("(0", "(") | replace("/0", "/") }}
value_template: >
{{states.sensor.dark_sky_daytime_high_temperature_1.state|round(0)}}°/{{states.sensor.dark_sky_overnight_low_temperature_1.state|round(0)}}°/{{states.sensor.dark_sky_precip_probability_1.state|round(0)}}%
entity_picture_template: >-
{{ '/local/icons/dark_sky/' ~ states.sensor.dark_sky_icon_1.state ~ '.png'}}
2018-11-01 18:36:41 WARNING (MainThread) [homeassistant.components.sensor.template] Template sensor forecast_1 has no entity ids configured to track nor were we able to extract the entities to track from the friendly_name template(s). This entity will only be able to be updated manually.
Yes it would, there’s no id in there. You can just and entity_id to forcast_1. In entity_id, list out all the entities used in value_template and entity_picture_template.