Help with automation rule

Hi all am new here.

im trying to set a sonoff humidity sensor where when it goes above say 75%, the ventilation fan will turn on.

now the problem here is that the ventilation fan is a RF controlled device and its on and off state is controlled by the same button.

i am having issue with this because when someone manually turns on the ventilation fan, and humidity goes above 75%, the fan will… be turned off.

Under the ‘And if’ condition, is there anything i can do to say ‘turn on fan when >75% and only if the fan is currently off’?

the fan is currently a scene ported over from the official tuya via the tap to run scene in smartlife app.

any help will be appreciated!

Does your rf controlled fan report it’s current state to Home Assistant?

If not, then there is nothing you can do to prevent it getting out of sync due to control external to HA without extra hardware (e.g. current monitoring, or a different smart switch)

If it does report its state than yes there are a few ways to prevent your issue. e.g. Using a state condition in your automation, or creating a template fan that has discrete on and off states.

the fan is not being exposed to HA as i couldnt find a way to expose the IR to HA. im only able to control the fan via an entity scene which is created from a tap to run in smartlife.

i.e. i am controlling the fan only as an entity.

separate quick question, i would imagine the fan will be turn ‘on’ twice if the humidity is at 75 and later at 80? are we able to switch off this automation once this is triggered?

If it plugs in to an outlet a smart plug will tell you if it’s running.

im afraid this is not possible now. its a hardwire switch and i dont intend to make any ‘reno’ changes. so im exploring if there anything that can be done ‘digitally’.

what about i do this →
if >75% turn fan on, ‘then do’ wait for trigger for humidity to <65, then turn fan off.

i guess this would solve the issue of if >75 fan turn on then within 30 mins it goes below 75 and back up to >75 again, it will trigger the on and effectively turning it off.

i would then be left with, if the fan current state is on, nothing can be done about it.

You may be able to put a vibration sensor (zwave, zigbee) on the fan to detect if it’s moving.

that is perfect!

actually, thinking out loud, while this can detect its on state, when the fan is actually running for say 2hours, wouldnt the device continuously report vibration for 2 hours non stop? would then this kill the battery?

Those battery powered devices tend to only report state changes. Once the unit starts vibrating, it will send an update and then power down as much of the device as it can. When the unit stops vibrating, it’ll power back up to send the next update and then go back into low power mode waiting for the next event.

thanks for the assurance, ordering now!

but just out of curiousity, are there no script, helper etc that can manage this?