cancel
Showing results for 
Search instead for 
Did you mean: 

Script turns fan on, but equivalent script doesn't turn fan off

aryanne
Community Member

Hi all,

I have a Yolink humidity sensor and a Shelly smart fan. I have used this script successfully to turn the fan on when the humidity in the bathroom goes over a certain percent:

metadata:
name: Turn on fan when humidity is high
description: When the humidity in the bathroom is over 65% turn the fan on
automations:
- starters:
- type: device.state.HumiditySetting
device: Temp Humidity Sensor - Bathroom
state: humidityAmbientPercent
greaterThan: 65
actions:
- type: device.command.OnOff
devices:
- Fan - Bathroom
on: true

 

I have this script to turn the fan off once the humidity falls below a certain percent. However, it won't work.

metadata:
name: Turn off fan when humidity is low
description: When the humidity in the bathroom is over 65% turn the fan on
automations:
- starters:
- type: device.state.HumiditySetting
device: Temp Humidity Sensor - Bathroom
state: humidityAmbientPercent
lessThan: 60
actions:
- type: device.command.OnOff
devices:
- Fan - Bathroom
on: false

 

If anyone has any idea why this might be or any suggestions why one works but the other doesn't, I would be very grateful. 

Many thanks

0 REPLIES 0