Hi
I wanna create a automation that will trigger a ventilator when there is 2 °C difference between two temperature sensors.
But i can´t figure out how to make that condition?
Hi
I wanna create a automation that will trigger a ventilator when there is 2 °C difference between two temperature sensors.
But i can´t figure out how to make that condition?
You are looking fore a trigger, not for a condition.
Create a template sensor, that calculate the temperature difference. And use the new sensor as a trigger.
If you can use YAML:
- alias: Ventilator on-off control
description: Turns on at 2°C difference, off under 1.5°C
id: 740f1bb9-ff92-4388-9462-e05d9a6c2630
trigger:
- id: 'on'
platform: template
value_template: "{{ (states('sensor.temp_1')|float - states('sensor.temp_2')|float)|abs > 2 }}"
- id: 'off'
platform: template
value_template: "{{ (states('sensor.temp_1')|float - states('sensor.temp_2')|float)|abs < 1.5 }}"
action:
- service: 'switch.turn_{{ trigger.id }}'
entity_id: switch.ventilator