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.appsaves an.icsfile for every calendar event to the hard drive. We can use these event files to use withvdirsyncerand 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.caldavand.calendardepending on your configuration. The folders should be identified by UUIDs. iCloud accounts should have a.caldavsuffix.Every folder contains a
Info.plistfile 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
.calendarsuffixes. These subfolders also contain anInfo.plistfile that should have information to identify the desired calendar.In the calendar folder is a
Eventsfolder that contains all the.icsfiles 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
magicmirrorfor the rest of the tutorial.Install and configure
vdirsyncerYou can install
vdirsyncervia Homebrew on macOS:brew install vdirsyncerYou might want to start
vdirsynceron system startup so it syncs events automatically:brew services start vdirsyncerHere’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
vdirsyncerdocumentation.You can discover the new files with the following command:
vdirsyncer discover… and trigger a sync with this command:
vdirsyncer syncWhen it’s successfully configured and running,
vdirsyncerautomatically synchronizes the content of theEventsfolder 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
sendImmediatelyoption in thecalenderfetcher.jstofalse. 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
?exportoption 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?exportThis URL returns an
.icsfile 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
?exportoption already triggers a download for an.icsfile (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
startand/orendoptions. 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=1391707215Maybe you just want to use the
startoption with today’s value. This would suffice for now I think… -
RE: CalDAV
@poekel You just add
?exportto your calendar URL like this (example for baikal):https://dav.example.org/dav.php/calendars/[username]/[calendarname]?exportNote, 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
sendImmediatelyoption 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
-
RE: Independent display controller based on PIR sensor.
Ok, maybe I forgot that in the readme file, or it worked straghtaway on my Pi.
I’m going to addsudo systemctl enable pir_sensor.serviceto the readme file!thanks for the hint :)
-
RE: Mobile app (bachelor thesis)
Nice! Thanks!
Gonna try it tonight.
Where should I report issues? Do you have a GitHub repo for the app?
-
RE: ipWhitelist doesn't work for me
OK, after some trying, I think this related to the IPv6 configuration of my network and/or the Pi.
When I add
"::ffff:192.168.178.77"to the list, I can access the Mirror via browser by entering the IPv4 address of the mirror into the browser’s address field. -
ipWhitelist doesn't work for me
I just updated my mirror to 2.1.0 and tried to add some IPs to the whitelist, but it doesn’t work. I am not able to access the mirror from an IP added to the
ipWhitelistarray.The array in my config looks like this:
ipWhitelist: ["10.0.0.55", "192.168.178.77", "127.0.0.1", "::ffff:127.0.0.1", "::1"]Do you have any idea, why this does not work?
-
RE: Independent display controller based on PIR sensor.
Hi @bibi, I hope, I understand that right.
I don’t think that this is very easy. Because the script just turns the HDMI port of the RaspberryPi to on and off. So a fading effect wouldn’t be quite easy I think
-
33c3 - Chaos Communication Congress 2015
Hi,
since there are many software and hardware hackers here in the forum, I thought maybe some of you are attending to this year’s Chaos Communication Congress in Hamburg, Germany hosted by the german hacker group CCC.
I will be there. Maybe some of you are too, and we can chat while having a Mate/Beer/Tschunk. I would be excited to meet some of you guys there!
-
RE: Problem: npm install && npm start
Oh snap, @strawberry-3-141 is right. Of course, I meant, that your nide version is too old. Did you try to update/install node via
apt? Tryapt-get update && apt-get upgradeorapt-get install nodejsand see, if it helps.If it doesn’t work, follow the instructions here, to install a recent version of node: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
-
RE: Problem: npm install && npm start
Hi,
it seems, that your installed version of
npmis very old.
You can update it with the commandnpm install npm@latest -gI would recommend to update all the other packages as well. You can do that by:
npm updateAfter that, run
npm installagain. -
RE: Mobile app (bachelor thesis)
Just did the survey!
I’d like to beta test the app too (as you might know already :D)
-
RE: [ORDER CLOSED] Two way mirror order in Germany
Damn! The mirror glass looks awesome!
I’ll contact you for my next mirror! :D