阅读这个页面
https://www.home-assistant.io/docs/configuration/templating/
{% if is_state('device_tracker.paulus', 'home') %}
Ha, Paulus is home!
{% else %}
Paulus is at {{ states('device_tracker.paulus') }}.
{% endif %}
{{ states('sensor.temperature') | float + 1 }}
{{ (states('sensor.temperature') | float * 10) | round(2) }}
{% if states('sensor.temperature') | float > 20 %}
It is warm!
{% endif %}
{{ as_timestamp(states.binary_sensor.garage_door.last_changed) }}
{{ as_local(states.binary_sensor.garage_door.last_changed) }}
{{ as_timestamp(now()) - as_timestamp(states.binary_sensor.garage_door.last_changed) }}
{{ as_local(states.sensor.time.last_changed) }}
|