Hi,
I need help with creating a rule for my bathroom ventilation.
I have fan controlled by Shelly 1. Shelly is controlled by Xiaomi Wireless Wall Switch.
I have a rule that turns on the fan when humidity is over 75% (Xiaomi Himidity Sensor). And turn off when is below 75%.
But when I go to the bathroom and turn on the fan with a switch by myself (eg. going to poop), it turns off if when Humidity sensor recognizes it’s below 75%. I don’t want that.
Fan should automatically turn off only when was enabled by a rule of after 25 minutes. Could you help me?
This is what I have:
Items:
Number:Dimensionless HTBathroom_Humidity "Bathroom Humidity" <humidity> (gTempBath) {channel="mihome:sensor_ht:158d0001149ad4:humidity", ga="thermostatHumidityAmbient"}
Switch ShellyBathFan "Bathroom Fan" {channel="shelly:shelly25-relay:68c63afa35a5:relay1#output", ga="Fan"}
Rules:
rule "Hallway 2WallSwitch B.1"
when
Channel "mihome:86sw2:158d0002afc109:ch1" triggered
then
var actionName = receivedEvent.getEvent()
switch(actionName) {
case "SHORT_PRESSED": {
if (ShellyBathFan.state == OFF ) { ShellyBathFan.sendCommand(ON) }
else ShellyBathFan.sendCommand(OFF)
}
case "LONG_PRESSED": {
}
case "DOUBLE_PRESSED": {
}
}
end
rule "Turn Bathroom Fan while shower"
when
Item HTBathroom_Humidity changed
then
if(HTBathroom_Humidity.state >=75 | "%" && ShellyBathFan.state == OFF)
{ ShellyBathFan.sendCommand(ON) }
if(HTBathroom_Humidity.state <70 | "%")
{ ShellyBathFan.sendCommand(OFF) }
end
Thanks for your help