smartvisu - Kalender

Begonnen von redlav, 03 April 2015, 15:21:20

Vorheriges Thema - Nächstes Thema

RoBra81

Guten Morgen,

ich teste für mich gerade Smartvisu, da ich mit der FTUI-Performance auf meinem alten Tablet sehr unzufrieden war. Der erste Eindruck ist sehr positiv. Nun wollte ich meinen Google-Kalender wie hier beschrieben einbinden, komme aber gerade nicht wirklich weiter. Ich habe die iCalcreator.class.php aus der Version 2.20.2 in /var/www/html/smartvisu/lib/iCalcreator kopiert, die ical.php angepasst und nach /var/www/html/smartvisu/lib/calendar/service kopiert. Bei beiden Dateien habe ich im Linux Rechte und Besitzer angepasst. Außerdem habe ich die widget_ical.html in meine Page kopiert.
In meiner Seite habe ich

  {% import "widget_ical.html" as calendar %}
  {{ calendar.list('calendarlist', 'Termine', 6, 21) }}


drin. Konfiguriert ist ical mit meinem privaten Google-Kalender-Link zur basic.ics. Wenn ich diesen Link im Browser eingebe, wird die ICS heruntergeladen. Leider zeigt die Smartvisu nix an...

GET http://xx.xx.xx.xx/smartvisu/lib/calendar/service/ical.php?url=https%3A%2...com%2Fprivate-xxxxxxxxxxxxxxxxx%2Fbasic.ics&count=6&days=21 500 (Internal Server Error)
Uncaught SyntaxError: Unexpected end of input


Woran kann das liegen, bzw. was kann ich zur Analyse noch liefern?

Vielen Dank
Ronny

Zeitisen

Hallo,

gibt es irgendwo einen screenshot von smartvisu?
Ein Bild sagt oft mehr als tausend Worte.

RoBra81


Zeitisen

Danke!

Ich dachte, dass im fhem-wiki und im Forum alles dazu zu finden sein müsste.
Dass ich gleich die ganze Welt brauche, hätte ich nicht erwartet.

Knurb

Ich habe mir den Kalender nun auch installiert.
Dank der guten Anleitung funktionierte das auch einwandfrei.

Die Termine aus meinem Google Kalender werden mir angezeigt, wenn ich die URL inkl. Farbe und Icon unter den Settings eintrage, wird mir auch dieses richtig angezeigt.
Wenn ich die nur die URL eintrage und die Farbe in der Terminbeschreibung im Format z.b. #8B5A2B angebe klappt das auch, was allerdings nicht funktioniert, ist die Definition eines Icons in der Beschreibung.

Egal ob

message_garbage.png
message_garbage
/sw/message_garbage.png
/var/www/html/smartvisu/icons/sw/message_garbage.png

in der Beschreibung steht, es erscheint immer das Standard Icon.

Hat jemand eine Idee woran das liegen könnte?

Danke,

Knurb

Gigafix

Hallo Knurb

Ich habe bei mir die Version 2.8 installiert. Dort benötigt man das .svg Format. Das sieht dann in der Terminbeschreibung so aus:
@icon        icons/ws/scene_party.svg
@color       #87CEFA

In der Version 2.7 sollte das aber auch mit .png genauso funktionieren, wenn der Dateipfad stimmt.

Gruß
Gigafix
VM Synology DS918 | CubieTruck |2x HMLAN | HMUSB | 3x HMWLAN | CCU2 | MAX-Cube | nanoCUL | ZWDongle |

dev0

Keine Fehlermeldung in der Browser Konsole oder Webserver Log?

Knurb

Ich habe jetzt euch erst einmal die SV Version 2.8 installiert. Leider brachte dies auch nicht den gewünschten Erfolg.

Stand ist immer noch der von gestern.

Ich kann einzig und allein die Farbe ändern, und auch nur dann, wenn ich nur den Farbcode eingebe.
Die Eingabe "@color       #87CEFA" bewirkt leider auch nichts. (siehe Bilder)

Die Browser Konsole liefert keinen Fehler. Im Apache Log taucht allerdings ein Eintrag auf, der mit der Sache zu tuen haben könnte.

Undefined index: content in /var/www/html/smartvisu/lib/calendar/calendar.php on line 58, referer: http://192.168.0.200/smartvisu/index.php

Eingerichtet habe ich es nach der Anleitung im Wiki, außer, dass die URL in der Konfig auf einen Google Kalender verweist (https://calendar.google.com/calendar/ical/................................................../basic.ics)


Hier noch die verwendete ical.php
<?php
/**
 * -----------------------------------------------------------------------------
 * @package     smartVISU
 * @author      Norbert Valder
 * @copyright   2014
 * @license     GPL [http://www.gnu.de]
 * @iCalcreator written by Kjell-Inge Gustafsson, http://kigkonsult.se/
 * -----------------------------------------------------------------------------
 */

require_once '../../../lib/includes.php';
require_once 
const_path_system.'calendar/calendar.php';
require_once 
"/var/www/html/smartvisu/lib/calendar/iCalcreator.class.php";  //Pfad anpassen
 
/**
 * This class reads a ical calendar
 */
class calendar_ical extends calendar{
/**
 * initialization of some parameters
 */
public function init($request)
{
parent::init($request);
$this->count = (int)$request['count'];
$this->days  = (int)$request['days'];
}
/**
* Parse and Expand the defined Calendar(s)
*/
public function run(){
$Debug false;
$Timestamptime();
$DateFrom = new DateTime("@$Timestamp");
$DateTo = new DateTime("@$Timestamp"); 
$DateTo->modify('+'.$this->days.'day');
$Calendar explode(';',$this->url);
foreach ($Calendar as $CalendarDefinition){
$ColorStd "";
$IconStd "";
$typ substr($CalendarDefinition,0,4);
if ($Debug == true){echo "CalendarDefinition : $CalendarDefinition\n";}
if ($Debug == true){echo "Typ : $typ\n";}
if ($typ == "file"){
if ($Debug == true){echo "Type = file\n";}
$http false;
$CalendarDefinition substr($CalendarDefinition,5);
if (strpos($CalendarDefinition,"(") > 0){
$CalendarDetails explode('(',$CalendarDefinition);
$Filename $CalendarDetails[0];
$CalendarParams explode(',',str_replace(")","",$CalendarDetails[1]));
$ColorStd $CalendarParams[0];
$IconStd $CalendarParams[1];
}else{
$Filename $CalendarDefinition;
}
$dir substr($Filename,0,strripos($Filename"/"));
$Filename substr($Filename,strripos($Filename"/") + 1);
}else{
$http true;
if ($Debug == true){echo "Type = http\n";}
if (strpos($CalendarDefinition,"(") > 0){
$CalendarDetails explode('(',$CalendarDefinition);
$CalendarUrl $CalendarDetails[0];
$CalendarParams explode(',',str_replace(")","",$CalendarDetails[1]));
$ColorStd $CalendarParams[0];
$IconStd $CalendarParams[1];
}else{
$CalendarUrl $CalendarDefinition;
}
}
if ($http != true){
if ($Debug == true){echo "Type = file-Config\n";echo "$dir\n";echo "$Filename\n";}
$Config = array("unique_id" => "Cale"
   "TZID"      => "Europe/Berlin",
"directory" => "$dir",
"filename"  => "$Filename");
}else{
if ($Debug == true){echo "Type = http-Config\n";echo "$Calenderurl\n";}
$Config = array("unique_id" => "Cale"
   "TZID"      => "Europe/Berlin",
"url"  => $CalendarUrl);
  
}  
$Vcalendar = new vcalendar$Config );
$Vcalendar->parse(); 
$Vcalendar->sort(); 
$EventArray $Vcalendar->selectComponents(intval($DateFrom->format('Y')),intval($DateFrom->format('m')),intval($DateFrom->format('d')),
 intval($DateTo->format('Y')),intval($DateTo->format('m')),intval($DateTo->format('d')),
 FALSEFALSETRUETRUE);
foreach( $EventArray as $Year => $YearArray) {
  foreach( $YearArray as $Month => $MonthArray ) {
   foreach( $MonthArray as $Day => $DailyEventsArray ) {
    foreach( $DailyEventsArray as $Vevent ) {
     $Start $Vevent->getProperty"x-current-dtstart" );
     $End $Vevent->getProperty"x-current-dtend" );
            $Summary $Vevent->getProperty"summary" );
            $Location $Vevent->getProperty"location" );
            $Description $Vevent->getProperty"description" );
            if (substr($Description,0,1) == "#" and substr($Description,7,1) == ":"){
             $Color substr($Description,0,7);
             $Icon substr($Description,8);
            }elseif (substr($Description,0,1) == "#" and substr($Description,7,1) != ":"){
             $Color substr($Description,0,7);
             if ($IconStd != ""){
             $Icon $IconStd;
             }else{
             $Icon "message_info";
             }
            }elseif (substr($Description,0,1) != "#") {
             if ($ColorStd != ""){
             $Color $ColorStd;
             }else{
             $Color "faebd7";
             }
             if ($IconStd != ""){
             $Icon $IconStd;
             }else{
             $Icon "message_info";
             }
            }else{
             if ($ColorStd != ""){
             $Color $ColorStd;
             }else{
             $Color "faebd7";
             }
             if ($IconStd != ""){
             $Icon $IconStd;
             }else{
             $Icon "message_info";
             }
            }     
        $temp[] = array($Start[1],$End[1],$Summary,$Location,'icons/ws/'.$Icon.'.svg',$Color);
      }
    }
  }
    }
}
  
$this->i=0;
sort($temp);
foreach ($temp as $Calendarline){
if ($this->== $this->count){
break;
}
  $this->data[] = array(
'pos' => $this->i++,
'start' => $Calendarline[0],
'end' => $Calendarline[1],
'title' => $Calendarline[2],
'where' => $Calendarline[3],
'icon' => $Calendarline[4],
'color' => $Calendarline[5]);
}
}
}


// -----------------------------------------------------------------------------
// call the service
// -----------------------------------------------------------------------------

$service = new calendar_ical(array_merge($_GET$_POST));
echo 
$service->json();

?>


und die calendar.php
<?php
/**
 * -----------------------------------------------------------------------------
 * @package     smartVISU
 * @author      Martin Gleiß
 * @copyright   2012 - 2015
 * @license     GPL [http://www.gnu.de]
 * -----------------------------------------------------------------------------
 */


require_once const_path_system.'service.php';


/**
 * This class is the base class of all services
 */
class calendar extends service
{
var $count 1;

/**
 * initialization of some parameters
 */
public function init($request)
{
parent::init($request);

$this->count $request['count'];
}

/**
 * prepare the data
 */
public function prepare()
{
foreach ($this->data as $id => $ds)
{
$start strtotime($ds['start']);
$end strtotime($ds['end']);

$this->data[$id]['starttime'] = transdate('time'$start);
$this->data[$id]['endtime'] = transdate('time'$end);

if (date('Y-m-d'$start) == date('Y-m-d'$end))
$this->data[$id]['period'] = transdate('short'$start).' - '.date('H:i'$end);
else
$this->data[$id]['period'] = transdate('short'$start).' - '.transdate('short'$end);

$this->data[$id]['weekday'] = transdate('l'$start);

// content
$tags null;

if ($this->data[$id]['icon'] == '')
$this->data[$id]['icon'] = 'pages/base/pics/trans.png';

preg_match_all('#@(.+?)\W+(.*)#i'$this->data[$id]['content'], $tags);
foreach ($tags[0] as $nr => $hit)
{
$tag trim($tags[1][$nr]);
if ($tag == 'icon')
{
if (is_file(const_path.$tags[2][$nr]))
$this->data[$id][$tag] = $tags[2][$nr];
}
elseif ($tag == 'color')
$this->data[$id][$tag] = '#'.trim($tags[2][$nr]);
}
}
}

}

?>



Knurb

Gigafix

#53
Hallo Knurb

In meinem Kalender habe ich es folgendermaßen im Beschreibungsfeld stehen -> siehe Anhang

Gruß
Gigafix

***EDIT***
Ich habe bei mir gerade noch einmal nachgesehen - ich habe auch den GoogleV3 Kalender eingebunden. Dort werden alle Accountangaben in der php Datei eingetragen. Beschreibung/Eintragung Zeile 35-43. Eventuell hilft diese Info noch etwas weiter.....
VM Synology DS918 | CubieTruck |2x HMLAN | HMUSB | 3x HMWLAN | CCU2 | MAX-Cube | nanoCUL | ZWDongle |

Knurb

Hi Gigafix,

Ich komme erst nächste Woche dazu es zu testen.

Melde mich dann.

Danke euch,

Knurb


molli123

Hallo,

ich bekomme den Kalender einfach nicht zum Laufen!!! Ich lade bei google die URL:

https://calendar.google.com/calendar/ical/maxmuster%40googlemail.com/private-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/basic.ics

herunter und trage diese auf der SV Configseite unter Kalender ein. Den Rest habe ich versucht nache Seite 1 zu machen.
Kann mir irgendwer helfen, wäre sehr dankbar.

Grüße Molli

Sebastiaan

#56
Hallo,

für alle die mit Owncloud 9.0 Arbeiten:

Den URL um ein ics datei zu exportieren hat sich geändert nach:

https://<username>:<passwd>@example.com/remote.php/caldav/calendars/username/calendarname?export

Siehe: https://forum.owncloud.org/viewtopic.php?t=24208

Hoffe dies hilft der ein oder andren...

Grüße,
Bas

sTaN

Hallo Zusammen,

hat den schon jemand den iCalcreator 2.22.1 zum Laufen bekommen? In der neusten Version sind sämtliche Klassen und Funktionen aufgesplittet worden...
ZitatThe iCalcreator 2.22 release requires PHP >= 5.3.0 due to major updates in the
selectComponents method.
The returnCalender/useCachedCalendar methods no longer stops PHP script (die),
  return TRUE on success!
iCalcreator.class.php is now split into class and function files and need a new
  PHP iCalcreator invoke.
Habe es noch nicht geschafft meinen Google Kalender in smartVisu einzubinden.

Gruß
sTaN
Raspberry Pi 3
2 x CUL CC1101-USB-Lite 868MHz
FS20 Komponenten, Philips HUE, Alexa-Fhem, MAX! Geräte, homebridge, harmony, Unifi, FirtzBox, MQTT, Aurora, Denon, Sonos, TabletUI, CALENDAR, EGPM2LAN, Pushover

littleswabi

Download link funktioniert nicht?!

Wenn ich auf die genannte Seite gehe und den Download starten will kommt nur

Zitat
SMTP Error: The following recipients failed: ical@kigkonsult.se Warning: Cannot modify header information - headers already sent by (output started at /customers/6/b/8/kigkonsult.se/httpd.www/includes/PHPMailer_5.2.0/class.phpmailer.php:640) in /customers/6/b/8/kigkonsult.se/httpd.www/downloads/dl2.php on line 635 Warning: Cannot modify header information - headers already sent by (output started at /customers/6/b/8/kigkonsult.se/httpd.www/includes/PHPMailer_5.2.0/class.phpmailer.php:640) in /customers/6/b/8/kigkonsult.se/httpd.www/downloads/dl2.php on line 636 Warning: Cannot modify header information - headers already sent by (output started at /customers/6/b/8/kigkonsult.se/httpd.www/includes/PHPMailer_5.2.0/class.phpmailer.php:640) in /customers/6/b/8/kigkonsult.se/httpd.www/downloads/dl2.php on line 637 Warning: Cannot modify header information - headers already sent by (output started at /customers/6/b/8/kigkonsult.se/httpd.www/includes/PHPMailer_5.2.0/class.phpmailer.php:640) in /customers/6/b/8/kigkonsult.se/httpd.www/downloads/dl2.php on line 638 Warning: Cannot modify header information - headers already sent by (output started at /customers/6/b/8/kigkonsult.se/httpd.www/includes/PHPMailer_5.2.0/class.phpmailer.php:640) in /customers/6/b/8/kigkonsult.se/httpd.www/downloads/dl2.php on line 639 Warning: Cannot modify header information - headers already sent by (output started at /customers/6/b/8/kigkonsult.se/httpd.www/includes/PHPMailer_5.2.0/class.phpmailer.php:640) in /customers/6/b/8/kigkonsult.se/httpd.www/downloads/dl2.php on line 640 Warning: Cannot modify header information - headers already sent by (output started at /customers/6/b/8/kigkonsult.se/httpd.www/includes/PHPMailer_5.2.0/class.phpmailer.php:640) in



rot-weiss4

Zitat von: littleswabi am 14 November 2016, 20:54:55
Download link funktioniert nicht?!

Wenn ich auf die genannte Seite gehe und den Download starten will kommt nur

Hab dasselbe Problem. Der Link im wiki führt leider auf dieselbe Seite. Einer eine Idee?