I get a ton of data from a Rest sensor “vrm_data…”
I disclose it with the first template, and
I get the name for the status as I want it with the second template
Can I disclose it an rename it with just one template, as the third one here?
The third template is not working, always gives the if else value.
# Get data
triaca_motor:
friendly_name: "Motor"
icon_template: mdi:cogs
value_template: '{{ states.sensor.vrm_data.attributes.records[175]["formattedValue"] }}'
#Rename status
triaca_motor_c:
friendly_name: "Motor"
icon_template: mdi:cogs
value_template: >-
{% if is_state('sensor.triaca_motor', 'stopped') %}
Apagado
{% else %}
En Marcha
{%- endif %}
#Do both in one step.(not working)
triaca_motor_d:
friendly_name: "Motor"
icon_template: mdi:cogs
value_template: >-
{% if is_state(''{{ states.sensor.vrm_data.attributes.records[175]["formattedValue"] }}'', 'stopped') %}
Apagado
{% else %}
En Marcha
{%- endif %}