Dashticz - Module - Calendar

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: htilburgs, robgeerts

Post Reply
User avatar
robgeerts
Posts: 1141
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: Son, NL
Contact:

Dashticz - Module - Calendar

Post by robgeerts » Thursday 04 May 2017 23:05

You can add a block with upcoming events from your ical-calendar (gmail, apple etc.).
Define them as:

Code: Select all

var calendars = {}
calendars.business = { maxitems: 5, url: 'https://calendar.google.com/calendar/', icalurl: 'https://calendar.google.com/calendar/' }
calendars.private = { maxitems: 5, icalurl: 'https://cors-anywhere.herokuapp.com/https://calendar.google.com/calendar/' }
And define them in a column like:

Code: Select all

columns[1] = {}
columns[1]['width'] = 2;
columns[1]['blocks'] = [calendars.business,calendars.private]
If you want to combine multiple calendars, add this code:

Code: Select all

calendars.combined = {}
calendars.combined.maxitems = 5;
calendars.combined.calendars = [
	{ color:'white',calendar:calendars.business }, 
	{ color:'#ccc',calendar:calendars.private }
]
calendars.combined.url = 'https://calendar.google.com/calendar';
And define them in a column like:

Code: Select all

columns[1] = {}
columns[1]['width'] = 2;
columns[1]['blocks'] = [calendars.combined]
If calendars wont load, add https://cors-anywhere.herokuapp.com/ in front of the url.
For example:

Code: Select all

calendars.private = { maxitems:5, icalurl: 'https://cors-anywhere.herokuapp.com/https://calendar.google.com/calendar/' }
Last edited by robgeerts on Friday 05 May 2017 13:24, edited 1 time in total.
Creator of Dashticz, Do you appreciate my work and want to buy me a beer? You can send Bitcoins to 17Qy4bsLM9J238fCZt5kaRc2bD5S1Aw6og or donate via PayPal: https://www.paypal.me/robgeerts

User avatar
EdwinK
Posts: 923
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Module - Calendar

Post by EdwinK » Saturday 06 May 2017 17:27

Mmm. I thought I had it..

Code: Select all

Missing required request header. Must specify one of: origin,x-requested-with

Code: Select all

ar calendars = {}
calendars.business = { url: 'https://cors-anywhere.herokuapp.com/https://calendar.google.com/calendar/', icalurl: 'https://cors-anywhere.herokuapp.com/<<Google kalender URL.basic.ics' }
calendars.private = { icalurl: 'https://cors-anywhere.herokuapp.com/Google kalender URL.basic.ics/' }

calendars.combined = {}
calendars.combined.calendars = [
   { color:'white',calendar:calendars.business }, 
   { color:'#ccc',calendar:calendars.private }
]
calendars.combined.url = ' https://cors-anywhere.herokuapp.com/https://calendar.google.com/calendar';
Edit. I now have removed the cors-anywhere link and then I get the following in the console:

Code: Select all

Request Headers
Provisional headers are shown
Referer:http://192.168.0.10/dashboard/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

User avatar
EdwinK
Posts: 923
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Module - Calendar

Post by EdwinK » Saturday 06 May 2017 17:42

Or this might be a problem too:

Code: Select all

Refused to display 'https://calendar.google.com/calendar/render' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

poudenes
Posts: 279
Joined: Wednesday 08 March 2017 10:42
Target OS: Linux
Domoticz version: 3.7392
Location: Amsterdam
Contact:

Re: Dashticz - Module - Calendar

Post by poudenes » Sunday 07 May 2017 23:24

Is there any solution how to shown calendars that repeating? I have lots of calendar items that is repeating every 3 weeks. Somedays more then 2 on a day.

I only see the 1 time calendar items ...
RPi3 with OSMC - RPi3 with Domoticz - Dashticz - MiLight - Nanolead Aurora - KaKu - Logitech Hamony - Nest - RFLink

bsmeding
Posts: 39
Joined: Tuesday 28 October 2014 19:29
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Dashticz - Module - Calendar

Post by bsmeding » Monday 08 May 2017 10:37

Yes me too, now whole day or repeating items.
Also still a problem with the timezone, everything is +2 hour, is there a possibility to change the timezone

I'm using iCloud calendar

User avatar
robgeerts
Posts: 1141
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: Son, NL
Contact:

Re: Dashticz - Module - Calendar

Post by robgeerts » Monday 08 May 2017 11:19

Timezone and repeating will be fixed in upcoming version.
Creator of Dashticz, Do you appreciate my work and want to buy me a beer? You can send Bitcoins to 17Qy4bsLM9J238fCZt5kaRc2bD5S1Aw6og or donate via PayPal: https://www.paypal.me/robgeerts

User avatar
robgeerts
Posts: 1141
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: Son, NL
Contact:

Re: Dashticz - Module - Calendar

Post by robgeerts » Monday 08 May 2017 12:09

bsmeding wrote:Yes me too, now whole day or repeating items.
Also still a problem with the timezone, everything is +2 hour, is there a possibility to change the timezone

I'm using iCloud calendar
Could you try latest BETA?
I'm not sure but I changed one thing that may fix it...
Creator of Dashticz, Do you appreciate my work and want to buy me a beer? You can send Bitcoins to 17Qy4bsLM9J238fCZt5kaRc2bD5S1Aw6og or donate via PayPal: https://www.paypal.me/robgeerts

qwerk
Posts: 271
Joined: Tuesday 22 July 2014 7:21
Target OS: Raspberry Pi
Domoticz version: beta
Location: Netherlands
Contact:

Re: Dashticz - Module - Calendar

Post by qwerk » Monday 08 May 2017 12:18

I am sorry to say, it does not look fixed.
no repeat en two ours off.

an ICS taking from my own mailserver ( kopano) gives the correct time. but also no repeats.

User avatar
robgeerts
Posts: 1141
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: Son, NL
Contact:

Re: Dashticz - Module - Calendar

Post by robgeerts » Monday 08 May 2017 12:22

Didnt check the repeating events yet ;)
ARRGGGHHH I hate the time offset.
In my calendar, all events were ok, but one. One had a time offset of 2 hours..
(Created on another device..)
Creator of Dashticz, Do you appreciate my work and want to buy me a beer? You can send Bitcoins to 17Qy4bsLM9J238fCZt5kaRc2bD5S1Aw6og or donate via PayPal: https://www.paypal.me/robgeerts

User avatar
htilburgs
Posts: 404
Joined: Tuesday 03 November 2015 12:01
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Netherland
Contact:

Re: Dashticz - Module - Calendar

Post by htilburgs » Monday 08 May 2017 12:42

Maybe I've overlooked it, but is there also a posibilty to just use one calendar?
I only want to use my icloud calendar.
Hardware:
Raspberry Pi 2B - Aeon Labs Z-Stick GEN5 - Fibaro Dimmer 2 - Fibaro Roller Shutter 2 - Fibaro Smoke Sensor - Yeelight RGBW Led bulb - Yeelight Smart LED Light Strip - Neo Coolcam PIR Motion Sensor - Neo Coolcam PowerPlug

User avatar
HansieNL
Posts: 327
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi
Domoticz version: Stable
Location: NL
Contact:

Re: Dashticz - Module - Calendar

Post by HansieNL » Monday 08 May 2017 12:48

htilburgs wrote:Maybe I've overlooked it, but is there also a posibilty to just use one calendar?
I only want to use my icloud calendar.
var calendars = {}
calendars.icloud = { title: 'My Calendar', icalurl: 'http://<your_url>' }

columns[1]['blocks'] = [calendars.icloud];
Blah blah blah

User avatar
EdwinK
Posts: 923
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Module - Calendar

Post by EdwinK » Monday 08 May 2017 13:33

Still can't get it to work.
Spoiler: show
var calendars = {}
calendars.business = { url: 'https://calendar.google.com/calendar/', icalurl: 'path_to_basic.ics' }
calendars.private = { icalurl: 'path_to/basic.ics' }
calendars.combined = {}
calendars.combined.calendars = [
{ color:'white',calendar:calendars.business },
{ color:'red',calendar:calendars.private }
]
calendars.combined.url = 'https://calendar.google.com/calendar';
I can see a place under 'Agenda' a slightly lighter place where there should be something, but when clicking it's empty. I think it because of the 'calendars.combined.url'. What should be there?
Screen Shot 2017-05-08 at 13.31.00.png
Agenda
Screen Shot 2017-05-08 at 13.31.00.png (128.97 KiB) Viewed 2816 times
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

bsmeding
Posts: 39
Joined: Tuesday 28 October 2014 19:29
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Dashticz - Module - Calendar

Post by bsmeding » Monday 08 May 2017 14:28

robgeerts wrote:
bsmeding wrote:Yes me too, now whole day or repeating items.
Also still a problem with the timezone, everything is +2 hour, is there a possibility to change the timezone

I'm using iCloud calendar
Could you try latest BETA?
I'm not sure but I changed one thing that may fix it...
I checked latest beta, but still a 2 hour offset

bsmeding
Posts: 39
Joined: Tuesday 28 October 2014 19:29
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Dashticz - Module - Calendar

Post by bsmeding » Monday 08 May 2017 14:31

EdKo66 wrote:Still can't get it to work.
Spoiler: show
var calendars = {}
calendars.business = { url: 'https://calendar.google.com/calendar/', icalurl: 'path_to_basic.ics' }
calendars.private = { icalurl: 'path_to/basic.ics' }
calendars.combined = {}
calendars.combined.calendars = [
{ color:'white',calendar:calendars.business },
{ color:'red',calendar:calendars.private }
]
calendars.combined.url = 'https://calendar.google.com/calendar';
I can see a place under 'Agenda' a slightly lighter place where there should be something, but when clicking it's empty. I think it because of the 'calendars.combined.url'. What should be there?

Screen Shot 2017-05-08 at 13.31.00.png
the block must have the value 'calendars.combined' {without the .url}

Code: Select all

columns[2]['blocks'] = [314,315,399,''blocktitle_14',calendars.combined]

bsmeding
Posts: 39
Joined: Tuesday 28 October 2014 19:29
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Dashticz - Module - Calendar

Post by bsmeding » Monday 08 May 2017 14:45

For all that use iCloud calendar but don't want to use an public service processing their calendar items (privacy)

I download the ical from iCloud every 5 minutes to a local folder and use this local file for the calendar plugin

the file is a php file, so you need php available
create in custom a new folder :
mkdir ical
place this file to this folder
change the path in the file for $local_file, use full path because it will run from cronjob

$remote_file = url from iCloud calendar (in example the dutch holiday's) but you can use this for you own shared iCloud calendar.

calendar.feestdagen.php

Code: Select all

<?php
$local_file = "/var/www/home.local/web/dashboard/dashticz_beta/custom/ical/calendar.feestdagen.ics";//This is the file where we save the information
$remote_file = "https://p58-calendars.icloud.com/holidays/nl_nl.ics"; //Here is the file we are downloading


$ch = curl_init();
$fp = fopen ($local_file, 'w+');
$ch = curl_init($remote_file);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_exec($ch);
curl_close($ch);
fclose($fp);

open 'crontab -e'

Code: Select all

*/5 * * * * /usr/bin/php /var/www/home.local/web/dashboard/dashticz_beta/custom/ical/calendar.gezamenlijk.php
00 00 * * * /usr/bin/php /var/www/home.local/web/dashboard/dashticz_beta/custom/ical/calendar.feestdagen.php
I use two scripts, one for holidays, update every day once at 00:00 hour
and second script run every 5 minutes to update the iCloud shared calendar (gezamenlijke) these two icals will be used in Dashticz

CONFIG.js

Code: Select all

var calendars = {}
calendars.gezamenlijk = { icalurl: 'custom/ical/calendar.gezamenlijk.ics' }
calendars.feestdagen = { icalurl: 'custom/ical/calendar.feestdagen.ics' }

calendars.combined = {}
calendars.combined.calendars = [
   { color:'white',calendar:calendars.gezamenlijk },
   { color:'#ccc',calendar:calendars.feestdagen }
]
calendars.combined.url = 'https://www.icloud.com/#calendar';



columns[2]['blocks'] = [314,315,399,'blocktitle_6','buttons.cameravoordeur','blocktitle_14',[b]calendars.combined[/b]]


User avatar
EdwinK
Posts: 923
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Module - Calendar

Post by EdwinK » Monday 08 May 2017 15:33

bsmeding wrote:
Screen Shot 2017-05-08 at 13.31.00.png
the block must have the value 'calendars.combined' {without the .url}

Code: Select all

columns[2]['blocks'] = [314,315,399,''blocktitle_14',calendars.combined]
[/quote]

That is what I have. Maybe I do something wrong with the Google Calendar. Trying with Icloud.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

User avatar
robgeerts
Posts: 1141
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: Son, NL
Contact:

Re: Dashticz - Module - Calendar

Post by robgeerts » Monday 08 May 2017 15:43

I'm rewriting the calendar block, will be up in few days I hope, please be patient! :)
Creator of Dashticz, Do you appreciate my work and want to buy me a beer? You can send Bitcoins to 17Qy4bsLM9J238fCZt5kaRc2bD5S1Aw6og or donate via PayPal: https://www.paypal.me/robgeerts

User avatar
EdwinK
Posts: 923
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Module - Calendar

Post by EdwinK » Monday 08 May 2017 16:33

Will do ;)
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

poudenes
Posts: 279
Joined: Wednesday 08 March 2017 10:42
Target OS: Linux
Domoticz version: 3.7392
Location: Amsterdam
Contact:

Re: Dashticz - Module - Calendar

Post by poudenes » Monday 08 May 2017 16:37

robgeerts wrote:Timezone and repeating will be fixed in upcoming version.
In v2 and Beta i can't see my repeating calendar. just the one time calendars.
RPi3 with OSMC - RPi3 with Domoticz - Dashticz - MiLight - Nanolead Aurora - KaKu - Logitech Hamony - Nest - RFLink

User avatar
robgeerts
Posts: 1141
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: Son, NL
Contact:

Re: Dashticz - Module - Calendar

Post by robgeerts » Monday 08 May 2017 17:09

You mentioned that already, will be fixed soon ;)
Creator of Dashticz, Do you appreciate my work and want to buy me a beer? You can send Bitcoins to 17Qy4bsLM9J238fCZt5kaRc2bD5S1Aw6og or donate via PayPal: https://www.paypal.me/robgeerts

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests