Value_template trigger help

Hi guys, I would like make a trigger fire when the bedroom temperature sensor is +3 above the dark sky temperature sensor. I’ve tried adding a +3 to the bedroom sensor but that doesn’t seem to work.

Working right when it is 1 degree hotter

  alias: 43. Master Bedroom is warmer than outside / Turn the Fan On
  trigger:
  - platform: template
    value_template: '{{ states("sensor.bedroom_temperature_temperature_measurement") | int > states("sensor.dark_sky_temperature") | int }}'

Want to trigger only when it is +3 hotter - Follow code does not work

    value_template: '{{ states("sensor.bedroom_temperature_temperature_measurement") +3 | int > states("sensor.dark_sky_temperature") | int }}'
    value_template: '{{ states("sensor.bedroom_temperature_temperature_measurement") | int > states("sensor.dark_sky_temperature") | int + 3 }}'

Thanks! I just realized that I was trying to add the string before integer conversion.

1 Like