NEWS
FHEM hat WEEKDAYS, was hat IOBROKER?
-
@ente34 sagte in FHEM hat WEEKDAYS, was hat IOBROKER?:
Übrigens war ich (auch?) zu dämlich, den adapter von github zu installieren.
Nach einer Installation von Github muss immer noch eine Instanz manuell erstellt werden.
Eine Adapterinstallation ist keine Instanziierung!https://www.iobroker.net/#de/documentation/tutorial/adapter.md
@ch90045 sagte in FHEM hat WEEKDAYS, was hat IOBROKER?:
nichts gegen IOB - aber das macht FHEM schon ganz smart.
und trotzdem wechselst du
-
@Dominik-F said in FHEM hat WEEKDAYS, was hat IOBROKER?:
https://forum.iobroker.net/topic/33228/vorlage-flexibles-timerskript-vis
Schaue ich mir an!
-
@ch90045 sagte in FHEM hat WEEKDAYS, was hat IOBROKER?:
Wie installiere ich den .... klappt nicht so, wie ich mir das denke ....
Sorry, dachte im Thread zum Adapter ist geschrieben wie das geht... und vergaß das dieser Adapter noch nicht in der stable Repo ist...
Du warst schon mal richtig beim installieren aus eigener url... hättest nur den Reiter beliebig wählen und diese url https://github.com/walli545/ioBroker.time-switch eintragen müssen. Anschließend in der Adapteransicht mit dem Plus Zeichen ganz rechts noch eine Instanz hinzufügen müssen.
-
@Homoran Ja, Visualisierung ist nicht gerade die Stärke von FHEM ... ganz schlecht für den WAF
-
Einfache Zeiten funktionieren, die Astrofunktionen schau ich mir noch an.
'use strict'; //const Galeriebeleuchtung = { id: "javascript.0.lampen.05_45", plan:"12345|08:30|on 60|08:00|on 0123456|{sunset(-7200,15:00,22:00)}|on 12345|{sunrise_abs+9000}|off 0123456|21:00|off 06|{sunrise_abs+15000}|off"}; const Galeriebeleuchtung = { id: "fritzdect.0.DECT200_5C:49:79:EF:51:FA.state", plan:"0123456|17:29|off 0123456|17:30|on"}; function SplitSchaltzeit(id,str) { let arr = str.split("|"); const days = arr[0].split('').join(','); if ( arr[1].match(/^\d?\d:\d\d$/) ){ let std_min = arr[1].split(':'); let sched_str = std_min[1].trim() + ' ' + std_min[0].trim() + " * * " + days; console.log("schedule( "+ sched_str); schedule(sched_str, function () { //console.log(id + ' '+arr[2]); setState(id, arr[2] === 'off' ? false : true); }); return; } // schedule((arr_std_min[1]).trim() + ' ' + (arr_std_min[0]).trim() + ' ' + '*' + ' ' + '*' + ' ' + wochen_tage.trim(), function () { // let is_feiertag = getState(id_is_feiertag).val; // if (id == cfg.id_05_45 || !is_feiertag) { // let aus_time = getAstroDate("sunrise", undefined, offset_sunrise); // FktLampeAnAus(id, aus_time, wann_str); // } // }); // for ( let a of arr) { // console.log(id+' '+a); // } } function SplitSchaltzeiten(idAndPlan) { let arr = idAndPlan.plan.split(" "); for ( let a of arr) { SplitSchaltzeit(idAndPlan.id,a); console.log("---------------"); } } SplitSchaltzeiten(Galeriebeleuchtung);
-
@ente34 Danke, vergiss den Schnickschnack mit den Astrofunktionen
-
@ch90045
Weil ich den Syntax so schön finde und das Script vielleicht auch selbst verwende:'use strict'; const Schaltplaene = [ /*Galeriebeleuchtung =*/ { id: "javascript.0.lampen.05_45", plan:"12345|08:30|on 06|08:00|on 0123456|sunset-7200,15:00,22:00|on 12345|sunrise+9000|off 0123456|21:00|off 06|sunrise+15000|off"}, /*Flurbeleuchtung =*/ { id: "javascript.0.lampen.05_45", plan:"12345|08:30|on 06|08:00|on 0123456|sunset-7200,15:00,22:00|on 12345|sunrise+9000|off 0123456|21:00|off 06|sunrise+15000|off"} ]; //const Galeriebeleuchtung = { id: "fritzdect.0.DECT200_5C:49:79:EF:51:FA.state", plan:"0123456|17:29|off 0123456|17:30|on"}; function SplitSchaltzeit(id, str) { let arr = str.split("|"); const days = arr[0].split('').join(','); const state = arr[2] === 'on' ? true : false; if (arr[1].match(/^\d?\d:\d\d$/)) { let std_min = arr[1].split(':'); let sched_str = std_min[1].trim() + ' ' + std_min[0].trim() + " * * " + days; console.log("schedule( " + sched_str + " )"); schedule(sched_str, function () { //console.log(id + ' '+arr[2]); setState(id, state); }); return; } let a = arr[1].match(/^(\w+)([+-]?\d+)?,?(\d?\d:\d\d)?,?(\d?\d:\d\d)?/); if (a != null) { const astro_fkt = a[1]; const astro_shift = a[2] != null ? parseInt(a[2])/60 : 0; const min_time = a[3]; const max_time = a[4]; console.log(a); switch (astro_fkt) { case "sunrise": case "sunriseEnd": case "goldenHourEnd": case "solarNoon": case "goldenHour": case "sunsetStart": case "sunset": case "dusk": case "nauticalDusk": case "night": case "nightEnd": case "nauticalDawn": case "dawn": case "nadir": break; default: console.error("Unknown Astro " + astro_fkt + " ignored!"); return; } console.log(astro_fkt + " shift: " + astro_shift); schedule({astro: astro_fkt, shift: astro_shift}, function () { if ( min_time != null ) { if (!compareTime(min_time,null,">=")) { // time < Min.Time return; } } if ( max_time != null ) { if (!compareTime(max_time,null,"<=")) { // time > Max.Time return; } } setState(id, state); }); } else { console.error("Cannot parse String " + arr[1] + " ignored!"); } } function SplitSchaltzeiten(idAndPlan) { let arr = idAndPlan.plan.split(" "); for ( let a of arr ) { SplitSchaltzeit(idAndPlan.id,a); console.log("---------------"); } } for ( let plan of Schaltplaene ) { SplitSchaltzeiten(plan); };
-
@Homoran
Danke für den Link. Ich habe es mir noch mal angeschaut.
Bisher habe ich (selten) bestehende Adapter über Githup ge-upgraded. Eine komplette Neuinstallation von Github hatte ich noch nicht -
@ente34 Hammer!
-
@ente34 Kannst du mir kurz mal sagen, wo ich mein "Device" in dem JS hinterlegen muss?
-
@ch90045
Gerne, bei id den zu schaltenden state angeben:const Galeriebeleuchtung = { id: "fritzdect.0.DECT200_5C:49:79:EF:51:FA.state", plan:"0123456|17:29|off 0123456|17:30|on"};