Compare Indoor and Outdoor temperature?

Can i use a “trigger state” to see if the outdoor temp is higher or lower then my indoor temp? this is what i have now that does not work:

image

I have solved that via Template Sensors.

sensor:

  - platform: template
    sensors:
      temp_difference:
        friendly_name: Temp Diff
        value_template: "{{ ( (state_attr('climate.wohnbereich', 'current_temperature') | float - 0.5 ) - (states.sensor.aussentemperatur.state | float ) ) | round(2) }}"
        
  - platform: template
    sensors:
      temp_difference_text:
        friendly_name: Luften
        value_template: >-      
          {% if states('sensor.temp_difference') | float > 0 %}
            > Lüften! Draussen ist es {{ (states('sensor.temp_difference') | float | round (2)  | abs )  }}° kühler.
          {%endif %}
          {% if states('sensor.temp_difference') | float < 0 %}
            > Fenster zu! Draussen ist es {{ (states('sensor.temp_difference') | float | round (2)  | abs )  }}° wärmer.
          {%endif %}
          {% if states('sensor.temp_difference') | float == 0 %}
            > Gleichstand.
          {%endif %}          
          

Using a trigger-state node:

[{"id":"439809cb.f055c8","type":"trigger-state","z":"ffbd7f06.4a014","name":"","entityid":"sensor.netatmo_outdoor_temperature","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"kvjupxyz6z9","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"<","comparatorValueDatatype":"jsonata","comparatorValue":"$entities(\"sensor.netatmo_indoor_temperature\").state"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":424,"y":1248,"wires":[[],[]]}]

Using a event-state node:

[{"id":"4b5e1405.0160fc","type":"server-state-changed","z":"ffbd7f06.4a014","name":"","version":1,"entityidfilter":"sensor.netatmo_outdoor_temperature","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"$number($entity().state) < $number($entities(\"sensor.netatmo_indoor_temperature\").state)","halt_if_type":"jsonata","halt_if_compare":"jsonata","outputs":2,"output_only_on_state_change":true,"x":426,"y":1328,"wires":[[],[]]}]
1 Like