Im banging my head on the wall trying to get a few rules configured. I have several time based rules configured via paper ui and those are working great.
Im not trying to get a rule configured for a bathroom fan. In a nutshell the temperature and humidity sensor is in the bathroom, when the humidity gets to 80% I want the bathroom fan to turn on. There is a 30 minute run timer programmed into the fan controller.
Well I’m not entirely sure…it gets it’s data from a mysensors device…those autodiscover when they powerup. It pops up and all I have to do is link it to an item and voila it updates the data when the sensors sends it.
The state of the item if not available straight away after an update is received. This is due to the time the event bus takes to do what it need to do.
Change your trigger to changed:
rule "Kidsbathroomfan"
when
Item Room_Humidity28 changed
then
if (Room_Humidity28.state > 80) KidsBathFanOn.sendCommand(ON)
end
Now, does your fan timer resets every time an “ON” command is sent?
Because for example the humidity will reach 81 and the fan will start for 1/2 hour.
Then 5 minutes later the humidity will reach 82 and the fan will start for 1/2 hour
Or does the fan starts for 1/2 hour and then stops regardless?
This is very true for received command. And definitely not true for changed so your suggestion is a good one. But I think that the item will have already transitioned to the updated state by the time the rule triggers. Otherwise we would need a receivedUpdate implicit variable which doesn’t exist.