Dashticz - Module - Calendar

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: robgeerts, htilburgs

robgeerts
Posts: 841
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.6796
Location: The Netherlands
Contact:

Dashticz - Module - Calendar

Postby 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.

User avatar
EdKo66
Posts: 583
Joined: Sunday 22 January 2017 22:46
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Rhoon - Netherlands
Contact:

Re: Dashticz - Module - Calendar

Postby EdKo66 » 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 NAS Synology 413j | Toon Thermostat | RFxcom | Dashticz V2 |

User avatar
EdKo66
Posts: 583
Joined: Sunday 22 January 2017 22:46
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Rhoon - Netherlands
Contact:

Re: Dashticz - Module - Calendar

Postby EdKo66 » 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 NAS Synology 413j | Toon Thermostat | RFxcom | Dashticz V2 |

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

Re: Dashticz - Module - Calendar

Postby 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 ...
Raspberry Pi3 - OSMC - Domoticz - Dashticz - MiPow PlayBulb - Nanolead Aurora - KaKu - Logitech Hamony - Nest - RFLink

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

Re: Dashticz - Module - Calendar

Postby 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

robgeerts
Posts: 841
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.6796
Location: The Netherlands
Contact:

Re: Dashticz - Module - Calendar

Postby robgeerts » Monday 08 May 2017 11:19

Timezone and repeating will be fixed in upcoming version.

robgeerts
Posts: 841
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.6796
Location: The Netherlands
Contact:

Re: Dashticz - Module - Calendar

Postby 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...

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

Re: Dashticz - Module - Calendar

Postby 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.

robgeerts
Posts: 841
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.6796
Location: The Netherlands
Contact:

Re: Dashticz - Module - Calendar

Postby 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..)

User avatar
htilburgs
Posts: 295
Joined: Tuesday 03 November 2015 12:01
Target OS: Raspberry Pi
Domoticz version: v3.7404
Location: Netherland
Contact:

Re: Dashticz - Module - Calendar

Postby 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 - Yeelight RGBW Led

User avatar
HansieNL
Posts: 309
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Dashticz - Module - Calendar

Postby 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];
Domoticz on Raspberry Pi 2, Homey, Hue lights, Toon thermostat, Logitech Harmony Hub, Fibaro Wall Plug, Fibaro Push Buttons, LightWaveRF Mood Controller, Venz M9 running LibreELEC, Synology NAS

User avatar
EdKo66
Posts: 583
Joined: Sunday 22 January 2017 22:46
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Rhoon - Netherlands
Contact:

Re: Dashticz - Module - Calendar

Postby EdKo66 » 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 1455 times
Running latest BETA on a NAS Synology 413j | Toon Thermostat | RFxcom | Dashticz V2 |

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

Re: Dashticz - Module - Calendar

Postby 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: 38
Joined: Tuesday 28 October 2014 19:29
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Dashticz - Module - Calendar

Postby 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: 38
Joined: Tuesday 28 October 2014 19:29
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Dashticz - Module - Calendar

Postby 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
EdKo66
Posts: 583
Joined: Sunday 22 January 2017 22:46
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Rhoon - Netherlands
Contact:

Re: Dashticz - Module - Calendar

Postby EdKo66 » 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 NAS Synology 413j | Toon Thermostat | RFxcom | Dashticz V2 |

robgeerts
Posts: 841
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.6796
Location: The Netherlands
Contact:

Re: Dashticz - Module - Calendar

Postby robgeerts » Monday 08 May 2017 15:43

I'm rewriting the calendar block, will be up in few days I hope, please be patient! :)

User avatar
EdKo66
Posts: 583
Joined: Sunday 22 January 2017 22:46
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Rhoon - Netherlands
Contact:

Re: Dashticz - Module - Calendar

Postby EdKo66 » Monday 08 May 2017 16:33

Will do ;)
Running latest BETA on a NAS Synology 413j | Toon Thermostat | RFxcom | Dashticz V2 |

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

Re: Dashticz - Module - Calendar

Postby 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.
Raspberry Pi3 - OSMC - Domoticz - Dashticz - MiPow PlayBulb - Nanolead Aurora - KaKu - Logitech Hamony - Nest - RFLink

robgeerts
Posts: 841
Joined: Saturday 24 January 2015 23:12
Target OS: NAS (Synology & others)
Domoticz version: 3.6796
Location: The Netherlands
Contact:

Re: Dashticz - Module - Calendar

Postby robgeerts » Monday 08 May 2017 17:09

You mentioned that already, will be fixed soon ;)


Return to “Dashticz”

Who is online

Users browsing this forum: No registered users and 1 guest