Temperature Rule

Hi

I have a rule that turns on a fan when the temp reaches 28 degrees Celsius and turns off when it reaches 25. I am finding that it seems to turn on okay, but does not turn off. If I go into Rule machine
5 and click run action it then turns off?

I'm never sure whether to try wait for conditions or wait for events.
Try changing to 'wait for events' and see what happens.
Might not work but worth a try. :man_shrugging:

1 Like

Thanks @bobbles will definitely give that a try. Thanks for the suggestion.

I'd definitely recommend "Wait for events" in this case (the biggest difference: if the temperature was already <= 25, it would stop at the "Wait for events" until such an event came in again; with "Wait for condition," it would continue if already true, otherwise it would effectively also wait for an event, one that makes this condition true; in your case, the latter is unlikely to matter since the rule was just triggered by a temperature well above this, so I'd use "event" per general staff recommendation to do so whenever you can, though I'm not sure what other reasons they may have for saying that).

That being said, the above should still work for you. Rule 5.0 is relatively new, and there were (minor, it appears) changes to waits, so it's possible there's an undiscovered bug. This would be easy enough to test with a virtual device, perhaps a fun project for someone (me?) later. :slight_smile: But it could also be that your device is reporting events in unexpected ways, e.g., perhaps the temperature is a string and not a number, though in that case you'd likely also have problems with the trigger too. If you're using a community driver (hopefully staff were careful enough with the built-in ones!), it may be worth looking into, too.

I see you having logging turned on, so what does it show when it doesn't turn off? It looks okay to me.

I use Simple Automation Rules for this kinda thing....

1 Like

Thank all for the suggestions, I suspect it could be a faulty Sonoff device, either hardware or software. I am using the Sonoff TH flashed with Tasmota, and was watching in the console window and it shows the device "rebooting" randomly with an exception 3 so now need to find out what this is.

I did set it up now in Simple Automation Rules so lets see if that can help once I sort this switch out.

Will report back.

1 Like

Seems to have been a corrupt Sonoff firmware, downgraded the firmware from 9.4.0 to 8.5.1 and it has been running well since then. I am using the simple automation rules currently. Will flash it back to 9.4.0 and see if it behaves in a few days time.

Interesting! Is this the SNZB-02, by chance? I wasn't aware of multiple firmware versions for any of their new-ish Zigbee sensors, but I have been paying exactly zero attention and wouldn't know either way. Just curious what the differences, if any, might be. (And if you used Hubitat or a third-party system to upgrade--also haven't checked if they have that built-in for these! Guessing not Hubitat since you are able to downgrade...)

I know they also make a variety of other sensors that you might be using with another protocol, and I don't want to distract from your original issue...this is pure curiosity on my part since I have a few of their Zigbee sensors. :slight_smile:

@bertabcd1234 No its the Sonoff Th16 which is WIFI. I have flashed with Tasmota and using Markus's drivers for all my Sonoff (flashed Tasmota) devices. I do have a few of the Sonoff Zigbee devices but not sure you can flash firmware on these??

1 Like