The Calendar skill

Had some issues getting Mycroft going today. At one point I asked if I had any appointments today and it responded with “is that on the Japanese time zone?”. When i said “no” it told me I had no appointments. When I tried to add an event, it didn’t understand. After several reboots, it would finally listen and respond to me, but it seems to have lost the calendar skill.
I will attempt to re-install.

I was using a .ics file.

UPDATE: While Mycroft didn’t recognize the calendar skill as being installed, i had to uninstall it with the msm command and then re-install.
This time it installed quite quickly and was good to go after a reboot.
I was able to add an event successfully, however, it is using GMT for the time zone and not EDT. So my 5 Pm dinner was set for 9 PM.
When I ask Mycroft for the current time, it is correct.

okay, can you upload your skills.log file?

The file is rather large. Would you like me to filter on something? Or where can I put it?

Here is the log filtered on “calendar”:

14:03:49.087 - QuestionsAnswersSkill - INFO - Searching for how many appointments are on my calendar for today
14:12:04.556 - QuestionsAnswersSkill - INFO - Searching for what’s on my calendar
14:29:15.226 - mycroft.skills.core:load_skill:121 - INFO - ATTEMPTING TO LOAD SKILL: calendar-skill.linuss1 with ID calendar-skill.linuss1
14:29:16.664 - mycroft.skills.core:load_skill:150 - INFO - Loaded calendar-skill.linuss1
14:29:16.668 - mycroft.skills.core:load_skill:154 - INFO - First run of calendar-skill.linuss1
14:30:06.205 - Calendar - INFO - 2019-04-24 00:00:00-04:00
14:31:24.194 - Calendar - INFO - Calendar skill new event: date: 2019-04-24 17:00:00-04:00 event: dinner at 5 p.m.
14:31:40.870 - Calendar - INFO - 2019-04-24 00:00:00-04:00
14:47:06.945 - msm.skill_entry - INFO - Nothing new for calendar-skill.linuss1

Are you seeing anything that says Traceback? This indicates an error in the skill.

I’ll look at the timezone issue.

No Tracebacks associated with Calendar Skill. It is looking good.

Interestingly, when I schedule an event with the time and date in the first interaction (Hey Mycroft add an event called lunch on Friday at noon) it works properly with the time. When i do three steps (Hey Mycroft, add an event. Then in response to “what is the date?” after “what is the name of the event?”) the time doesn’t adjust to my time zone.

Alright, thanks for all the debugging info!
I just pushed a fix to GitHub that fixed this issue on my end so try it out. Just uninstall then reinstall the skill to use it!

or to get to the latest commit on the master branch of a skill, you can run:
mycroft-msm --latest install https://github.com/author/skill-repo

yes, that is working! I have added some further tests:

Case 1: (confused by time zone)
Current time is 20:18 EDT (Wednesday) or 00:18 GMT (Thursday).
What is my schedule for today?

Mycroft: “Did you mean the Tokyo Asia time zone?”
No
Mycroft: “I could not find the time zone for today.”

If I answer “Yes” to Tokyo Asia time zone query.
“It is Thursday, April 25th 2019.”

Case 2: (Confused by time zone).
Current time is 20:18 EDT (Wednesday) or 00:18 GMT (Thursday).
What is my schedule for tomorrow?

Mycroft: answers for Friday (not taking my time zone into account).

Case 3: (Very Good)
what is my schedule for Thursday?

It works as expected.

Case 4: (OK, but a bit confused)
“Add an event called Lunch on Saturday at noon.”

Mycroft: The first event on your schedule on saturday, the twenty-seventh is lunch on saturday at noon, at noon.

Event time is correct; event name is “lunch on saturday at noon”. i imagine the engine gets a bits confused by the time as stated with the name of the event.

Case 5: (Very Good)
“Add an event”
Mycroft: What is the name of the event?
Me: Dinner.
Mycroft: What day is the event on?
Me: Saturday at 5 PM.
Mycroft: OK, I have added dinner to your calendar.

Checking this, the time is correct now for both events.

gez-mycroft,
That command didn’t work for me (Picroft 19.02-4)

mycroft-msm --latest install https://github.com/LinusS1/calendar-skill.git
INFO - Problem performing action. Restoring skill to previous state…
AlreadyInstalled: calendar-skill.linuss1

Wow! Thanks for all this information! I’m not sure what is causing Mycroft to ask “Did you mean the Tokyo Asia time zone?” because the skill never asks that. It seems to be that there is an intent collision with the date time skill, so I’ll add this sample utterance.

Notes to myself:

  • Add more vocab
  • Fix engine saying “noon” is part of the name
  • Change all date time objects to match current time zone
  • change nice_date/time to have lang argument

Another question: Should the skill require a time when creating an event?

1 Like

Trying to vote that Time should be required, but clicking it isn’t working for me. May be my browser settings.

1 Like

I’m not able to configure my CalDav server on https://account.mycroft.ai/skills the skill is missing there…

@malevolent that sounds like a home issue. Can you tell if the skill’s loaded?

After deleting and re-adding the skill, now it appears on home.mycroft.ai.

I saw, but, a pair of things I don’t understand.

Its supposed to work with CalDav servers, but there is no option for CalDav servers, just iCal. I’ve tried to put NextCloud CalDav credentials and URL, but the skill just works with the local .ics it created, so I guess it did fallback into local ics.

The second question is… what is that second “password” field shown in the picture?

PS: I’m going to try configure CalDav through the yaml file and report back here.

No luck, CalDav server (Nextcloud) isn’t working, nor via home nor via yaml.
I’ve tested both the nextcloud CalDav URL and the ics URL

Can you post the contents of the settings.json file in the calendar skill directory (With the sensitive parts blocked out, of course)

Hummm, in which directory?
On /opt/mycroft/skills/calendar-skill.linuss1 there is no need to blur anything
settings.json

  {"__mycroft_skill_firstrun": false}

The other file on this very same location: settingsmeta.yaml

name: Calendar
skillMetadata:
  sections:
    - name: Calendar Location
      fields:
        - type: label
          label: By default, the calendar skill defaults to saving your calendar on your device. However, if you wish to connect to a iCal server, you can select the setting here then fill out the information below. You can also <a href='http://bit.ly/mycroft-calendar-ics'>learn more about ics files.</a>
        - name: server_type
          type: select
          label: Calendar Location
          value: "local"
          options: Locally on the device|local;iCal Server|server
    - name: iCal Login
      fields:
        - type: label
          label: <b>If you selected iCal Server</b> above, fill out the form here, to connect Mycroft to your iCal account. If you wish not to enter this information in here, you can <a href='https://bit.ly/mycroft-calendar-local'>configure the skill on your device</a>
        - name: username
          type: text
          label: Username
          value: ""
        - name: password
          type: password
          label: Password
          value: ""
        - name: port
          type: number
          label: Password
          value: ""
        - name: server_address
          type: text
          label: address
          value: ""

On ~/.mycroft/skills/Calendar there isn’t any file at all.

Where I put the configuration was in ~/.mycroft/calendar-skill.linuss1 with this content

username: <MY_NEXTCLOUD_USERNAME>
password: <MY_NEXTCLOUD_PASSWORD>
server_address: <MY_NEXTCLOUD_URL>
port: 443

It makes any sense for you?

Okay, try putting the configuration that you entered (in ~/.mycroft/calendar-skill.linuss1) into a file, with the same name at ~/.mycroft/skills/Calendar and deleting the other.
Then try rebooting to make sure the changes take affect.

If that doesn’t work, delete the configuration files that you created (~/.mycroft/skills/Calendar) and try configuring with Mycroft home. Make sure you click the save button and then say “configuration update” to pull the settings down. Then check /opt/mycroft/skills/calendar-skill.linuss1/settings.json to see if your information was pulled down. (post that file here).

Using PiCroft (Buster Keaton - Pork Pi) (MyCroft Core 20.2.2 Master)

This Forum has been most helpful. Here are the steps I’ve isolated so far:

msm install https://github.com/LinusS1/calendar-skill.git works great.
msm --latest install https://github.com/LinusS1/calendar-skill.git also works.

The install took almost 20 minutes for me, but it eventually finished. Start it and walk away, watch a movie, whatever. When you come back it will be finished.

However, it is incomplete. You will need to run: pip install CalDav before, if you want to be able to use a CalDav server (like NextCloud) this also takes some time. Be patient.

Now I’ve got it running and configured. Edit /opt/mycroft/skills/calendar-skill.linuss1/settingsmeta.yaml AND /opt/mycroft/skills/calendar-skill.linuss1/settings.json with your server connection info. REBOOT.

After it comes up, you can test:

  1. What’s on my Calendar? --fails
  2. Add event Test today at 2pm. --fails
  3. Manually add event Test to your calendar at 2pm.
  4. Add event Test today at 2pm. --passes

Proves that it can connect to the CalDav server, but can’t do anything with it.

Here are the relevant logs:

01:38:54.757 | INFO | 680 | Calendar | Calendar skill new event: date: 2020-05-04 21:00:00 event: test
01:38:54.888 | ERROR | 680 | mycroft.skills.mycroft_skill.mycroft_skill:on_error:799 | An error occurred while processing a request in Calendar
Traceback (most recent call last):
File “/home/pi/mycroft-core/mycroft/skills/mycroft_skill/event_container.py”, line 66, in wrapper
handler(message)
File “/opt/mycroft/skills/calendar-skill.linuss1/init.py”, line 192, in handle_add_appoint
c.events.append(e)
AttributeError: ‘set’ object has no attribute ‘append’