Müllkalender via openHAB

Für welche Projekte verwendet Ihr OpenHAB? Was habt Ihr automatisiert? Stellt eure Projekte hier vor.

Moderatoren: Cyrelian, seppy

Antworten
int5749
Beiträge: 1161
Registriert: 4. Nov 2019 22:08
Answers: 9

Re: Müllkalender via openHAB

Beitrag von int5749 »

Hi,

schönen Dank dafür, auch wenn meine Stadt eine eigene App mit konfigurierbarer Erinnerung anbietet, ist es auch hilfreich, die Termine in OpneHab zu haben. Bei mir funktioniert zumindest nach erster Einschätzung die Online Version, es wird der nächste Abholtermin angezeigt. Mal sehen, was passiert, wenn dieser morgen bzw heute fällig ist.

Die Implementierung der Online Ferienabfrage bereit leider noch Probleme :roll:
alkaline hat geschrieben: 8. Dez 2017 16:26 Kein Problem

Holiday items:

Code: Alles auswählen

// Die URL muss jedes Jahr neu auf http://www.schulferien.org/deutschland/ical/ nachgeschlagen werden ?

Group gHoliday    	"Ferien & Feiertag(e)"	        (Whg)  	// zur Anzeige in Sitemap
Group gSpecialday   "Feiertage"	       	(Whg)

String GlobalSpecialDayICAL	{http="<[http://www.schulferien.org/media/ical/deutschland/ferien_baden-wuerttemberg_%1$tY.ics?k=OUsfROyB07kS4AILgtWURacIdRwdPWI55knDN4qtsGOWXaqgJxiuLloqa5uKp1RKR5BgYWS47N2BokflkoVnQNd_jRCEXpYjAEA2QDqsKY8:7200000:JS(ical_holiday.js)]"}
String GlobalHolidayICAL 	{http="<[http://www.schulferien.org/media/ical/deutschland/ferien_baden-wuerttemberg_%1$tY.ics?k=OUsfROyB07kS4AILgtWURacIdRwdPWI55knDN4qtsGOWXaqgJxiuLloqa5uKp1RKR5BgYWS47N2BokflkoVnQNd_jRCEXpYjAEA2QDqsKY8:7200000:JS(ical_holiday.js)]"}

Switch GlobalHoliday 		(gHoliday)
String GlobalHolidayName
Feiertage rules:

Code: Alles auswählen

/**
 * Ferien und Feiertage prüfen
 */

rule "Event_Holiday 1"
when
   Item GlobalHolidayICAL changed or
   Item GlobalSpecialDayICAL changed
then
   //Prüfen ob ein Feiertag ist
   if (GlobalSpecialDayICAL.state != "false" && GlobalSpecialDayICAL.state != "Uninitialized"){
      GlobalHoliday.postUpdate(ON)
      GlobalHolidayName.postUpdate(GlobalSpecialDayICAL.state)
      //sendTelegram("Marcus", "Heute ist ein Feiertag: " + GlobalSpecialDayICAL)
      //logInfo("HomeBox.SystemRules:Event_Holiday", "GlobalSpecialDayICAL changed: Updated Holiday Status: " + Feiertag.state + " (" + FeiertagName.state + ")")
   }
   // Prüfen ob Ferien sind
   else if (GlobalHolidayICAL.state != "false" && GlobalHolidayICAL.state != "Uninitialized"){
      GlobalHoliday.postUpdate(ON)
      GlobalHolidayName.postUpdate(GlobalHolidayICAL.state)
      //logInfo("HomeBox.SystemRules:Event_Holiday", "GlobalHolidayICAL changed: Updated Holiday Status: " + GlobalHoliday.state + " (" + GlobalHolidayName.state + ")")
   } else {
      GlobalHoliday.postUpdate(OFF)
      GlobalHolidayName.postUpdate("false")
      //logInfo("HomeBox.SystemRules:Event_Holiday", "Updated Holiday Status: " + GlobalHoliday.state + " (false)")
   }
end

/**
 * Ferien und Feiertage pr�fen
 */
//rule "Event_Holiday"
//when
//   Item GlobalHolidayICAL changed or
//   Item GlobalSpecialDayICAL changed
//then
//   //Pr�fen ob ein Feiertag ist
//   if (GlobalSpecialDayICAL.state != "false" && GlobalSpecialDayICAL.state != "Uninitialized"){
//      postUpdate(GlobalHoliday,ON)
//      postUpdate(GlobalHolidayName,GlobalSpecialDayICAL.state)
//      logInfo("HomeBox.SystemRules:Event_Holiday", "GlobalSpecialDayICAL changed: Updated Holiday Status: " + GlobalHoliday.state + " (" + GlobalHolidayName.state + ")")
//   }
//   // Pr�fen ob Ferien sind
//   else if (GlobalHolidayICAL.state != "false" && GlobalHolidayICAL.state != "Uninitialized"){
//      postUpdate(GlobalHoliday,ON)
//      postUpdate(GlobalHolidayName,GlobalHolidayICAL.state)
//      logInfo("HomeBox.SystemRules:Event_Holiday", "GlobalHolidayICAL changed: Updated Holiday Status: " + GlobalHoliday.state + " (" + GlobalHolidayName.state + ")")
//   } else {
//      postUpdate(GlobalHoliday,OFF)
//      postUpdate(GlobalHolidayName,"false")
//      logInfo("HomeBox.SystemRules:Event_Holiday", "Updated Holiday Status: " + GlobalHoliday.state + " (false)")
//   }
//end
Für die Feiertage stelle ich gerade auf Empheris um, aber die Schulferien wären interessant.
Ich habe die *.js abgelegt, Items und Rule erstellt, aber VSC zeigt noch Fehler :cry:

The method or field GlobalHoliday is undefined(org.eclipse.xtext.diagnostics.Diagnostic.Linking)

Die Items sind angelegt und gespeichert. Hat da evtl. jemand einen Tipp?

Viele Grüße,
Jörg
openHAB 4.1.0 Release mit openHABian in einem Debian Bookworm (LXC) unter Proxmox 8.1.3

int5749
Beiträge: 1161
Registriert: 4. Nov 2019 22:08
Answers: 9

Re: Müllkalender via openHAB

Beitrag von int5749 »

alkaline hat geschrieben: 4. Jan 2020 13:56 Hi

konnte es selbst lösen, indem ich die *.js Dateien um einen Tag zurücksetze. Mir ist damit leider nicht klar, warum dies im Gegensatz zur Online Variante getan werden muss, aber damit geht es.

Code: Alles auswählen

abfall = dateTo.getFullYear() + "-" + (dateTo.getMonth() + 1) + "-" + ([b]dateTo.getDate() -1)[/b] + "T00:00:00"
Hi,

an welcher Stelle hast Du dies in ie *.js gesetzt? Und drehst Du den Monat nicht um +1 nach vorne??

Bei mir ist es auch in der online Version um +1 Tag :-/

VG
Jörg
openHAB 4.1.0 Release mit openHABian in einem Debian Bookworm (LXC) unter Proxmox 8.1.3

Benutzeravatar
alkaline
Beiträge: 173
Registriert: 20. Apr 2017 13:25

Re: Müllkalender via openHAB

Beitrag von alkaline »

int5749 hat geschrieben: 24. Feb 2020 22:16 an welcher Stelle hast Du dies in ie *.js gesetzt? Und drehst Du den Monat nicht um +1 nach vorne??

Bei mir ist es auch in der online Version um +1 Tag :-/

VG
Jörg
Ich habe mittlerweile zwei js Versionen im Einsatz, da ich leider nicht so sehr versiert bin, um den Fehler zu finden:
- eine, die nur online arbeitet
- eine weitere, die nur offline arbeitet

Ich habe jetzt diese "lokalen" Versionen im Einsatz:
abfall_heute_lokal.js

Code: Alles auswählen

(function(i) {
 
	var Ical = function Ical(){
		this.version = '';
		this.prodid = '';
		this.events = [];
		this.todos = [];
		this.journals = [];
		this.freebusys = [];
	}
	var xprops = 'x-[^:;]+';
	var ianaprops = '[\\w]+[^:;]+'
	var icalParser = {
		icals : [],
		propsList : {
			'event':'(dtstamp|uid|dtstart|class|created|description|geo|last-mod|location|organizer|priority|seq|status|summary|transp|url|recurid|rrule|dtend|duration|attach|attendee|categories|comment|contact|exdate|rstatus|related|resources|rdate|'+xprops+'|'+ianaprops+')',
			'freebusy':'(dtstamp|uid|contact|dtstart|dtend|organizer|url|attendee|comment|freebusy|rstatus|'+xprops+'|'+ianaprops+')',
			'journal':'(dtstamp|uid|class|created|dtstart|last-mod|organizer|recurid|seq|status|summary|url|rrule|attach|attendee|categories|comment|contact|description|exdate|related|rdate|rstatus|'+xprops+'|'+ianaprops+')',
			'todo':'(dtstamp|uid|class|completed|created|description|dtstart|geo|last-mod|location|organizer|percent|priority|recurid|seq|status|summary|url|rrule|due|duration|attach|attendee|categories|comment|contact|exdate|rstatus|related|resources|rdate|'+xprops+'|'+ianaprops+')'
		},
		parseIcal : function(icsString){
			var cals = icsString.match(/BEGIN:VCALENDAR\r?\n(.*\r?\n)+?END:VCALENDAR/ig);
			for(var index in cals){
				//console.log("--->"+index+" "+cals[index]);
				var ical = new Ical(); 
				ical.version = this.getValue('VERSION',cals[index]);
				ical.prodid = this.getValue('PRODID',cals[index]);
				cals[index] = cals[index].replace(/\r\n /g,'');
				cals[index] = cals[index].replace(/BEGIN:VCALENDAR\r?\n/ig,'');
				var reg = /BEGIN:(V.*?)\r?\n(.*\r?\n)+?END:\1/gi;
				matches = cals[index].match(reg);
				if(matches){
					for(i=0;i<matches.length;i++){
						//console.log('---------->'+matches[i]+"\n<------------");
						this.parseVComponent(matches[i],ical);
					}
				}
				this.icals[this.icals.length] = ical;
			}
		},
		parseVComponent : function(vComponent,ical){
			var nameComponent = vComponent.match(/BEGIN:V([^\s]+)/i)[1].toLowerCase();
			vComponent = vComponent.replace(/\r?\n[\s]+/igm,''); //unfolding
			vComponent = vComponent.replace(/(^begin|^end):.*/igm,'');
			//console.log(nameComponent+' ++++ '+vComponent);
			var props = vComponent.match(new RegExp(this.propsList[nameComponent]+'[:;].*','gim'));
			if(props){
				var component=[];
				for(var index in props){
					var nom = props[index].replace(/[:;].*$/,'');
					//console.log("--vcompo "+index+" "+nom);
					var propKey = /*'prop_'+*/nom.toLowerCase();
					if(component[propKey]===undefined) component[propKey] = [];
					component[propKey][component[propKey].length] = this.getValue(nom,props[index]);
					component['raw'] = vComponent;
				}
				if(ical[nameComponent+'s'] !== undefined)
					ical[nameComponent+'s'][ical[nameComponent+'s'].length] = component;
			}
		},
		getValue: function(propName,line){
			//console.log(line);
			var prop={};
			line = line.replace(/^\s+/g,'').replace(/\s+$/gi,'');
			reg = new RegExp('('+propName+')((?:;[^=]*=[^;:\n]*)*):([^\n\r]*)','gi');
			var matches = reg.exec(line);
			if(matches){ //on a trouvé la propriété cherchée
				//console.log(propName+' ==] params='+RegExp.$2+' / valeur='+RegExp.$3);
				var valeur = RegExp.$3;
				var tab_params=[];
				if(RegExp.$2.length>0){ //il y a des paramètres associés
					var params = RegExp.$2.substr(1).split(';');
					var pair;
					for(k=0;k<params.length;k++){
						pair = params[k].split('=');
						if(!pair[1]) pair[1] = pair[0];
						tab_params[pair[0]] = pair[1];
					}
				}
				prop = { value:valeur,name:propName };
				if(Object.keys(tab_params).length>0)
					prop.params = tab_params;
			}
			return prop;
		},
	}
	
	
	/**
	* Funktion um ical Datumsstring (YYYYMMDD) in Date Objekt zu wandeln
	*/
	function calenDateFrom(icalStr)  {
		var strYear = icalStr.substr(0,4);
		var strMonth = parseInt(icalStr.substr(4,2),10)-1;
		var strDay = icalStr.substr(6,2);
		var oDate =  new Date(strYear,strMonth, strDay, 0,0,0,0)
 
		return oDate;
	}
	
	var dateCurrent = new Date();
	var abfall = "";
	//read current date and remove time stamps, just the plain date is needed
	dateCurrent.setHours(0,0,0,0)
	icalParser.parseIcal(input);
	
	var event = icalParser.icals[0].events[0];
	//parse through all events in the calendar
	icalParser.icals[0].events.forEach(function (currentValue, index, originalArray)
	{
		var dateStart = calenDateFrom(currentValue.dtstart[0].value);
		
		//check if the event happens today
		if (dateCurrent.getTime() == dateStart.getTime()){
			abfall = abfall + " + " + currentValue.summary[0].value;
		}
	});
	if (abfall == "") return "false";
	else return abfall.substring(3);
	
})(input);
abfall_morgen_lokal.js

Code: Alles auswählen

(function(i) {
 
	var Ical = function Ical(){
		this.version = '';
		this.prodid = '';
		this.events = [];
		this.todos = [];
		this.journals = [];
		this.freebusys = [];
	}
	var xprops = 'x-[^:;]+';
	var ianaprops = '[\\w]+[^:;]+'
	var icalParser = {
		icals : [],
		propsList : {
			'event':'(dtstamp|uid|dtstart|class|created|description|geo|last-mod|location|organizer|priority|seq|status|summary|transp|url|recurid|rrule|dtend|duration|attach|attendee|categories|comment|contact|exdate|rstatus|related|resources|rdate|'+xprops+'|'+ianaprops+')',
			'freebusy':'(dtstamp|uid|contact|dtstart|dtend|organizer|url|attendee|comment|freebusy|rstatus|'+xprops+'|'+ianaprops+')',
			'journal':'(dtstamp|uid|class|created|dtstart|last-mod|organizer|recurid|seq|status|summary|url|rrule|attach|attendee|categories|comment|contact|description|exdate|related|rdate|rstatus|'+xprops+'|'+ianaprops+')',
			'todo':'(dtstamp|uid|class|completed|created|description|dtstart|geo|last-mod|location|organizer|percent|priority|recurid|seq|status|summary|url|rrule|due|duration|attach|attendee|categories|comment|contact|exdate|rstatus|related|resources|rdate|'+xprops+'|'+ianaprops+')'
		},
		parseIcal : function(icsString){
			var cals = icsString.match(/BEGIN:VCALENDAR\r?\n(.*\r?\n)+?END:VCALENDAR/ig);
			for(var index in cals){
				//console.log("--->"+index+" "+cals[index]);
				var ical = new Ical(); 
				ical.version = this.getValue('VERSION',cals[index]);
				ical.prodid = this.getValue('PRODID',cals[index]);
				cals[index] = cals[index].replace(/\r\n /g,'');
				cals[index] = cals[index].replace(/BEGIN:VCALENDAR\r?\n/ig,'');
				var reg = /BEGIN:(V.*?)\r?\n(.*\r?\n)+?END:\1/gi;
				matches = cals[index].match(reg);
				if(matches){
					for(i=0;i<matches.length;i++){
						//console.log('---------->'+matches[i]+"\n<------------");
						this.parseVComponent(matches[i],ical);
					}
				}
				this.icals[this.icals.length] = ical;
			}
		},
		parseVComponent : function(vComponent,ical){
			var nameComponent = vComponent.match(/BEGIN:V([^\s]+)/i)[1].toLowerCase();
			vComponent = vComponent.replace(/\r?\n[\s]+/igm,''); //unfolding
			vComponent = vComponent.replace(/(^begin|^end):.*/igm,'');
			//console.log(nameComponent+' ++++ '+vComponent);
			var props = vComponent.match(new RegExp(this.propsList[nameComponent]+'[:;].*','gim'));
			if(props){
				var component=[];
				for(var index in props){
					var nom = props[index].replace(/[:;].*$/,'');
					//console.log("--vcompo "+index+" "+nom);
					var propKey = /*'prop_'+*/nom.toLowerCase();
					if(component[propKey]===undefined) component[propKey] = [];
					component[propKey][component[propKey].length] = this.getValue(nom,props[index]);
					component['raw'] = vComponent;
				}
				if(ical[nameComponent+'s'] !== undefined)
					ical[nameComponent+'s'][ical[nameComponent+'s'].length] = component;
			}
		},
		getValue: function(propName,line){
			//console.log(line);
			var prop={};
			line = line.replace(/^\s+/g,'').replace(/\s+$/gi,'');
			reg = new RegExp('('+propName+')((?:;[^=]*=[^;:\n]*)*):([^\n\r]*)','gi');
			var matches = reg.exec(line);
			if(matches){ //on a trouvé la propriété cherchée
				//console.log(propName+' ==] params='+RegExp.$2+' / valeur='+RegExp.$3);
				var valeur = RegExp.$3;
				var tab_params=[];
				if(RegExp.$2.length>0){ //il y a des paramètres associés
					var params = RegExp.$2.substr(1).split(';');
					var pair;
					for(k=0;k<params.length;k++){
						pair = params[k].split('=');
						if(!pair[1]) pair[1] = pair[0];
						tab_params[pair[0]] = pair[1];
					}
				}
				prop = { value:valeur,name:propName };
				if(Object.keys(tab_params).length>0)
					prop.params = tab_params;
			}
			return prop;
		},
	}
	
	
	/**
	* Funktion um ical Datumsstring (YYYYMMDD) in Date Objekt zu wandeln
	*/
	function calenDateFrom(icalStr)  {
		var strYear = icalStr.substr(0,4);
		var strMonth = parseInt(icalStr.substr(4,2),10)-1;
		var strDay = icalStr.substr(6,2);
		var oDate =  new Date(strYear,strMonth, strDay, 0,0,0,0)
 
		return oDate;
	}
	
	//read current date and remove time stamps, just the plain date is needed
	var dateTomorrow = new Date();
	dateTomorrow.setHours(0,0,0,0)
	dateTomorrow.setDate(dateTomorrow.getDate()+1);
	var abfall = "";
	icalParser.parseIcal(input);
	
	var event = icalParser.icals[0].events[0];
	//parse through all events in the calendar
	icalParser.icals[0].events.forEach(function (currentValue, index, originalArray)
	{
		var dateStart = calenDateFrom(currentValue.dtstart[0].value);
		
		//check if the event happens today
		if (dateTomorrow.getTime() == dateStart.getTime()){
			abfall = abfall + " + " + currentValue.summary[0].value;
		}
	});
	if (abfall == "") return "false";
	else return abfall.substring(3);
	
})(input);
abfall_naechste_abholung_datum_lokal.js

Code: Alles auswählen

(function(i) {
 
    var Ical = function Ical(){
        this.version = '';
        this.prodid = '';
        this.events = [];
        this.todos = [];
        this.journals = [];
        this.freebusys = [];
    }
    var xprops = 'x-[^:;]+';
    var ianaprops = '[\\w]+[^:;]+'
    var icalParser = {
        icals : [],
        propsList : {
            'event':'(dtstamp|uid|dtstart|class|created|description|geo|last-mod|location|organizer|priority|seq|status|summary|transp|url|recurid|rrule|dtend|duration|attach|attendee|categories|comment|contact|exdate|rstatus|related|resources|rdate|'+xprops+'|'+ianaprops+')',
            'freebusy':'(dtstamp|uid|contact|dtstart|dtend|organizer|url|attendee|comment|freebusy|rstatus|'+xprops+'|'+ianaprops+')',
            'journal':'(dtstamp|uid|class|created|dtstart|last-mod|organizer|recurid|seq|status|summary|url|rrule|attach|attendee|categories|comment|contact|description|exdate|related|rdate|rstatus|'+xprops+'|'+ianaprops+')',
            'todo':'(dtstamp|uid|class|completed|created|description|dtstart|geo|last-mod|location|organizer|percent|priority|recurid|seq|status|summary|url|rrule|due|duration|attach|attendee|categories|comment|contact|exdate|rstatus|related|resources|rdate|'+xprops+'|'+ianaprops+')'
        },
        parseIcal : function(icsString){
            var cals = icsString.match(/BEGIN:VCALENDAR\r?\n(.*\r?\n)+?END:VCALENDAR/ig);
            for(var index in cals){
                //console.log("--->"+index+" "+cals[index]);
                var ical = new Ical();
                ical.version = this.getValue('VERSION',cals[index]);
                ical.prodid = this.getValue('PRODID',cals[index]);
                cals[index] = cals[index].replace(/\r\n /g,'');
                cals[index] = cals[index].replace(/BEGIN:VCALENDAR\r?\n/ig,'');
                var reg = /BEGIN:(V.*?)\r?\n(.*\r?\n)+?END:\1/gi;
                matches = cals[index].match(reg);
                if(matches){
                    for(i=0;i<matches.length;i++){
                        //console.log('---------->'+matches[i]+"\n<------------");
                        this.parseVComponent(matches[i],ical);
                    }
                }
                this.icals[this.icals.length] = ical;
            }
        },
        parseVComponent : function(vComponent,ical){
            var nameComponent = vComponent.match(/BEGIN:V([^\s]+)/i)[1].toLowerCase();
            vComponent = vComponent.replace(/\r?\n[\s]+/igm,''); //unfolding
            vComponent = vComponent.replace(/(^begin|^end):.*/igm,'');
            //console.log(nameComponent+' ++++ '+vComponent);
            var props = vComponent.match(new RegExp(this.propsList[nameComponent]+'[:;].*','gim'));
            if(props){
                var component=[];
                for(var index in props){
                    var nom = props[index].replace(/[:;].*$/,'');
                    //console.log("--vcompo "+index+" "+nom);
                    var propKey = /*'prop_'+*/nom.toLowerCase();
                    if(component[propKey]===undefined) component[propKey] = [];
                    component[propKey][component[propKey].length] = this.getValue(nom,props[index]);
                    component['raw'] = vComponent;
                }
                if(ical[nameComponent+'s'] !== undefined)
                    ical[nameComponent+'s'][ical[nameComponent+'s'].length] = component;
            }
        },
        getValue: function(propName,line){
            //console.log(line);
            var prop={};
            line = line.replace(/^\s+/g,'').replace(/\s+$/gi,'');
            reg = new RegExp('('+propName+')((?:;[^=]*=[^;:\n]*)*):([^\n\r]*)','gi');
            var matches = reg.exec(line);
            if(matches){ //on a trouvé la propriété cherchée
                //console.log(propName+' ==] params='+RegExp.$2+' / valeur='+RegExp.$3);
                var valeur = RegExp.$3;
                var tab_params=[];
                if(RegExp.$2.length>0){ //il y a des paramètres associés
                    var params = RegExp.$2.substr(1).split(';');
                    var pair;
                    for(k=0;k<params.length;k++){
                        pair = params[k].split('=');
                        if(!pair[1]) pair[1] = pair[0];
                        tab_params[pair[0]] = pair[1];
                    }
                }
                prop = { value:valeur,name:propName };
                if(Object.keys(tab_params).length>0)
                    prop.params = tab_params;
            }
            return prop;
        },
    }
   
   
    /**
    * Funktion um ical Datumsstring (YYYYMMDD) in Date Objekt zu wandeln
    */
    function calenDateFrom(icalStr)  {
        var strYear = icalStr.substr(0,4);
	//months range from 0 - 11 in javascript!
	var strMonth = parseInt(icalStr.substr(4,2),10)-1;
        var strDay = icalStr.substr(6,2);
        var oDate =  new Date(strYear,strMonth, strDay, 0, 0, 0, 0)
 
        return oDate;
    }
 
    function leadingZero(num) {
		var s = num+"";
		if (s.length < 2) s = "0" + s;
		return s;
    }
   
    //months range from 0 - 11 in javascript!
    var dateTemp = new Date(2500,11,31); 
    var dateCurrent = new Date();
    //remove hours:min:sec, just the plain date is needed
    dateCurrent.setHours(0,0,0,0)
 
    icalParser.parseIcal(input);
    var event = icalParser.icals[0].events[0];
    
    //parse through all events in the calendar
    icalParser.icals[0].events.forEach(function (currentValue, index, originalArray)
    {
		var dateStart = calenDateFrom(currentValue.dtstart[0].value);
		//loop through all events and find the one with the lowest date, but after the current date (important for unsorted *.ics files)
		if (dateStart.getTime() > dateCurrent.getTime() && dateStart.getTime() < dateTemp.getTime())
		{
			dateTemp = dateStart;
		}
        
       
    });
    if (dateTemp.getFullYear()=="2500"){
    	return "false";
    }else{
	//turn 1-9 into 01-09
        var month = leadingZero(dateTemp.getMonth()+1);
    	var day = leadingZero(dateTemp.getDate());
	//return correct format for openhab DateTime item
    	return dateTemp.getFullYear() + "-" + month + "-" + day + "T00:00:00";
    }
})(input);
bfall_naechste_abholung_name_lokal.js

Code: Alles auswählen

(function(i) {
 
    var Ical = function Ical(){
        this.version = '';
        this.prodid = '';
        this.events = [];
        this.todos = [];
        this.journals = [];
        this.freebusys = [];
    }
    var xprops = 'x-[^:;]+';
    var ianaprops = '[\\w]+[^:;]+'
    var icalParser = {
        icals : [],
        propsList : {
            'event':'(dtstamp|uid|dtstart|class|created|description|geo|last-mod|location|organizer|priority|seq|status|summary|transp|url|recurid|rrule|dtend|duration|attach|attendee|categories|comment|contact|exdate|rstatus|related|resources|rdate|'+xprops+'|'+ianaprops+')',
            'freebusy':'(dtstamp|uid|contact|dtstart|dtend|organizer|url|attendee|comment|freebusy|rstatus|'+xprops+'|'+ianaprops+')',
            'journal':'(dtstamp|uid|class|created|dtstart|last-mod|organizer|recurid|seq|status|summary|url|rrule|attach|attendee|categories|comment|contact|description|exdate|related|rdate|rstatus|'+xprops+'|'+ianaprops+')',
            'todo':'(dtstamp|uid|class|completed|created|description|dtstart|geo|last-mod|location|organizer|percent|priority|recurid|seq|status|summary|url|rrule|due|duration|attach|attendee|categories|comment|contact|exdate|rstatus|related|resources|rdate|'+xprops+'|'+ianaprops+')'
        },
        parseIcal : function(icsString){
            var cals = icsString.match(/BEGIN:VCALENDAR\r?\n(.*\r?\n)+?END:VCALENDAR/ig);
            for(var index in cals){
                //console.log("--->"+index+" "+cals[index]);
                var ical = new Ical();
                ical.version = this.getValue('VERSION',cals[index]);
                ical.prodid = this.getValue('PRODID',cals[index]);
                cals[index] = cals[index].replace(/\r\n /g,'');
                cals[index] = cals[index].replace(/BEGIN:VCALENDAR\r?\n/ig,'');
                var reg = /BEGIN:(V.*?)\r?\n(.*\r?\n)+?END:\1/gi;
                matches = cals[index].match(reg);
                if(matches){
                    for(i=0;i<matches.length;i++){
                        //console.log('---------->'+matches[i]+"\n<------------");
                        this.parseVComponent(matches[i],ical);
                    }
                }
                this.icals[this.icals.length] = ical;
            }
        },
        parseVComponent : function(vComponent,ical){
            var nameComponent = vComponent.match(/BEGIN:V([^\s]+)/i)[1].toLowerCase();
            vComponent = vComponent.replace(/\r?\n[\s]+/igm,''); //unfolding
            vComponent = vComponent.replace(/(^begin|^end):.*/igm,'');
            //console.log(nameComponent+' ++++ '+vComponent);
            var props = vComponent.match(new RegExp(this.propsList[nameComponent]+'[:;].*','gim'));
            if(props){
                var component=[];
                for(var index in props){
                    var nom = props[index].replace(/[:;].*$/,'');
                    //console.log("--vcompo "+index+" "+nom);
                    var propKey = /*'prop_'+*/nom.toLowerCase();
                    if(component[propKey]===undefined) component[propKey] = [];
                    component[propKey][component[propKey].length] = this.getValue(nom,props[index]);
                    component['raw'] = vComponent;
                }
                if(ical[nameComponent+'s'] !== undefined)
                    ical[nameComponent+'s'][ical[nameComponent+'s'].length] = component;
            }
        },
        getValue: function(propName,line){
            //console.log(line);
            var prop={};
            line = line.replace(/^\s+/g,'').replace(/\s+$/gi,'');
            reg = new RegExp('('+propName+')((?:;[^=]*=[^;:\n]*)*):([^\n\r]*)','gi');
            var matches = reg.exec(line);
            if(matches){ //on a trouvé la propriété cherchée
                //console.log(propName+' ==] params='+RegExp.$2+' / valeur='+RegExp.$3);
                var valeur = RegExp.$3;
                var tab_params=[];
                if(RegExp.$2.length>0){ //il y a des paramètres associés
                    var params = RegExp.$2.substr(1).split(';');
                    var pair;
                    for(k=0;k<params.length;k++){
                        pair = params[k].split('=');
                        if(!pair[1]) pair[1] = pair[0];
                        tab_params[pair[0]] = pair[1];
                    }
                }
                prop = { value:valeur,name:propName };
                if(Object.keys(tab_params).length>0)
                    prop.params = tab_params;
            }
            return prop;
        },
    }
   
   
    /**
    * Funktion um ical Datumsstring (YYYYMMDD) in Date Objekt zu wandeln
    */
    function calenDateFrom(icalStr)  {
        var strYear = icalStr.substr(0,4);
        var strMonth = parseInt(icalStr.substr(4,2),10)-1;
        var strDay = icalStr.substr(6,2);
        var oDate =  new Date(strYear,strMonth, strDay, 0,0,0,0)
 
        return oDate;
    }
   
    var abfall = "";
    //months range from 0 - 11 in javascript!
    var dateTemp = new Date(2500,11,31);
    var dateCurrent = new Date();
    //remove hours:min:sec, just the plain date is needed
    dateCurrent.setHours(0,0,0,0)
    
    icalParser.parseIcal(input);
    var event = icalParser.icals[0].events[0];
    //parse through all events in the calendar
    icalParser.icals[0].events.forEach(function (currentValue, index, originalArray)
    {
		var dateStart = calenDateFrom(currentValue.dtstart[0].value);
		//loop through all events and find the one with the lowest date, but after the current date (important for unsorted *.ics files)
		if (dateStart.getTime() > dateCurrent.getTime() && dateStart.getTime() < dateTemp.getTime())
		{
			dateTemp = dateStart;
		}
    });
 
    if (dateTemp.getFullYear()!="2500") 
    {
    icalParser.icals[0].events.forEach(function (currentValue, index, originalArray)
        {
                var dateStart = calenDateFrom(currentValue.dtstart[0].value);
		var content = currentValue.summary[0].value;
                //check if the event happens today
                if (dateStart.getTime() == dateTemp.getTime()){
			abfall = abfall + " + " + content;
                }
        });
	return abfall.substring(3);
    }else{
    return "false";
    }
   
})(input);
Hoffe sehr, das dir dies weiterhilft.

Gruß
Marcus

int5749
Beiträge: 1161
Registriert: 4. Nov 2019 22:08
Answers: 9

Re: Müllkalender via openHAB

Beitrag von int5749 »

Hallo Marcus,
danke, diese funktionieren scheinbar mit meiner Online Version, nun wird das richtige Datum angezeigt.
Mal sehen, was morgen passiert ;)
Viele Grüße,
Jörg
openHAB 4.1.0 Release mit openHABian in einem Debian Bookworm (LXC) unter Proxmox 8.1.3

mcdandrew
Beiträge: 163
Registriert: 13. Dez 2018 17:42

Re: Müllkalender via openHAB

Beitrag von mcdandrew »

alkaline hat geschrieben: 27. Apr 2017 08:27 Here we go :)

Voraussetzung sind:
Installiertes HTTP Binding und Javascript Transformation

abfall.items:
Hier ist die URL gegen eure auszutauschen, welche eigentlich jeder Abfallentsorgungsbetrieb anbietet. (Selbst bei uns auf dem Land)

Code: Alles auswählen

//Abfall heute
String ABFALL_ICAL_heute { http="<[http://www.abfallwirtschaft-ortenaukreis.de/fileadmin/ics/ical_3762.ics:360000:JS(abfall_heute.js)]" }
Switch 		ABFALL_AKTIV_heute
String 		ABFALL_NAME_heute

//Abfall morgen
String ABFALL_ICAL_morgen { http="<[http://www.abfallwirtschaft-ortenaukreis.de/fileadmin/ics/ical_3762.ics:360000:JS(abfall_morgen.js)]" }
Switch 		ABFALL_AKTIV_morgen
String 		ABFALL_NAME_morgen

// Nächste Abholung
String ABF1_NAME { http="<[http://www.abfallwirtschaft-ortenaukreis.de/fileadmin/ics/ical_3762.ics:360000:JS(abfall_naechste_abholung_name.js)]" }
DateTime ABF1_DATE { http="<[http://www.abfallwirtschaft-ortenaukreis.de/fileadmin/ics/ical_3762.ics:360000:JS(abfall_naechste_abholung_datum.js)]" }
abfall.rules:

Code: Alles auswählen

rule "Abfallkalender heute"
when
   Item ABFALL_ICAL_heute changed
then
   //Prüfen ob heute Abfall abgeholt wird
	if (ABFALL_ICAL_heute.state != "false" && ABFALL_ICAL_heute.state != "Uninitialized"){
      postUpdate(ABFALL_AKTIV_heute,ON)
      postUpdate(ABFALL_NAME_heute,ABFALL_ICAL_heute.state)
   } else {
      postUpdate(ABFALL_AKTIV_heute,OFF)
      postUpdate(ABFALL_NAME_heute,"false")
   }
end

rule "Abfallkalender morgen"
when
   Item ABFALL_ICAL_morgen changed
then
   //Prüfen ob morgen Abfall abgeholt wird
	if (ABFALL_ICAL_morgen.state != "false" && ABFALL_ICAL_morgen.state != "Uninitialized"){
      postUpdate(ABFALL_AKTIV_morgen,ON)
      postUpdate(ABFALL_NAME_morgen,ABFALL_ICAL_morgen.state)
   } else {
      postUpdate(ABFALL_AKTIV_morgen,OFF)
      postUpdate(ABFALL_NAME_morgen,"false")
   }
end

rule "Abfallerinnerung heute" // send Nachricht auf Handy via Telegramm (Marcus) und OH App (alle Nutzer)
when
Time cron "0 30 06 ? * * *" 
then
if (ABFALL_AKTIV_heute.state == ON){
sendBroadcastNotification("An den Abfall denken: " + ABFALL_NAME_heute.state)}
//sendTelegram("Marcus", "An den Abfall denken " + ABFALL_NAME_heute.state)}
end

rule "Abfallerinnerung morgen" // send Nachricht auf Handy via Telegramm (Marcus) und OH App (alle Nutzer)
when
Time cron "0 30 18 ? * * *" 
then
if (ABFALL_AKTIV_morgen.state == ON){
sendBroadcastNotification("Morgen Abfall rausstellen: " + ABFALL_NAME_morgen.state)}
//sendTelegram("Marcus", "Morgen Abfall rausstellen " + ABFALL_NAME_morgen.state)}
end
In die Sitemap einfügen:

Code: Alles auswählen

Frame label="Abfall Kalender" {
      	 		Text item=ABFALL_NAME_heute label="Abholung heute: [%s]" icon="muellwagen" visibility=[ABFALL_AKTIV_heute==ON]
        		Text item=ABFALL_NAME_morgen label="Abholung morgen: [%s]" icon="muellwagen" visibility=[ABFALL_AKTIV_morgen==ON]
        		Text item=ABF1_DATE label="Nächster Abholtermin:[%1$td.%1$tm.%1$tY]" icon="calendar" 
        		Text item=ABF1_NAME label="Was? [%s]" icon="abfall"    
        	}
transform.zip
Hat es schon jemand geschafft den Müllkalender für Openhab 3 anzupassen?

StefanH.
Beiträge: 162
Registriert: 28. Dez 2017 11:37

Re: Müllkalender via openHAB

Beitrag von StefanH. »

Ich habe gestern komplett umgestellt von dieser Implementierung auf icalender binding. Im Grunde läuft es auf dasselbe hinaus. ics Datei ablegen und vom binding auslesen lassen, danach mittels rules ein paar abfragen machen. Werde hier alles posten sobald ich am PC bin

StefanH.
Beiträge: 162
Registriert: 28. Dez 2017 11:37

Re: Müllkalender via openHAB

Beitrag von StefanH. »

hier nun meine neue Implementierung mit OH3 und dem iCalendar Binding.

Lokal habe ich eine *.ics Datei im $CONF/html Verzeichnis abgelegt.
Darin habe ich Standardeinträge von meinem Entsorgungsunternehmen geändert in einfach zu verstehende Werte: Schwarz, Gelb, Blau und Grün.
Per Telegram schicke ich mir ab 15Uhr vom Vortag eine Nachricht, die mich fragt, ob ich die Tonnen schon vors Haus gestellt habe. Wenn ich diese Telegram Nachricht nicht beantworte, wird weiterhin zur vollen Stunde eine Nachricht geschickt. Die Auswertung der Telegramantwort habe ich jetzt hier nicht extra erläutert. Kann ich aber gerne machen, falls da Bedarf besteht.

*.items

Code: Alles auswählen

Switch ABFALL_ISTHEUTE_AKTIV
Switch ABFALL_ISTHEUTE_SCHWARZ
Switch ABFALL_ISTHEUTE_BLAU
Switch ABFALL_ISTHEUTE_GELB
Switch ABFALL_ISTHEUTE_GRUEN

Switch ABFALL_ISTMORGEN_AKTIV
Switch ABFALL_ISTMORGEN_SCHWARZ
Switch ABFALL_ISTMORGEN_BLAU
Switch ABFALL_ISTMORGEN_GELB
Switch ABFALL_ISTMORGEN_GRUEN

String ABFALLTONNEN_MORGEN        "Abfalltonnen"
String ABFALLTONNEN_HEUTE         "Abfalltonnen"

DateTime ABFALL_TERMIN_SCHWARZ "Schwarze Tonne [%1$td.%1$tm.%1$tY]" { channel="icalendar:eventfilter:2af544962f:40c6153e36:result_0#begin" }
DateTime ABFALL_TERMIN_BLAU "Blaue Tonne [%1$td.%1$tm.%1$tY]" { channel="icalendar:eventfilter:2af544962f:95e2cc8be2:result_0#begin" }
DateTime ABFALL_TERMIN_GELB "Gelbe Tonne [%1$td.%1$tm.%1$tY]" { channel="icalendar:eventfilter:d97033a339:result_0#begin" }
DateTime ABFALL_TERMIN_GRUEN "Grüne Tonne [%1$td.%1$tm.%1$tY]" { channel="icalendar:eventfilter:2af544962f:6af7cad149:result_0#begin" }

Switch ABFALL_ERINNERUNG_NOTWENDIG      "Abfall Erinnerung"
Switch ABFALL_ERINNERUNG_TIMER          "Abfall Erinnerung"     { expire="60m,command=OFF" }
*.rules

Code: Alles auswählen

rule "abfall.rules - Switches fuer heute und morgen aktualisieren"
when
    Time cron "0 0 5 * * ? *"    
then
    logInfo("abfall.rules", "Switches fuer heute und morgen aktualisieren.") 
    val blau = (ABFALL_TERMIN_BLAU.state as DateTimeType).zonedDateTime
    val schwarz = (ABFALL_TERMIN_SCHWARZ.state as DateTimeType).zonedDateTime
    val gelb = (ABFALL_TERMIN_GELB.state as DateTimeType).zonedDateTime
    val gruen = (ABFALL_TERMIN_GRUEN.state as DateTimeType).zonedDateTime
    val tomorrow = now.plusDays(1);

    ABFALLTONNEN_HEUTE.sendCommand("");
    ABFALLTONNEN_MORGEN.sendCommand("");

    var tonnen_heute = "";
    var tonnen_morgen = "";
    
    if (blau.year == now.year && blau.month == now.month && blau.dayOfMonth == now.dayOfMonth)
    { 
        ABFALL_ISTHEUTE_BLAU.sendCommand("ON")
        tonnen_heute = tonnen_heute + "Blau + ";
    }else{
        ABFALL_ISTHEUTE_BLAU.sendCommand("OFF")
    }
    if (blau.year == tomorrow.year && blau.month == tomorrow.month && blau.dayOfMonth == tomorrow.dayOfMonth)
    {
        ABFALL_ISTMORGEN_BLAU.sendCommand("ON")
        tonnen_morgen = tonnen_morgen + "Blau + ";
    }else{
        ABFALL_ISTMORGEN_BLAU.sendCommand("OFF")
    }

    if (schwarz.year == now.year && schwarz.month == now.month && schwarz.dayOfMonth == now.dayOfMonth)
    { 
        ABFALL_ISTHEUTE_SCHWARZ.sendCommand("ON")
        tonnen_heute = tonnen_heute + "Schwarz + ";
    }else{
        ABFALL_ISTHEUTE_SCHWARZ.sendCommand("OFF")
    }
    if (schwarz.year == tomorrow.year && schwarz.month == tomorrow.month && schwarz.dayOfMonth == tomorrow.dayOfMonth)
    { 
        ABFALL_ISTMORGEN_SCHWARZ.sendCommand("ON")
        tonnen_morgen = tonnen_morgen + "Schwarz + ";
    }else{
        ABFALL_ISTMORGEN_SCHWARZ.sendCommand("OFF")
    }

    if (gelb.year == now.year && gelb.month == now.month && gelb.dayOfMonth == now.dayOfMonth)
    { 
        ABFALL_ISTHEUTE_GELB.sendCommand("ON")
        tonnen_heute = tonnen_heute + "Gelb + ";
    }else{
        ABFALL_ISTHEUTE_GELB.sendCommand("OFF")
    }
    if (gelb.year == tomorrow.year && gelb.month == tomorrow.month && gelb.dayOfMonth == tomorrow.dayOfMonth)
    { 
        ABFALL_ISTMORGEN_GELB.sendCommand("ON")
        tonnen_morgen = tonnen_morgen + "Gelb + ";
    }else{
        ABFALL_ISTMORGEN_GELB.sendCommand("OFF")
    }

    if (gruen.year == now.year && gruen.month == now.month && gruen.dayOfMonth == now.dayOfMonth)
    { 
        ABFALL_ISTHEUTE_GRUEN.sendCommand("ON")
        tonnen_heute = tonnen_heute + "Grün + ";
    }else{
        ABFALL_ISTHEUTE_GRUEN.sendCommand("OFF")
    }
    if (gruen.year == tomorrow.year && gruen.month == tomorrow.month && gruen.dayOfMonth == tomorrow.dayOfMonth)
    { 
        ABFALL_ISTMORGEN_GRUEN.sendCommand("ON")
        tonnen_morgen = tonnen_morgen + "Grün + ";
    }else{
        ABFALL_ISTMORGEN_GRUEN.sendCommand("OFF")
    }

    if (tonnen_heute.length > 0) {
        ABFALLTONNEN_HEUTE.sendCommand(tonnen_heute.substring(0, tonnen_heute.length - 3));
        ABFALL_ISTHEUTE_AKTIV.sendCommand("ON");
    }else{
        ABFALL_ISTHEUTE_AKTIV.sendCommand("OFF");
    }
    if (tonnen_morgen.length > 0) {
        ABFALLTONNEN_MORGEN.sendCommand(tonnen_morgen.substring(0, tonnen_morgen.length - 3));
        ABFALL_ISTMORGEN_AKTIV.sendCommand("ON");
    }else{
        ABFALL_ISTMORGEN_AKTIV.sendCommand("OFF");
    }
end
rule "abfall.rules - Muss Abfallerinnerung gesendet werden?"
when
    Time cron "0 0 15 * * ? *"
then
        logInfo("abfall.rules", "Prüfung, ob Abfallerinnerung gesendet werden muss.")
        if (ABFALL_ISTMORGEN_SCHWARZ.state == ON || ABFALL_ISTMORGEN_BLAU.state == ON || ABFALL_ISTMORGEN_GRUEN.state == ON || ABFALL_ISTMORGEN_GELB.state == ON) {
            ABFALL_ERINNERUNG_NOTWENDIG.sendCommand("ON")
            ABFALL_ERINNERUNG_TIMER.sendCommand("ON")
            logInfo("abfall.rules", "Abfallerinnerung ist notwendig!")
        }else{
            logInfo("abfall.rules", "Abfallerinnerung nicht notwendig.")
        }

end
rule "abfall.rules - Abfallerinnerung senden"
when
        Item ABFALL_ERINNERUNG_TIMER received command ON
then
        logInfo("abfall.rules", "sende Abfallerinnerung: " + ABFALLTONNEN_MORGEN.state.toString() + " für morgen schon rausgestellt?")
        val telegramAction = getActions("telegram","telegram:telegramBot:c492a03354")
        telegramAction.sendTelegramQuery(Long.valueOf(telegramChat_Gruppe.label), "Abfalltonne " + ABFALLTONNEN_MORGEN.state.toString() + " für morgen schon rausgestellt?", "Abfall", "Ja");
end
rule "abfall.rules - Abfallerinnerung erneut senden?"
when 
    Item ABFALL_ERINNERUNG_TIMER received command OFF
then
        logInfo("abfall.rules", "Abfallerinnerung erneut senden?")

        //falls keine Antwort per Telegram erfolgte und der naechste Tag bereits angebrochen ist
        if (ABFALL_ISTMORGEN_SCHWARZ.state == OFF && ABFALL_ISTMORGEN_BLAU.state == OFF && ABFALL_ISTMORGEN_GRUEN.state == OFF && ABFALL_ISTMORGEN_GELB.state == OFF) {
                ABFALL_ERINNERUNG_NOTWENDIG.sendCommand("OFF");
        }

        if (ABFALL_ERINNERUNG_NOTWENDIG.state == ON) {
                ABFALL_ERINNERUNG_TIMER.sendCommand("ON")
        }
end
Die Things dazu habe ich in der openHAB UI angelegt. Einen Kalender und 4 Filter für die Tonnenarten:
2021-01-03_20h01_59.png
Hier mal der einfachheithalber als Code (Die Refreshtime am besten zu Beginn mal auf 1 stellen)

Code: Alles auswählen

UID: icalendar:calendar:2af544962f
label: Abfallkalender
thingTypeUID: icalendar:calendar
configuration:
  maxSize: 16
  url: http://127.0.0.1:8080/static/abfallkalender/abfall.ics
  refreshTime: 1440
Filterbeispiel:

Code: Alles auswählen

UID: icalendar:eventfilter:d97033a339
label: Abfallkalender-Filter (Gelb)
thingTypeUID: icalendar:eventfilter
configuration:
  maxEvents: 1
  textValueType: TEXT
  datetimeEnd: 40
  refreshTime: 240
  datetimeStart: 0
  textEventValue: Gelb
  datetimeRound: true
  textEventField: SUMMARY
  datetimeUnit: DAY
bridgeUID: icalendar:calendar:2af544962f
Hoffe das hilft.

Stefan
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.

int5749
Beiträge: 1161
Registriert: 4. Nov 2019 22:08
Answers: 9

Re: Müllkalender via openHAB

Beitrag von int5749 »

Ich wollte nicht den Aufwand betreiben, alles auf iCal umzubauen, daher hier mal meine auf http Binding angepatte Konfig.

Things

Code: Alles auswählen

Bridge http:url:abfallkalender "Abfallkalender" @ "Internet" [
	baseURL="https://www.umwelt-webmedia.de/caldownload/bc250e0a4bc5b857abc79441b0f524c9.ics",
	  refresh=360,
	  ignoreSSLErrors=false,
	  commandMethod="GET",
	  timeout=3000,
	  bufferSize=2048
	] {
		Channels:
			Type string : ABF1_NAME	"Nächste Abholung"	[ stateTransformation="JS:abfall_naechste_abholung_name.js", mode="READONLY"]
			Type datetime : ABF1_DATE	"Datum nächste Abholung"	[ stateTransformation="JS:abfall_naechste_abholung_datum.js", mode="READONLY"]
			Type string : ABFALL_ICAL_heute	"Abholung heute"		[ stateTransformation="JS:abfall_heute.js", mode="READONLY"]
			Type string : ABFALL_ICAL_morgen	"Abholung morgen"		[ stateTransformation="JS:abfall_morgen.js", mode="READONLY"]
		}
Items

Code: Alles auswählen

//Abfallkalender
// Nächste Abholung
String ABF1_NAME	        {channel="http:url:abfallkalender:ABF1_NAME"}
DateTime ABF1_DATE      	{channel="http:url:abfallkalender:ABF1_DATE"}

//Abfall heute
String ABFALL_ICAL_heute	{channel="http:url:abfallkalender:ABFALL_ICAL_heute"}
Switch ABFALL_AKTIV_heute
String ABFALL_NAME_heute

//Abfall morgen
String ABFALL_ICAL_morgen	{channel="http:url:abfallkalender:ABFALL_ICAL_morgen"}
Switch ABFALL_AKTIV_morgen
String ABFALL_NAME_morgen
openHAB 4.1.0 Release mit openHABian in einem Debian Bookworm (LXC) unter Proxmox 8.1.3

Piko
Beiträge: 93
Registriert: 26. Nov 2019 19:05

Re: Müllkalender via openHAB

Beitrag von Piko »

Ich hab diesen wunderbaren Müllkalender auch am laufen.
Danke an der stelle an alle die daran gearbeitet haben.

Mir ist im verlauf der letzten tage aber eins aufgefallen, die anzeige das die Abfuhr von (beispiel) Grau heute ist bringt mir wenig. Bei uns wird der Abfalleimer meist schon um 6 Uhr geleert.

Deshalb die Frage!
Wie bekomme ich das ganze einen Tag nach Vorne verschoben ?

Also beide anzeigen
Abholung morgen
Abholung heute

Ich würde das gabze dann für mich auf Müll Raus heute und Müll Raus morgen ändern.


Danke und Schönen Sonntag noch

int5749
Beiträge: 1161
Registriert: 4. Nov 2019 22:08
Answers: 9

Re: Müllkalender via openHAB

Beitrag von int5749 »

Piko hat geschrieben: 10. Jan 2021 20:03 Deshalb die Frage!
Wie bekomme ich das ganze einen Tag nach Vorne verschoben ?
Ich habe im Moment keine Idee, wie dies funktionieren könnte, aber alles was "Abholung heute" ist, war doch einen Tag vorher "Abholung morgen"
Daher lasse ich mich immer bei "Abholung morgen" am Abend um 19:00 Uhr informieren, um den Müll raus zu stellen
Und am "Abholung heute" nochmals um 6:00 Uhr, bei uns kommt die Abfuhr erst nach 7:00 Uhr.

Evtl. hilft dies??
openHAB 4.1.0 Release mit openHABian in einem Debian Bookworm (LXC) unter Proxmox 8.1.3

Antworten