This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Odd and even week numbers
videren
Member
Even though I hate week numbers, I would like this to include "Odd week numbers" and "Even week numbers", to be able to have specific flows active only during the weeks that my son stays at my place.
Comments
in '''BetterLogic' you make two variables OddWeek as Boolean and WeekNr as Number:
The first time you have to synchronize the values, and at first of January again
Then i use this Boolean value in my flows
I had to sync this boolean once but then it works
4th of januari is always week 1 (odd week)
or
But if it is you could use the "remainder" calculation.
AND: Better logic Math.js expression is true ( Weeknummer % 2)
It devides the Weeknummer by 2, untill it can no longer do that, so on even weeks, the Remainder is 0, in odd weeks the result is 1