MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. edd189
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    E
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 17
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: MMM-CalendarEXT2 - Calendar Read Failing When Time Value Is Missing from ics file

      @sdetweil

      I went with an sh script. I run this every morning at 3am. Does the trick by fixing the calendar file (appends a made up time to the end where its missing) and saving locally. I had to point CX2 to a local file instead of the webcal link, but that is no problem.

      The worst part was that the two calendars had slightly different formatting. The US Holidays had some sort of hidden return character at the end of the string, and it took me forever to figure out how awk should deal with that.

      #!/bin/sh

      #download files
      curl “https://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics” --output us_holidays_raw.ics
      curl “https://api.team-manager.gc.com/ics-calendar-documents/user/6e0678b2-2e99-44ce-9e3a-e32ac9ff6e78.ics?teamId=secret_id_string&token=secret_id_string” --output baseball_raw.ics

      #clean files
      awk ‘{if(($1 ~ /DTSTART/) && length($1)==16) {print $0"T050000Z"} else {print $0}}’ dirtdawgs_raw.ics > baseball_awk1.ics
      awk ‘{if(($1 ~ /DTEND/) && length($1)==14) {print $0"T195959Z"} else {print $0}}’ dirtdawgs_awk1.ics > baseball_awk2.ics

      awk ‘{if(($1 ~ /DTSTART/) && length($1)==17) {print substr($0,1,16)“T050000Z”} else {print $0}}’ us_holidays_raw.ics > us_holidays_awk1.ics
      awk ‘{if(($1 ~ /DTEND/) && length($1)==15) {print substr($0,1,14)“T195959Z”} else {print $0}}’ us_holidays_awk1.ics > us_holidays_awk2.ics

      #copy and delete temp files
      /bin/cp us_holidays_awk2.ics us_holidays.ics
      /bin/cp baseball_awk2.ics baseball.ics
      /bin/cp us_holidays.ics /home/edd/MagicMirror/config/us_holidays.ics
      /bin/cp dirtdawgs.ics /home/edd/MagicMirror/config/baseball.ics
      rm us_holidays_awk1.ics
      rm us_holidays_awk2.ics
      rm baseball_awk1.ics
      rm baseball_awk2.ics

      exit

      posted in Troubleshooting
      E
      edd189
    • RE: MMM-CalendarEXT2 - Calendar Read Failing When Time Value Is Missing from ics file

      @sdetweil

      Ok, plan B – read the ICS files, save them locally, append the time to the DTSTART and DTEND fields.

      Create a script to do this automatically every 24 hours.

      Wish me luck! I’m in over my head, but its kinda fun.

      Any advice? I am running this on linux, so figured I can just run a cronjob every 24 hours. What’s the best service to language to use to write such a simple script?

      posted in Troubleshooting
      E
      edd189
    • RE: MMM-CalendarEXT2 - Calendar Read Failing When Time Value Is Missing from ics file

      @MMRIZE

      Thanks for looking into it. Over the weekend I did determine that its was the ical.js node module that you referenced being the source of the error. I tried to understand the code and edit it myself, but gave up and just applied a bandaid to the problematic calendars (see my post above with the sh script).

      I actually have multiple calendars that are problematic, so I needed the fix to be universal. I think my script works pretty well for a novice who hasn’t done much programming since college 20+ years ago!

      I tried to use your CX3 module, but for some reason it won’t display on my Chromecast. It pops up fine on a web browser on my computer. My setup is a linux VM running the magic mirror software and then using Cast All The Things (CATT) to push the MM through a Chromecast to my display in the kitchen. I don’t think there is anything to dig into here, because I imagine the Chromecast is not a common method for this software. I may eventually migrate to a local RPI anyways, because the Chromecast seems to be limited to a 720p resolution.

      posted in Troubleshooting
      E
      edd189
    • 1 / 1