linea_12_bus_9:
value_template: ' {% if states.sensor.origendatos.attributes.posiciones.posicion.43.idsiguienteparada is not defined %}
No active
{% else %}
{{ states.sensor.origendatos.attributes.posiciones.posicion.43.minutos }}:MIN
{% endif %} '
friendly_name: Bus Line
I’m confused, you are already checking whether the attribute is defined and set “No active” when this is the case. What else exactly do you need?
do you need another condition, e.g. if attribute value is 0 mark as No active too?
{% if states.sensor.origendatos.attributes.posiciones.posicion.43.idsiguienteparada is not defined or states.sensor.origendatos.attributes.posiciones.posicion.43.idsiguienteparada | float == 0 %}