1

Calendar state gets inactive during appointment

Hi there,

I'm facing an issue where I'm not sure if it's an issue of my phone (Pixel 3 with latest updates) or Tasker.

I created an task which switchs the background picture when my calendar shows that I'm having on-call for my company (State -> Calendar Entry). The on-call appointment is a bi-weekly recurring all-day appointment for 7 days. When the on-call starts, the background switchs as expected.

But during the week sometimes the profile becomes inactive for some hours.
I added a log task with timestamps to the task to see when this exactly happens. But there's no recognizable pattern.

It seems that this only happens when there's another appointment in the calendar for the current time, or another all-day appointment for that day. But again, the timestamp log shows no pattern. Means the profile gets not inactive when the additional appointment starts. It just happens during the additional appointment.

Not sure how I can do further analysis. Any ideas? Or can someone explain me what happens here?
Jas

2 replies

J

Hey,
Here's the profile description. I've only replaced my real name with "Man, Jas"

Profile: Check OnCall (100)
        Priority: 10
        State: Calendar Entry [ Title:Exchange: Man, Jas/Netzwerk: Man, Jas Location:* Description:* Available:Any Calendar:Google:Work ]
Enter: Var OnCall=True (102)
        A1: Variable Set [ Name:%OnCall To:True Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 Structure Output (JSON, etc):Off ] 
        A2: Perform Task [ Name:Log Calendar Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off Local Variable Passthrough:Off Limit Passthrough To: Reset Return Variable:Off Allow Overwrite Variables:Off Structure Output (JSON, etc):On ] 

Exit: Var OnCall=False (101)
        A1: Variable Set [ Name:%OnCall To:False Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 Structure Output (JSON, etc):Off ] 
        A2: Perform Task [ Name:Log Calendar Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off Local Variable Passthrough:Off Limit Passthrough To: Reset Return Variable:Off Allow Overwrite Variables:Off Structure Output (JSON, etc):On ] 


Thank you for taking a look at it.

Thank you. To clarify, it all works normally if you only have that single calendar event? It only stops working if you have another event on the same day?

J

Yes, it seems so. But only sometimes. Means, not all the time when there's an another event at the same day, the profile gets inactive.
Another thing that I've noticed once is, that the variable %CALTITLE showed me an all-day appointment, which is two weeks in the future. That happend last Friday and it showed me "Sysadmin Day", which is on 2021-07-30

I know, very confusing. But I'm not able to find a pattern in this behaviour.

Confusing indeed 😅 All the calendar code was done before I was Tasker's developer so I will need to get familiar with it to find out what's wrong. It's super hard to debug conditions like these the depend a lot on the user's configuration. 

When that error is happening can you try using the Test App action with Data set to %TIMES and Store Result In set to %events and then use a Flash action with %events() and see what it shows? Thanks!

J

I will do that, but my next regulary on-call appointment is in two weeks, so maybe it could take some time until I can tell you what it shows.
I will also try to reproduce it with a dummy appointment.

I already created the task today (I've chosen "Calendar Title" as type in the Test App action, hope that's correct), and it shows me all my current appointments (all-day and non-all-day) including the Sysadmin day appointment, which is in seven days.

Maybe it's important to mention that I've two calendars. One for work appointments, which is read-only, and one for private appointments. Both are synchronized over NextCloud with DAVx.
The on-call and Sysadmin appointment are all in the work calendar. Both are recurring appointments.

J

It happened again today.

Here's the output from my log task (I replaced the surnames from the holiday appointments with "XXX"):

21-08-04 10.19:18 Caller: task=Var OnCall=False, Appointments: Bioabfall,Leichtstoffe,Urlaub Leon XXX,Urlaub Christoph XXX

21-08-04 13.25:0 Caller: task=Var OnCall=True, Appointments: Bioabfall,Leichtstoffe,Urlaub Leon XXX,Netzwerk: Man, Jas,Urlaub Christoph XXX

All shown appointments are all-day appointments. There was no appointment when it switched.

Hhmm, it seems like at 10.19:18 there was no 

Man, Jas

event, right? and so the profile exited?

J

According to Tasker / the profile there was no event with this subject at this time. But when I looked to my calendar calendar app it was still there.
As I mentioned it's an recurring all-day appointment, every three weeks from Monday 00:00 to Sunday 23:59 o'clock.

BTW: The complete subject of the appointment is "Netzwerk: Man, Jas". Maybe it's important.

Can you please export your profile's description (not xml) so I can take a look? Long-click the profile in Tasker->export description Thanks in advance