Hello,
I have a problem which I cannot solve.
My switch item bathroom fan(named as ventilator) has a rule that turns it on. The rule works 100% correctly, in the BasicUI the switch turns on and off correctly. But in reality the switch is not turning on.
Switch is connected via qpio.
and for example here is the code for the other switch which works just fine.
items Switch luc "luc" { gpio="pin:26 activelow:yes initialValue:high" }
sitemap Switch item=luc icon="lightbulb"
Tried different pins and no success.
and here is the rule for bathroom fan.
val Number maxHumidity = 90
val Number minHumidity = 70
rule "fanBathroom"
when
Item Humidity changed
then
logInfo("FanBathroom", "Humidity changed to {}, ventilator is {}", Humidity.state, ventilator.state)
if (ventilator.state != ON) {
if ((Humidity.state as Number) > maxHumidity) {
logInfo("FanBathroom", "Humidity {} above threshold of {}", Humidity.state, maxHumidity)
ventilator.sendCommand(ON)
}
}
if (ventilator.state == ON) {
if ((Humidity.state as Number) < minHumidity) {
logInfo("FanBathroom", "Humidity {} below threshold of {}", Humidity.state, minHumidity)
ventilator.sendCommand(OFF)
}
}
end
Not sure I understand fully, but what I am reading is the following:
your rule triggers and executes correctly
your sitemap indicates the desired state
only in reality your fan does not come on
and your setup for ventilator is the same as that for luc, which actually does work
If the above is correct, then I would venture to guess that you are having a hardware problem. As on the software side everything appears to work as intended. The use of GPIO’s can be tricky and you would need to do hardware debugging; e.g., check if the GPIO actually changes state as intended by using a LED or similar; if so, check what happened in your circuit that deals with the fan, etc.
But maybe I am off base here…