That automation waits for the temperature sensor to pass from below 19°C to above 19°C. It then checks to make sure the fan is on, and if is it, switches it off. There is nothing in this code that will switch it back the other way when the temperature drops again.
That seems like the wrong way around to me, but you may have deliberately done that to work around a peculiarity of your switch.
When you run an automation manually, it is expected behaviour for it to ignore the trigger and condition, and just run the action.
Personally, I’d rewrite with entity_id instead of device for ease, although I never use the UI. This rewrite still has the on/off what I suspect to be the wrong way around:
- alias: Garage - Turn on the inverter fan
description: ''
id: '1651212183531'
trigger:
- platform: numeric_state
entity_id: sensor.garage_temperature_sensor_temperature
above: '19'
condition:
- condition: state
entity_id: switch.garage_inverter_fan
state: 'on'
action:
- service: switch.turn_off
entity_id: switch.garage_inverter_fan
Thanks for the reply. So if I understand correctly then to test my automation manually I need to change the value of the temperature through the developer tool.
I think I have got confused on the condition part of the automation. If the switch is already on it should ignore the automation. I have changed based on your reply as follows:
- id: '1651212183531'
alias: Garage - Turn on the inverter fan
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.garage_temperature_sensor_temperature
above: '19'
condition:
- condition: state
entity_id: switch.garage_inverter_fan
state: 'off'
action:
- service: switch.turn_on
entity_id: switch.garage_inverter_fan
mode: single
This works now can you just check if am correct in my understanding, Please
And sorry yes you were right in your understanding. For a numeric_state trigger the value has to transition. And you can simulate that via developer tools.