用ha的自动化,条件选择模板应该也能做到,gui框里填value_template: | 下面的
condition: template
value_template: |
{% set temp1 = states('sensor.1_temperature') | float %}
{% set temp2 = states('sensor.2_temperature') | float %}
{% if (temp1 - temp2) | abs < 2 %}
True
{% else %}
False
{% endif %}
|