Tuya T&H trigger

Hi, I need some help. My T&H sensor reports many times the temperature and humidity but I want to turn my A/C ON only the first time the condition is True. I’m not sure timeout is the solution. Any idea?

1 Like

Thanks for posting. Presumably you don’t only want this to trigger once ever? After what timeout will you want to start checking the sensor data again?

You may create a boolean variable (and condition) called “AC_is_off”.

Rather than turning of your AC when your condition TemperatureAboveThreshold is TRUE, you combine both: AND(TemperatureAboveThreshold,AC_is_off). In case this evaluates TRUE, you turn the AC on and set AC_is_off to FALSE. If this evaluates FALSE, you do nothing.

Obviously you will need to set AC_is_off to TRUE at some point of time.

1 Like

When you say

the first time the condition is True

So is the condition becoming false in between or does it stay true? If it stays true, you don’t need to do anything, because the logicblock will not run repeatedly if it stays true.
If there is some movement around a temperature point and you don’t want it to react too quickly, a timeout / delay might be a good thing. Depends a bit on the specific use case and the device.

1 Like

If it’s the next day for instance I don’t think you need anything special. If the temperature fell below the threshold, the condition will become negative and will trigger the AC again if it gets hotter the next day.

1 Like

I don’t need to use time out parameters?

I don’t think so, but to get the full picture it would be helpful if you share a bit context about your complete setup / problem.

1 Like

I would have thought time conditions would required to reset a boolean each day so the humidity level can be reevaluated. So an AND condition of humidity trigger and the boolean as per @teknofilo’s suggestion.