By The Way… what i have made now, is a fully automated alarmclock.
i add my schedule to apple agenda and with icalCalendar i can now know if i have to work tomorrow or not. before i go to sleep i will get an daily update via google hub. it tells me the temperature, how much power i have collected today, if i have to work or not, etc…
then, the next morning, my alarm will go off 1 hour before i have to start to work. only thing i have to do is adding the schedule.
this was needed coz icalcalender only checks the next event and collect its date. now i can verify if that date is tomorrow or not. as long as that date is not the same, i don’t have to work the next day
At the time 4.30 i run that homeyscript to determine the next day date.
Happy to have found your script for the day of the week, but it returns the wrong day for me.
This may be related to time zone? I am 1 hour later than Western Europe. Its after midnight and I just ran it, it still says Monday, but it is Tuesday already.
@Rrrr you can use the BetterLogic Library flowcard: format date.
Fill it with ddd or dddd and you will get the day, based on your timezone (can be configured or overruled).
Well, yeah, but since date in this flowcard is just an argument (not coding), you will need the “Execute BLL Expression (as Tag)” card (or you would first need to set the date in another card).
Then place this in the expression:
date('dddd', new Date(new Date().setDate(new Date().getDate()+1)))
That’s it.
What you also could do, is create a function in the BLL App Settings called f.i. addDays, with this in it’s body:
function (days) {
let d = new Date();
return new Date(d.setDate(d.getDate()+days));
}
And please note, all those codings can be used in any flowcard that supports bll coding, if you place it within {[ ]}
So, this coding can f.i. be used directly within a Google Service Speak flowcard, without the need for a ExpressionAsTag card.