Struggling to get AND/OR and the AND+/OR+ precedence working correctly.
My task gets the status of inside and outside temperatures.
This is what I want to accomplish:
If both or either of the temperatures are 0 (sensor takes a short time to wake up), and temperature scale is C, then loop back to the action to get the states (which refreshes) again, adding 1 to the attempt counter.
Keep doing this until both temperatures are not 0. Stop the loop if attempts = 5, so it doesn't go on infinitely. (The same IF statement is copied and pasted below this one in the task, but if the temperature scale is F, then it checks for 32 instead of 0.)
The flow is:
- Get the states.
- Add 1 to the attempt counter.
- Check if the info is valid.
- If all okay, carry on, if not, loop back and try again.
I have tried:
IF %inside_temp = 0OR+%outside_temp = 0AND%attempts < 5AND%temperature_units ~ CGOTO Label Status
Tried this:
IF %attempts < 0AND%temperature_units ~ CAND%inside_temp = 0OR+%attempts < 5AND %temperature_units ~ CAND%outside_temp = 0GOTO Label Status
Tried this:
IF %inside_temp = 0AND+%outside_temp = 0AND%attempts < 5AND%temperature_units ~ CGOTO Label Status
Tried this:
IF %attempts<5AND%temperature_units~CAND%inside_temp=0OR%outside_temp=0GOTO Label Status
Tried this:
IF %attempts<5AND%temperature_units~CAND+%inside_temp=0OR%outside_temp=0GOTO Label Status
Sometimes, one of the temps is 0 and the task continues. Sometimes both temps are non 0 (what I want...success!) but it loops back to do it again, which doesn't make sense.
What's the correct way to get this working?