Date dynamic please help


#21

I mean I can set the adjusted date one day earlier so it will always fall on a Thursday


#22

Or, some thing like…

If addDays(date($now),3) is between [gcal evet name: eventTime] and addDays([gcal Event name:eventTime],5)
Then
Msg ‘you work in 3 days’
Else
Msg ‘you have off’
End if

That is just a quick thought.

Good luck, glad you got it working… if you need further help, post what you have got, and what your desired result would be, and I can TRY to help
Gopack2


#23

This is what I’m working on


#24

All those switches Gcal events?


#25

Each push notification sends me a voice message via tasker when I either get home or to work reminding me to set the heater or my ac on my car based on the forecasted high or low. I have a viper smart start system tied into this too.


#26

Yes I have l one each for if I’m on a holiday week, on-call week, annual leave, or holiday leave


#27

Two of them are virtual switches that react to geo fences


#28

Wow, this is pretty good thus far…

However, I would shy away from nesting ifs when possible, they, from my experience tend to act funny at times.

As far as $dayofweekname sections, take a look at the SWITCH options, might be a little easier to do, and maybe a little less code needed…

I’ll play with this tomorrow, I like your thoughts and maybe I can implement something on my end for my use, based on your inspiration.


#29

What do you mean by nesting? I’ve a lot of this with just trial and error and testing with fake switches. I’ve only been on webcore for a week and do not have coding experience so the terminology alludes me. Each of those weather forecasts are based off the hour I would leave for or from work. I have a nice piston for my smart start system. I’ve done most of this on a phone too because my PC is out of order


#30

Well first off, kudos to you for getting that done on a phone… to small of a screen for me😀 and hard to see whole piston on.

When I say nesting, it is where you have a main if statement, then within that if section, you have another if in there.

Try to keep all the ifs at the top level if when possible.

As far as SWITCH options I am referring to this section, instead of using ifs for each day of the week…

Take your time learning… there is tons this can do, and the curve is huge. Keep plugging away. You are doing well for only a week in!


#31

Oh yea typically I don’t do that. I actually don’t know why I did with this one. Thank you I get frustrated often with it because I want to understand it better but a lot of the coding stuff goes over my head


#32

And you can’t move blocks on a phone either!


#33


#34

I’ve seen the switch option I just don’t understand how it works. This program is still well beyond CoRE in ease of use


#35

Here is the definition:

https://wiki.webcore.co/Case_Traversal_Policy

To use it, you would use a object for the switch. Let’s say $dayofweekname.
That will return Monday,Tuesday,Wednesday, etc; depending on the day of the week it is ran.

Then each case would have a value set to Monday, Tuesday, Wednesday, etc.

So if today is Monday, it would trigger the Monday actions. Tuesday would trigger the Tuesday actions and so on.

There is also a default case. That would trigger if none of the other cases evaluated as true. So, if you didn’t have a case set up for Thursday, and today is Thursday, then the default case would trigger.

Kind of think of it as an elaborate if/then statement.

I like to use these instead of multiple if / then statements comparing the same object, looking for different variations of the results.

For me it is just easier to read the code and follow, and shortens up some pistons quite a bit.


#36

Question. If I want to have my events trigger based off a holiday happening in the next week is that possible? I’m a state employee so we have all the major holidays off and when we do I have to revert from my adjusted 10 hour schedule to an 8 hour schedule. Is adding them into my Google calendar as all week events and using gcal as my triggers the easiest way to handle this or is there a simpler way?


#37

Probably adding them to google calendar as all week events would be easiest for you, and it will keep everything in one type of check. Otherwise t]you could import a nationall holidays google calendar into your main one, and then search that calendar with Gcal. Only issue is it will only return the holiday date not the week. And once the holiday has passed it will find the next one, even though you are still in the same week as the old holiday.

So, manually entering in whole week events would be easier for you, as long as you don’t forget to update your calendar each year


#38

That’s what I ended up doing. Today I updated it through Jan of 2020. I might have webcore send me a reminder every December to update the calendar lol.


#39

I’m looking for a way for Tasker to announce the weather forecast when I arrive home.


#40

You should only need to update the rolling dates, ie easter, thanksgiving, MLK day, Labor Day and Memorial Day. The rest repeat every year on the same day.