Hey @Jay, what Node.js version are you running?
Read the statement by Michael Teeuw here.

Posts
-
RE: MMM-PublicTransportBerlin - Public transport for Berlin and Brandenburg (departures)
-
Synchronizing private iCloud calendar with MagicMirror - a Workaround
I found a solution how to automatically sync a private iCloud calendar to the magic mirror. It’s quite circuitous. And it’s more like a workaround, not a real solution.
But since you can’t access a private iCloud calendar directly via any API or something similar, this is the only working solution I found.
Maybe it’s helpful for one of you.Why?
I don’t want my calendar to be available via a public URL like mentioned in the iCloud calendar thread. Even though the public sharing address is quite long, web crawlers can still find them and your private life is publicly available. I just don’t like that scenario. So I wanted a solution that uses encryption and authentication against all services.
I’m using a shared calendar with my girlfriend via iCloud. I’d use my CalDAV server Baïkal for that, but the current version of the backend (sabre/dav) in Baïkal does not yet support calendar sharing (they’re working on it). So until then, we’re quite stuck with iCloud since all the other CalDAV servers I tried don’t satisfy me and I have good experiences with Baïkal.
Preconditions
You’ll need:
- Computer running macOS
- iCloud calendar synced in
Calendar.app
- iCloud calendar synced in
vdirsyncer
- A CalDAV server (I use Baïkal)
- MagicMirror (of course)
How it works
The
Calendar.app
saves an.ics
file for every calendar event to the hard drive. We can use these event files to use withvdirsyncer
and synchronize them with a CalDAV server. So the sync chain would be like the following:iCloud < - > Calendar.app -> Filesystem -> CalDAV Server -> MagicMirror
Steps
Find the directory of the desired calendar
macOS’ Calendar.app saves it’s calendar files in
/Users/[USER]/Library/Calendars/
.
In this Folder you’ll find several folders with suffixes like.caldav
and.calendar
depending on your configuration. The folders should be identified by UUIDs. iCloud accounts should have a.caldav
suffix.Every folder contains a
Info.plist
file on which you can identify the calendar of the CalDAV account. You just have to look for the one containing your iCloud ID.In this folder you can find subfolders with
.calendar
suffixes. These subfolders also contain anInfo.plist
file that should have information to identify the desired calendar.In the calendar folder is a
Events
folder that contains all the.ics
files with your calendar events. This is the folder we’re looking for.CalDAV server
I won’t explain how to install and set up a CalDAV server, you can use the one of your choice. I have good experiences with Baïkal, but other implementations like DaviCAL or radicale should work as well. You can read more about Baïkal on baikal-server.com oder Baïkals GitHub repo.
I created an extra user for the mirror. We’ll use
magicmirror
for the rest of the tutorial.Install and configure
vdirsyncer
You can install
vdirsyncer
via Homebrew on macOS:brew install vdirsyncer
You might want to start
vdirsyncer
on system startup so it syncs events automatically:brew services start vdirsyncer
Here’s a sample configuration to sync with the CalDAV server:
# An example configuration for vdirsyncer. # # Move it to ~/.vdirsyncer/config or ~/.config/vdirsyncer/config and edit it. # Run `vdirsyncer --help` for CLI usage. # # Optional parameters are commented out. # This file doesn't document all available parameters, see # http://vdirsyncer.pimutils.org/ for the rest of them. [general] # A folder where vdirsyncer can store some metadata about each pair. status_path = "~/.vdirsyncer/status/" # Synchronize all collections that can be found. # You need to run `vdirsyncer discover` if new calendars/addressbooks are added # on the server. # CALDAV [pair MyPairing] a = "Local" b = "Remote" collections = null # Calendars also have a color property metadata = ["displayname", "color"] # The storage name must be "Events", because it looks for it in the .calendar folder [storage Local] type = "filesystem" # This folder should not go to the Events folder but to the parent directory path = "/Users/YOURUSER/Library/Calendars/0b0e91ad-60d1-40e2-85cf-366b2ddb5f1b.caldav/63cf04c6-d391-41af-840c-4e4a4d2ed37b.calendar/Events/" fileext = ".ics" # This might be important, since you don't want vdirsyncer to change anything in the Calendar.app folder: read_only = true [storage Remote] type = "caldav" # "magicmirror" is the username! url = "https://baikal.example.org/dav.php/calendars/magicmirror/MYCALENDAR/" auth = "digest" username = "magicmirror" password = "YOURSTRONGPASSWORD"
For further information about the config, please refer to the
vdirsyncer
documentation.You can discover the new files with the following command:
vdirsyncer discover
… and trigger a sync with this command:
vdirsyncer sync
When it’s successfully configured and running,
vdirsyncer
automatically synchronizes the content of theEvents
folder with the CalDAV server periodically.Use the default calendar module with the CalDAV server
Just add your credentials to the MagicMirror configuration. If you want to use digest authentication (with Baïkal for example), you have to change the
sendImmediately
option in thecalenderfetcher.js
tofalse
. You can find it here.If you use Baïkal or any other service that uses sabre/dav (like Nextcloud), you have to add the
?export
option to the calendar URL as described in the CalDAV thread.Here’s an example URL for use with Baïkal:
https://dav.example.org/dav.php/calendars/[username]/Events?export
This URL returns an
.ics
file with the whole calendar containing all the events.I hope someone has use for this ;)
- Computer running macOS
-
RE: CalDAV
@poekel I don’t know, if I understand this right. But the
?export
option already triggers a download for an.ics
file (with all calendar events). I’m using this on my mirror with baikal and it works fine… -
RE: CalDAV
Hey @poekel,
You can limit the export with some options. Since baikal uses sabre/dav you can use the options provided on the sabre/dav website here.
Maybe it is helpful for you, if you limit the export with the
start
and/orend
options. You have to use unix timestamps for this. Converters can be found easily via a google search.Here’s an example:
http://dav.example.org/calendars/user1/mycalendar?export&start=1391707119&end=1391707215
Maybe you just want to use the
start
option with today’s value. This would suffice for now I think… -
RE: CalDAV
@poekel You just add
?export
to your calendar URL like this (example for baikal):https://dav.example.org/dav.php/calendars/[username]/[calendarname]?export
Note, that
[calendarname]
is the internal name of your calendar in baikal. You can look it up in the baikal admin interface.In addition: You can use digest authentication instead of basic auth for the calendar module, if you set the
sendImmediately
option tofalse
. -
RE: MMM-PublicTransportBerlin - Public transport for Berlin and Brandenburg (departures)
Hey, @dbahn25
@olexs forked my module and added a fetcher for the whole DB transportation net to it. So you can use the whole DB net with the look of my module. ;)
Here it is:
https://github.com/olexs/MMM-PublicTransportDB -
RE: Mobile app (bachelor thesis)
omg, your’re right! thanks!
#werlesenkannistklarimvorteil
-
RE: Mobile app (bachelor thesis)
Yeah, this: https://gist.github.com/deg0nz/d2ba5eeb08c1cbeeb3698ca19cbc0c76
It says, it couldn’t load the config file, but there was nothing wrong with it. I checked it…
-
RE: Mobile app (bachelor thesis)
Hey!
Has anyone commented on getting back to the original config file? I haven’t seen any comments for this in this thread, but maybe I scrolled too fast ^^’Some days ago I wanted to replace the MMM-Mobile config with my original config and all I got was a white screen on the mirror. Is this a known issue?
I want to use my old config until the app is really finished and the thesis is done…
-
RE: Motion detection: PIR sensor vs picamera
I have a broad frame and a quite small PIR sensor (this one, pictures of mirror here).
Currently it’ hanging behind the frame and is seeable, but I want to 3D-print a small mount, to screw it to the frame, so it’s not visible and measure IR in the area of your feet when you pass the mirror
So it’s possible to use a PIR sensor which is not visible directly when you have a broad frame