Hi, I’ve setup a complex condition on one of my logic blocks.
So basically it is using a combination of AND & OR operators.
The goal is to switch on a TUYA switch at 08:30 on weekends but at 07:10 on weekdays (it’s an immersion switch).
It seems to have triggered the logic block to fire this morning (Thursday) at both 07:10 and 08:30 which is not correct as it’s a weekday so should only have triggered once at 07:10.
If I do a test of the logic block it appears to function correctly (see screenshot of test).
But if you look to where the event logs are in the same screenshot you can see where it triggered at 08:30.
Have I something wrong with my complex condition?
Thanks,
Joe
Correct me if I am wrong but I think that both ‘time0710’ and ‘time0830’ are Time event conditions.
Time event conditions are always TRUE, as you can see in your screenshot (both show as ‘true’ in your evaluation). Those conditions are used as trigger conditions. That’s why your logicblock always evaluates to TRUE.
You can fix this by replacing the time event condition with a time frame condition, which will be evaluated both at 07:30 (TRUE) and 07:31 (FALSE)
Alternatively, you could keep using time event conditions but split your logicblock in 2 logicblocks, one for weekdays and another one for weekends.
3 Likes
Yes, you’re correct - they are time event conditions so that does appear to be the issue.
I actually had a separate weekday and weekend logic block so the reason for the complex condition was to merge them and save 1 logic block ![:grinning: :grinning:](https://community.apilio.com/images/emoji/twitter/grinning.png?v=12)
I will try the time frame condition as you suggest.
Many thanks!
1 Like
Thanks teknofilo,
That looks to have resolved the issue.
I’ll check it tomorrow morning but it looks to be OK.
3 Likes