Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. [Vorlage] Betriebsstundenzähler & Verbrauchsrechner

NEWS

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    16
    1
    299

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    17
    1
    4.7k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.3k

[Vorlage] Betriebsstundenzähler & Verbrauchsrechner

Scheduled Pinned Locked Moved Skripten / Logik
javascript
333 Posts 51 Posters 96.5k Views 26 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    schittl
    wrote on last edited by
    #241

    Danke für das tolle Skript. Ist es damit auch ohne Probleme möglich die Betriebsstunden von Hue Lampen zu protokollieren? Folgende Einstellungen habe ich probiert:

    Gruppen[ 4]  = ['hue.0.Philips_hue.Eingang_White_I.on'      ,'Licht'           ,false  ,true   ,true   ,true   ,true   ,true     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,false ,false]; // Eingang-Lampe
    logname[ 4]  = ['Eingang-Lampe'           ,''             ,''             ,''         ,''         ,''         ,''         ,''     ,''     ,'']; // Eingang-Lampe
    special[ 4]  = [''     ,''     ,''        ,''         ,''     ,''                 ,''                 ,''                         ,''             ,''             ,''                 ,''             ,''                 , ''     ]; // Eingang-Lampe
    
    

    Zusatzfrage:

    Wie kann ich von Endgeräten an einer Homematic-Steckdose (Datenpunkt POWER) die Betriebsstunden und Counter speichern? Habe folgenden Bereich POWER-Abfrage zusätzlich inkludiert. Damit bekomme ich schon mal die Betriebsstunden. Nur leider noch nicht wie oft wurde das Endgerät eingeschaltet.

    ! // TIME Datenpunkt hier POWER Geraet if (objGruppe.match('POWER')) { // ist es ein POWER Geraet ? if (Gruppen[nummer][8] === '') { return; } // Gibt es einen Status in der Gruppentabelle ? wenn nein ciao - es wurd nur spalte 8 abgefragt if (Gruppen[nummer][18] === true) { return; } // Objekt ist mit refresh gekennzeichnet - keine updates LastMSec = Number(getState(objMSec).val); // lese letzten Wert var statusvalue = parseInt(Gruppen[nummer][8],10); // in der Gruppentabelle Spalte 8 wird eine Zahl erwartet für POWER Geraete - in eine integer Zahl umwandeln if (GeraeteStatus >= statusvalue) { // Geraet wurde eingeschaltet - Einschaltzeit setzen if (LastMSec === 0 ) { // Wenn Geraet keine Einschaltzeit hat und der Verbraucher nicht kleiner eingeschaltet wurde als in der Gruppen tabelle unter status, dann ignoriere setState(objMSec,currSec); // merken millisekunden zum Zeitpunkt "Einschalten" FormTimeSingle = TimeCalc(currSec,nummer); // Zeit in lesbarem Format ddd:hh:mm:ss GeraeteStatus = TauschePunktKomma(GeraeteStatus); // Umwandlung von javascript float in 2 decimals mit Komma für die Logausgabe lesbar in Excel //"Datum;Uhrzeit; Type; Activity; nummer HM-ID; Objekt-Text; CurrValue; SystemObj Alt; SysemObj Neu; SystemMSEC Alt ; SystemMSEC NEU; CounterObj ALT; CounterOBJ NEU writelog(nummer,"A","TIME-POWER" + ";" + "SetCurrTime" + ";" +nummer + ";" + Gruppen[nummer][0] + ";" + GeraeteName + ";" + GeraeteStatus + ";" +";" + ";" + LastMSec + ";" + currSec); } } else { // Geraet wurde ausgeschaltet objTime = objTime + '.TIME.' + statusname; LastKumSec = Number(getState(objKum).val); // lese kumulierten Wert if (LastMSec > 0 ) { // Geraet hatte eine Einschaltzeit gespeichert - jetzt rechnen und zurücksetzen lastvalue = Number(getState(objTime).val); // lese kumulierten Wert - letzter umgerechnete Wert if( timeformat || typeof(lastvalue) == "string") { // falls ein timeformat gewaehlt wurde (ddd.hh.mm.ss), dann muss umgewandelt werden in millisek lastvalue = LastKumSec; // der letzte Wert entspricht jetzt dem kumulierten Systemwert lastvalue = lastvalue + addition1; lastvalue = lastvalue * faktor; // Faktor anwenden lastvalue = lastvalue + addition2; } diffvalraw = currSec - LastMSec; // Berechnen der Zeitdifferenz newvalue = diffvalraw; // lese aktuellen Wert aud dem veränderten Datenpunkt if(special[nummer][5] !== '') { // Individualfunktionen newvalue = individual(special[nummer][5].toUpperCase(),nummer,diffvalraw); // hier kommt ein umgerechneter Wertaus der Individualfunktion zurück z.B. KG . individualFunc = true; } // endif Individualfunktion newvalue = newvalue + addition1; newvalue = newvalue * faktor; // Faktor anwenden newvalue = newvalue + addition2; newvalue = lastvalue + newvalue; // neuer umgerechneter Wert für den Counter newkumtime = LastKumSec + diffvalraw; // neuer nicht umgerechneter Wert für den Systembereich setState(objKum,newkumtime); // Schreibe wert in variable setState(objMSec,0); newvalue = runden(newvalue,rundung); // Neuer umgerechneter Gesamtwert mit Rundung für den Counter FormTimeKum = TimeCalc(newvalue,nummer); // Berechne Betriebsstunden Zeitformat von millisekunden in dd:hh:mm:ss = FormTime setState(objTime,FormTimeKum); // Schreibe neuen Wert in variable ValKum2(nummer, day,week,month,year,objKum,objTime,diffvalraw,addition1,addition2,faktor,rundung,individualFunc,true,timeformat); // update der Werte in täglichen, wöchentlichen, monatlichen, jährlichen einheiten wenn so gewünscht Average(nummer,day,week,month,year,statusname,newvalue,diffvalraw,addition1,addition2,faktor,rundung,false); // update der Werte in täglichen, wöchentlichen, monatlichen, jährlichen einheiten wenn so gewünscht) MINMAX(nummer,day,week,month,year,statusname,newvalue,diffvalraw,addition1,addition2,faktor,rundung,false) // update der MINMAX Werte in täglichen, wöchentlichen, monatlichen, jährlichen einheiten wenn so gewünscht setState(objMSec,0); // setzen Millisekunden auf Null um Fehlschaltungen zu vermeiden if(switchupdate) { LastKumSwitch = getState(objSwitch).val; // lese kumulierten Zaehlungen switchdiff = LastKumSwitch + 1; setState(objSwitch,switchdiff); // setzen plus ein Schaltvorgang SwitchKum(day,week,month,year,objSwitch); // update der switches in täglichen, wöchentlichen, monatlichen, jährlichen einheiten wenn so gewünscht } // endif switchupdate lastvalue = TimeCalc(lastvalue,nummer); //Aufbereitung für Log if(typeof(lastvalue) == "number") { lastvalue = TauschePunktKomma(lastvalue); // Umwandlung von javascript float in 2 decimals mit Komma für die Logausgabe lesbar in Excel } if(typeof(FormTimeKum) == "number") { FormTimeKum = TauschePunktKomma(FormTimeKum); // Umwandlung von javascript float in 2 decimals mit Komma für die Logausgabe lesbar in Excel } //"Datum;Uhrzeit; Type; Activity; nummer HM-ID; Objekt-Text; CurrValue; SystemObj Alt; SysemObj Neu; SystemMSEC Alt ;SystemMSEC NEU; CounterObj ALT; CounterOBJ NEU writelog(nummer,"A","TIME-POWER" + ";" + "SetNewTime" + ";" +nummer + ";" + Gruppen[nummer][0] + ";" + GeraeteName + ";" + GeraeteStatus +";" + LastKumSec + ";" + newkumtime + ";" + LastMSec + ";" + "0" + ";" + lastvalue +";" + FormTimeKum); return; } // endif statusname } // Geraet war vorher eingeschaltet return; // ciao - nix mehr zu tun } // endif es ist ein power Geraet !

    Gruppen[ 1]  = ['hm-rpc.0.xxxx.2.POWER'               ,'Strom'           ,false  ,true   ,true   ,true   ,true   ,false    ,'10'   ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,false ,false]; // Küche-Geschirrspüler
    logname[ 1]  = ['Küche-Geschirrspüler'    ,''             ,''             ,''         ,''         ,''         ,''         ,''     ,''     ,'']; // Küche-Geschirrspüler
    special[ 1]  = [''     ,''     ,''        ,''         ,''     ,''                 ,''                 ,''                         ,''             ,''             ,''                 ,''             ,''                 ,''      ]; // Küche-Geschirrspüler
    
    

    Hintergrund:

    Die Steckdose ist immer an und wird niemals ausgeschaltet.

    vg

    Falk

    HW: Lenovo M920q (Proxmox, ioBroker, RaspMatic & Z2M), QNAP (Docker, Influx), Arduino Mega 2560 R3 (I2C DS18B20 + LED)

    SW: CT IoBroker, VM RaspMatic(v3.79.6.20241122)

    1 Reply Last reply
    0
    • T Offline
      T Offline
      thomasSC
      wrote on last edited by
      #242

      Jetzt habe ich eine ganz Banale frage. ich glaub ich seh den Code vor lauter Buchstaben nicht.

      Ich nutze das Skript um meine UVC Lampe meines Gartenteiches zu überwachen. Nun bekomme ich aber als Format 000:00:00:00 angezeigt.

      Dies kann ich leider nicht für eine schöne Visa benutzen. Ich würde gerne den "odometer" von HQWidgets nutzen. Mich interessieren auch wirklich nur stunden. keine tage, keine Sekunden etc.

      Kann mir jemand beim Skript für die Umwandlung helfen? Vielen Dank schonmal.

      Gruß Thomas

      push hat denn niemand eine Idee?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mac
        wrote on last edited by
        #243

        Hallo,

        ich möchte die Betriebszeiten von Pumpen protokollieren. Es wird auch die Summe protokolliert, aber das Zurücksetzen bei Tages- Wochenweseln funktioniert irgendwie nicht, was mache ich falsch:

        4489_bildschirmfoto_2018-04-13_um_14.58.18.png

        filename="Bildschirmfoto 2018-04-13 um 14.57.54.png" index="0">~~

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mac
          wrote on last edited by
          #244

          4489_bildschirmfoto_2018-04-13_um_14.57.54.png

          1 Reply Last reply
          0
          • T Offline
            T Offline
            thomasSC
            wrote on last edited by
            #245

            Hat keiner eine Idee für die Umwandlung in reine Stunden?

            1 Reply Last reply
            0
            • L Offline
              L Offline
              looxer01
              wrote on last edited by
              #246

              @thomasSC:

              Hat keiner eine Idee für die Umwandlung in reine Stunden? `
              Hi,

              Wenn du die Methode "TIME" verwendest, dann wird normalerweise ein Format erzeugt, dass so aussieht "DDD:HH:MM:SS"

              Wenn du eine Umrechnung vornimmst, dann wird das Format nicht mehr so dargestellt. Das Programm rechnet immer mit Millisekunden.

              Wenn du also in Tabelle "Special" im Divisor 3600000 eingibst, dann wird die Zahl in Stunden dartgestellt. Allerdings dezimal. Dass heisst das 3:30 = 3.5

              vG Looxer

              1 Reply Last reply
              0
              • B Offline
                B Offline
                Beowolf
                wrote on last edited by
                #247

                Hallo zusammen,

                habe da ein Problem. Ich habe das Skript für meine Heizung eingebaut. Von meiner Heizung kommt die Meldung Brenner feuert als "true" und "false" Meldung.

                Der Datenpunkt sieht so aus "javascript.0.STUNDEN.BRENNER.STATE". Unter Objekte kann ich auch schön sehen wie sich der Zustand ändert. Unter VIS habe ich auch eine entsprechende Grafik die sich dann auch ändert. Es funktioniert also.

                Wenn ich diesen Datenpunkt jetzt in den BSZ einsetze passiert nicht. Der Zähler zählt nicht.

                Ersetze ich den Datenpunkt durch einen einfachenHM-Schaltaktor, also das ich per Funkschalter schalten kann, wird schön die "gezählte" Zeit im BSZ angezeigt.

                Wo mache ich den Fehler? Was wird benötigt?

                Grüße

                Manfred

                Die Natur braucht nicht unseren Schutz, sie braucht unsere Abwesenheit.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  Morpheus
                  wrote on last edited by
                  #248

                  @Beowolf:

                  Hallo zusammen,

                  habe da ein Problem. Ich habe das Skript für meine Heizung eingebaut. Von meiner Heizung kommt die Meldung Brenner feuert als "true" und "false" Meldung.

                  Der Datenpunkt sieht so aus "javascript.0.STUNDEN.BRENNER.STATE". Unter Objekte kann ich auch schön sehen wie sich der Zustand ändert. Unter VIS habe ich auch eine entsprechende Grafik die sich dann auch ändert. Es funktioniert also.

                  Wenn ich diesen Datenpunkt jetzt in den BSZ einsetze passiert nicht. Der Zähler zählt nicht.

                  Ersetze ich den Datenpunkt durch einen einfachenHM-Schaltaktor, also das ich per Funkschalter schalten kann, wird schön die "gezählte" Zeit im BSZ angezeigt.

                  Wo mache ich den Fehler? Was wird benötigt?

                  Grüße

                  Manfred `

                  Hab genau das gleiche Problem. Gibt es schon eine Lösung?

                  cya

                  Thomas

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    Beowolf
                    wrote on last edited by
                    #249

                    Ja, das wäre wirklich sehr schön, wenn es dafür eine Lösung geben würde.

                    Die Natur braucht nicht unseren Schutz, sie braucht unsere Abwesenheit.

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      looxer01
                      wrote on last edited by
                      #250

                      @Beowolf:

                      Wenn ich diesen Datenpunkt jetzt in den BSZ einsetze passiert nicht. Der Zähler zählt nicht.

                      Ersetze ich den Datenpunkt durch einen einfachenHM-Schaltaktor, also das ich per Funkschalter schalten kann, wird schön die "gezählte" Zeit im BSZ angezeigt.

                      Wo mache ich den Fehler? Was wird benötigt? `

                      also, ich bin überzeugt, dass es ein Konfigurationsproblem ist.

                      Bitte Leerzeichen vermeiden. und die genaue Schreibweise der Datenpunkte beachten. Gross und Kleinschreibung muessen dabei exakt identisch siein.

                      Schaut Ihr mal und meldet zurück ?

                      vG Looxer

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        schittl
                        wrote on last edited by
                        #251

                        @looxer01:

                        also, ich bin überzeugt, dass es ein Konfigurationsproblem ist.

                        Bitte Leerzeichen vermeiden. und die genaue Schreibweise der Datenpunkte beachten. Gross und Kleinschreibung muessen dabei exakt identisch siein.

                        Schaut Ihr mal und meldet zurück ?

                        vG Looxer `
                        Groß und Kleinschreibung kann ich schon mal ausschließen…

                        Gruppen[13]  = ['javascript.0.Weihnachtsbeleuchtung'                    ,'Licht'            ,false  ,true   ,true   ,true   ,true   ,true     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,false ,false]; // Weihnachtsbeleuchtung
                        .....
                        Gruppen[19]  = ['g-homa.0.XXXXXX.power'                                 ,'Strom'            ,false  ,true   ,true   ,true   ,true   ,false    ,'10'   ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,false ,false]; // XXXXXX
                        Gruppen[20]  = ['javascript.0.Systeminfos.STATE_WINDOWS_OPEN_KITCHEN'   ,'Luft'             ,false  ,true   ,true   ,true   ,true   ,true     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,''     ,false ,false]; // Kueche-Fenster
                        
                        

                        Diese beiden bringen keine Werte, andere aber schon und zuverlässig. Auffallend ist es das es nur Objekte betrifft, welche im Adapter "javascript" gespeichert sind. g-Homa, hue, hm-rega und hm-rpc funktionieren.

                        vg

                        Falk

                        HW: Lenovo M920q (Proxmox, ioBroker, RaspMatic & Z2M), QNAP (Docker, Influx), Arduino Mega 2560 R3 (I2C DS18B20 + LED)

                        SW: CT IoBroker, VM RaspMatic(v3.79.6.20241122)

                        1 Reply Last reply
                        0
                        • L Offline
                          L Offline
                          looxer01
                          wrote on last edited by
                          #252

                          @schittl:

                          oß und Kleinschreibung kann ich schon mal ausschließen… `
                          ok, nächster punkt wäre mal zu schauen was in den RAW daten der Objekte steht.

                          Was ist das für ein Datentyp etc.

                          Kannst du die RAW Werte mal posten ?

                          vG Looxer

                          1 Reply Last reply
                          0
                          • B Offline
                            B Offline
                            Beowolf
                            wrote on last edited by
                            #253

                            Ist geschehen. :oops:

                            Die Natur braucht nicht unseren Schutz, sie braucht unsere Abwesenheit.

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              schittl
                              wrote on last edited by
                              #254

                              @Beowolf:

                              Der Stromzähler wird schön erfasst, der Wasserzähler erscheint nicht. Warum? Wo habe ich dort einen Fehler?

                              Grüße

                              Manfred `

                              Vermutlich falsches Thema. Poste das bitte hier:

                              viewtopic.php?f=21&t=12272

                              HW: Lenovo M920q (Proxmox, ioBroker, RaspMatic & Z2M), QNAP (Docker, Influx), Arduino Mega 2560 R3 (I2C DS18B20 + LED)

                              SW: CT IoBroker, VM RaspMatic(v3.79.6.20241122)

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                schittl
                                wrote on last edited by
                                #255

                                @looxer01:

                                ok, nächster punkt wäre mal zu schauen was in den RAW daten der Objekte steht.

                                Was ist das für ein Datentyp etc.

                                Kannst du die RAW Werte mal posten ?

                                vG Looxer `
                                Natürlich hier bitte:

                                ! { "from": "system.adapter.javascript.0", "ts": 1514491542223, "common": { "name": "Weihnachtsbeleuchtung", "desc": "Soll Weihnachtsbeleuchtung eingeschaltet werden?", "type": "boolean", "role": "javascript", "read": true, "write": true }, "native": { "name": "Weihnachtsbeleuchtung", "desc": "Soll Weihnachtsbeleuchtung eingeschaltet werden?", "type": "boolean", "role": "javascript", "read": true, "write": true }, "acl": { "object": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator", "state": 1636 }, "_id": "javascript.0.Weihnachtsbeleuchtung", "type": "state" } !

                                bzw.

                                ! { "common": { "name": "Status der geöffneten Fenster/Türen in der Küche", "read": true, "write": true, "type": "boolean", "desc": "Status der geoeffneten Fenster/Türen in der Kueche", "def": false, "role": "state" }, "native": { "name": "Status der geoeffneten Fenster/Türen in der Kueche", "read": true, "write": true, "type": "boolean", "desc": "Status der geoeffneten Fenster/Türen in der Kueche", "def": false, "role": "state" }, "type": "state", "from": "system.adapter.javascript.0", "ts": 1528288136458, "_id": "javascript.0.Systeminfos.STATE_WINDOWS_OPEN_KITCHEN", "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } } !
                                vg

                                Falk

                                HW: Lenovo M920q (Proxmox, ioBroker, RaspMatic & Z2M), QNAP (Docker, Influx), Arduino Mega 2560 R3 (I2C DS18B20 + LED)

                                SW: CT IoBroker, VM RaspMatic(v3.79.6.20241122)

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  schittl
                                  wrote on last edited by
                                  #256

                                  @looxer01: Gibt es neue Erkenntnisse? Benötigst Du weitere Unterstützung?

                                  HW: Lenovo M920q (Proxmox, ioBroker, RaspMatic & Z2M), QNAP (Docker, Influx), Arduino Mega 2560 R3 (I2C DS18B20 + LED)

                                  SW: CT IoBroker, VM RaspMatic(v3.79.6.20241122)

                                  1 Reply Last reply
                                  0
                                  • L Offline
                                    L Offline
                                    looxer01
                                    wrote on last edited by
                                    #257

                                    @schittl:

                                    @looxer01: Gibt es neue Erkenntnisse? Benötigst Du weitere Unterstützung? `
                                    Hi,

                                    Ich komme erst am WE dazu, weil ich zur analyse etwas mehr Zeit brauche.

                                    ggf brauche ich deine Hilfe. Am Besten ist aber immer mal selber ins System zu schauen. Jedenfalls für den BSZ.

                                    Ich melde mich.

                                    vG Looxer

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      schittl
                                      wrote on last edited by
                                      #258

                                      @looxer01:

                                      Hi,

                                      Ich komme erst am WE dazu, weil ich zur analyse etwas mehr Zeit brauche.

                                      ggf brauche ich deine Hilfe. Am Besten ist aber immer mal selber ins System zu schauen. Jedenfalls für den BSZ. `

                                      Danke kein Stress, wollte nur mal wieder reinhören, nicht das es unter geht. Ich hatte schon versucht den Fehler selber zu lokalisieren, was mir aber nicht gelang. Daher meine Rückfrage.

                                      vg

                                      Falk

                                      HW: Lenovo M920q (Proxmox, ioBroker, RaspMatic & Z2M), QNAP (Docker, Influx), Arduino Mega 2560 R3 (I2C DS18B20 + LED)

                                      SW: CT IoBroker, VM RaspMatic(v3.79.6.20241122)

                                      1 Reply Last reply
                                      0
                                      • L Offline
                                        L Offline
                                        looxer01
                                        wrote on last edited by
                                        #259

                                        @schittl:

                                        Danke kein Stress, wollte nur mal wieder reinhören, `
                                        Danke für die Geduld.

                                        Ich konnte das Problem nachvollziehen.

                                        Es gibt da wohl im IoBroker eine Verhaltensänderung bei subscriptions.

                                        Das heisst in diesem Fall, dass bei allen Datenpunkten ohne Verbuchungsbestätigung die subscription nicht ausgeführt wird.

                                        Das ist z.B der Fall bei Javascript objekten.

                                        Ich kann euch einen quick fix anbieten direkt im coding bis ich das gelöst habe.

                                        Dazu müsstet ihr bei den Javascript Objekten folgende Code Aenderungen durchführen (nur bei bei den javascript objekten bitte

                                        und zwar alle Zeilen betreffend javascript :

                                        on({id:  OnIdTAB[0 ], valNe: 1000 }, function(obj)    { if(special[0][7] === true) {  if (obj.state.ack)  {   if(special[0][10]  === "0 5 31 2 *") { GeraetUpdate( 0); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 0 ); } } });    // ende on id
                                        on({id:  OnIdTAB[1 ], valNe: 1000 }, function(obj)    { if(special[1][7] === true) {  if (obj.state.ack)  {   if(special[1][10]  === "0 5 31 2 *") { GeraetUpdate( 1); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 1 ); } } });    // ende on id
                                        on({id:  OnIdTAB[2 ], valNe: 1000 }, function(obj)    { if(special[2][7] === true) {  if (obj.state.ack)  {   if(special[2][10]  === "0 5 31 2 *") { GeraetUpdate( 2); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 2 ); } } });    // ende on id
                                        on({id:  OnIdTAB[3 ], valNe: 1000 }, function(obj)    { if(special[3][7] === true) {  if (obj.state.ack)  {   if(special[3][10]  === "0 5 31 2 *") { GeraetUpdate( 3); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 3 ); } } });    // ende on id
                                        on({id:  OnIdTAB[4 ], valNe: 1000 }, function(obj)    { if(special[4][7] === true) {  if (obj.state.ack)  {   if(special[4][10]  === "0 5 31 2 *") { GeraetUpdate( 4); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 4 ); } } });    // ende on id
                                        on({id:  OnIdTAB[5 ], valNe: 1000 }, function(obj)    { if(special[5][7] === true) {  if (obj.state.ack)  {   if(special[5][10]  === "0 5 31 2 *") { GeraetUpdate( 5); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 5 ); } } });    // ende on id
                                        on({id:  OnIdTAB[6 ], valNe: 1000 }, function(obj)    { if(special[6][7] === true) {  if (obj.state.ack)  {   if(special[6][10]  === "0 5 31 2 *") { GeraetUpdate( 6); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 6 ); } } });    // ende on id
                                        on({id:  OnIdTAB[7 ], valNe: 1000 }, function(obj)    { if(special[7][7] === true) {  if (obj.state.ack)  {   if(special[7][10]  === "0 5 31 2 *") { GeraetUpdate( 7); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 7 ); } } });    // ende on id
                                        on({id:  OnIdTAB[8 ], valNe: 1000 }, function(obj)    { if(special[8][7] === true) {  if (obj.state.ack)  {   if(special[8][10]  === "0 5 31 2 *") { GeraetUpdate( 8); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 8 ); } } });    // ende on id
                                        on({id:  OnIdTAB[9 ], valNe: 1000 }, function(obj)    { if(special[9][7] === true) {  if (obj.state.ack)  {   if(special[9][10]  === "0 5 31 2 *") { GeraetUpdate( 9); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 9 ); } } });    // ende on id
                                        on({id:  OnIdTAB[10], valNe: 1000 }, function(obj)    { if(special[10][7] === true) {  if (obj.state.ack)  {  if(special[10][10] === "0 5 31 2 *") { GeraetUpdate(10); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(10); } } });    // ende on id
                                        on({id:  OnIdTAB[11], valNe: 1000 }, function(obj)    { if(special[11][7] === true) {  if (obj.state.ack)  {  if(special[11][10] === "0 5 31 2 *") { GeraetUpdate(11); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(11); } } });    // ende on id
                                        on({id:  OnIdTAB[12], valNe: 1000 }, function(obj)    { if(special[12][7] === true) {  if (obj.state.ack)  {  if(special[12][10] === "0 5 31 2 *") { GeraetUpdate(12); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(12); } } });    // ende on id
                                        on({id:  OnIdTAB[13], valNe: 1000 }, function(obj)    { if(special[13][7] === true) {  if (obj.state.ack)  {  if(special[13][10] === "0 5 31 2 *") { GeraetUpdate(13); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(13); } } });    // ende on id
                                        on({id:  OnIdTAB[14], valNe: 1000 }, function(obj)    { if(special[14][7] === true) {  if (obj.state.ack)  {  if(special[14][10] === "0 5 31 2 *") { GeraetUpdate(14); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(14); } } });    // ende on id
                                        on({id:  OnIdTAB[15], valNe: 1000 }, function(obj)    { if(special[15][7] === true) {  if (obj.state.ack)  {  if(special[15][10] === "0 5 31 2 *") { GeraetUpdate(15); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(15); } } });    // ende on id
                                        on({id:  OnIdTAB[16], valNe: 1000 }, function(obj)    { if(special[16][7] === true) {  if (obj.state.ack)  {  if(special[16][10] === "0 5 31 2 *") { GeraetUpdate(16); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(16); } } });    // ende on id
                                        on({id:  OnIdTAB[17], valNe: 1000 }, function(obj)    { if(special[17][7] === true) {  if (obj.state.ack)  {  if(special[17][10] === "0 5 31 2 *") { GeraetUpdate(17); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(17); } } });    // ende on id
                                        on({id:  OnIdTAB[18], valNe: 1000 }, function(obj)    { if(special[18][7] === true) {  if (obj.state.ack)  {  if(special[18][10] === "0 5 31 2 *") { GeraetUpdate(18); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(18); } } });    // ende on id
                                        on({id:  OnIdTAB[19], valNe: 1000 }, function(obj)    { if(special[19][7] === true) {  if (obj.state.ack)  {  if(special[19][10] === "0 5 31 2 *") { GeraetUpdate(19); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(19); } } });    // ende on id
                                        on({id:  OnIdTAB[20], valNe: 1000 }, function(obj)    { if(special[20][7] === true) {  if (obj.state.ack)  {  if(special[20][10] === "0 5 31 2 *") { GeraetUpdate(20); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(20); } } });    // ende on id
                                        on({id:  OnIdTAB[21], valNe: 1000 }, function(obj)    { if(special[21][7] === true) {  if (obj.state.ack)  {  if(special[21][10] === "0 5 31 2 *") { GeraetUpdate(21); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(21); } } });    // ende on id
                                        on({id:  OnIdTAB[22], valNe: 1000 }, function(obj)    { if(special[22][7] === true) {  if (obj.state.ack)  {  if(special[22][10] === "0 5 31 2 *") { GeraetUpdate(22); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(22); } } });    // ende on id
                                        on({id:  OnIdTAB[23], valNe: 1000 }, function(obj)    { if(special[23][7] === true) {  if (obj.state.ack)  {  if(special[23][10] === "0 5 31 2 *") { GeraetUpdate(23); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(23); } } });    // ende on id
                                        on({id:  OnIdTAB[24], valNe: 1000 }, function(obj)    { if(special[24][7] === true) {  if (obj.state.ack)  {  if(special[24][10] === "0 5 31 2 *") { GeraetUpdate(24); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(24); } } });    // ende on id on({id:  OnIdTAB[25], valNe: 1000 }, function(obj)    { if(special[25][7] === true) {  if (obj.state.ack)  {  if(special[25][10] === "0 5 31 2 *") { GeraetUpdate(25); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(25); } } });    // ende on id
                                        
                                        

                                        austauschen mit beispielhaft für eine Zeile:

                                        on({id:  OnIdTAB[25], valNe: 1000 }, function(obj)    {    GeraetUpdate(25);  });    // ende on id
                                        
                                        

                                        vG Looxer

                                        1 Reply Last reply
                                        0
                                        • L Offline
                                          L Offline
                                          looxer01
                                          wrote on last edited by
                                          #260

                                          Hi,

                                          so, habe noch ein wenig mehr gebastelt. Damit fällt der Fix einfacher und zugleich variabler aus.

                                          Wie zuvor bitte diese Codingzeilen austauschen: In dieser Variante aber alle Zeilen austauschen.

                                          on({id:  OnIdTAB[0 ], valNe: 1000 }, function(obj)    { if(special[0][7] === true) {  if (obj.state.ack)  {   if(special[0][10]  === "0 5 31 2 *") { GeraetUpdate( 0); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 0 ); } } });    // ende on id
                                          on({id:  OnIdTAB[1 ], valNe: 1000 }, function(obj)    { if(special[1][7] === true) {  if (obj.state.ack)  {   if(special[1][10]  === "0 5 31 2 *") { GeraetUpdate( 1); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 1 ); } } });    // ende on id
                                          on({id:  OnIdTAB[2 ], valNe: 1000 }, function(obj)    { if(special[2][7] === true) {  if (obj.state.ack)  {   if(special[2][10]  === "0 5 31 2 *") { GeraetUpdate( 2); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 2 ); } } });    // ende on id
                                          on({id:  OnIdTAB[3 ], valNe: 1000 }, function(obj)    { if(special[3][7] === true) {  if (obj.state.ack)  {   if(special[3][10]  === "0 5 31 2 *") { GeraetUpdate( 3); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 3 ); } } });    // ende on id
                                          on({id:  OnIdTAB[4 ], valNe: 1000 }, function(obj)    { if(special[4][7] === true) {  if (obj.state.ack)  {   if(special[4][10]  === "0 5 31 2 *") { GeraetUpdate( 4); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 4 ); } } });    // ende on id
                                          on({id:  OnIdTAB[5 ], valNe: 1000 }, function(obj)    { if(special[5][7] === true) {  if (obj.state.ack)  {   if(special[5][10]  === "0 5 31 2 *") { GeraetUpdate( 5); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 5 ); } } });    // ende on id
                                          on({id:  OnIdTAB[6 ], valNe: 1000 }, function(obj)    { if(special[6][7] === true) {  if (obj.state.ack)  {   if(special[6][10]  === "0 5 31 2 *") { GeraetUpdate( 6); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 6 ); } } });    // ende on id
                                          on({id:  OnIdTAB[7 ], valNe: 1000 }, function(obj)    { if(special[7][7] === true) {  if (obj.state.ack)  {   if(special[7][10]  === "0 5 31 2 *") { GeraetUpdate( 7); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 7 ); } } });    // ende on id
                                          on({id:  OnIdTAB[8 ], valNe: 1000 }, function(obj)    { if(special[8][7] === true) {  if (obj.state.ack)  {   if(special[8][10]  === "0 5 31 2 *") { GeraetUpdate( 8); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 8 ); } } });    // ende on id
                                          on({id:  OnIdTAB[9 ], valNe: 1000 }, function(obj)    { if(special[9][7] === true) {  if (obj.state.ack)  {   if(special[9][10]  === "0 5 31 2 *") { GeraetUpdate( 9); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate( 9 ); } } });    // ende on id
                                          on({id:  OnIdTAB[10], valNe: 1000 }, function(obj)    { if(special[10][7] === true) {  if (obj.state.ack)  {  if(special[10][10] === "0 5 31 2 *") { GeraetUpdate(10); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(10); } } });    // ende on id
                                          on({id:  OnIdTAB[11], valNe: 1000 }, function(obj)    { if(special[11][7] === true) {  if (obj.state.ack)  {  if(special[11][10] === "0 5 31 2 *") { GeraetUpdate(11); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(11); } } });    // ende on id
                                          on({id:  OnIdTAB[12], valNe: 1000 }, function(obj)    { if(special[12][7] === true) {  if (obj.state.ack)  {  if(special[12][10] === "0 5 31 2 *") { GeraetUpdate(12); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(12); } } });    // ende on id
                                          on({id:  OnIdTAB[13], valNe: 1000 }, function(obj)    { if(special[13][7] === true) {  if (obj.state.ack)  {  if(special[13][10] === "0 5 31 2 *") { GeraetUpdate(13); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(13); } } });    // ende on id
                                          on({id:  OnIdTAB[14], valNe: 1000 }, function(obj)    { if(special[14][7] === true) {  if (obj.state.ack)  {  if(special[14][10] === "0 5 31 2 *") { GeraetUpdate(14); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(14); } } });    // ende on id
                                          on({id:  OnIdTAB[15], valNe: 1000 }, function(obj)    { if(special[15][7] === true) {  if (obj.state.ack)  {  if(special[15][10] === "0 5 31 2 *") { GeraetUpdate(15); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(15); } } });    // ende on id
                                          on({id:  OnIdTAB[16], valNe: 1000 }, function(obj)    { if(special[16][7] === true) {  if (obj.state.ack)  {  if(special[16][10] === "0 5 31 2 *") { GeraetUpdate(16); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(16); } } });    // ende on id
                                          on({id:  OnIdTAB[17], valNe: 1000 }, function(obj)    { if(special[17][7] === true) {  if (obj.state.ack)  {  if(special[17][10] === "0 5 31 2 *") { GeraetUpdate(17); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(17); } } });    // ende on id
                                          on({id:  OnIdTAB[18], valNe: 1000 }, function(obj)    { if(special[18][7] === true) {  if (obj.state.ack)  {  if(special[18][10] === "0 5 31 2 *") { GeraetUpdate(18); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(18); } } });    // ende on id
                                          on({id:  OnIdTAB[19], valNe: 1000 }, function(obj)    { if(special[19][7] === true) {  if (obj.state.ack)  {  if(special[19][10] === "0 5 31 2 *") { GeraetUpdate(19); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(19); } } });    // ende on id
                                          on({id:  OnIdTAB[20], valNe: 1000 }, function(obj)    { if(special[20][7] === true) {  if (obj.state.ack)  {  if(special[20][10] === "0 5 31 2 *") { GeraetUpdate(20); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(20); } } });    // ende on id
                                          on({id:  OnIdTAB[21], valNe: 1000 }, function(obj)    { if(special[21][7] === true) {  if (obj.state.ack)  {  if(special[21][10] === "0 5 31 2 *") { GeraetUpdate(21); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(21); } } });    // ende on id
                                          on({id:  OnIdTAB[22], valNe: 1000 }, function(obj)    { if(special[22][7] === true) {  if (obj.state.ack)  {  if(special[22][10] === "0 5 31 2 *") { GeraetUpdate(22); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(22); } } });    // ende on id
                                          on({id:  OnIdTAB[23], valNe: 1000 }, function(obj)    { if(special[23][7] === true) {  if (obj.state.ack)  {  if(special[23][10] === "0 5 31 2 *") { GeraetUpdate(23); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(23); } } });    // ende on id
                                          on({id:  OnIdTAB[24], valNe: 1000 }, function(obj)    { if(special[24][7] === true) {  if (obj.state.ack)  {  if(special[24][10] === "0 5 31 2 *") { GeraetUpdate(24); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(24); } } });    // ende on id on({id:  OnIdTAB[25], valNe: 1000 }, function(obj)    { if(special[25][7] === true) {  if (obj.state.ack)  {  if(special[25][10] === "0 5 31 2 *") { GeraetUpdate(25); }  } } else {  if(obj.state.ack === false)  { GeraetUpdate(25); } } });    // ende on id
                                          
                                          

                                          mit diesen Codingzeilen:

                                          for (var x in Gruppen ) {
                                              on({id:  OnIdTAB[x], change: 'any' }, function(obj)    { if (obj.state.val !== obj.oldState.val) {  GeraetUpdate(x); }  });    // ende on id
                                          }
                                          
                                          

                                          Bitte Testen ob noch alles wie gewünscht läuft. Feedback wäre super.

                                          vG looxer

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          602

                                          Online

                                          32.7k

                                          Users

                                          82.5k

                                          Topics

                                          1.3m

                                          Posts
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Home
                                          • Recent
                                          • Tags
                                          • Unread 0
                                          • Categories
                                          • Unreplied
                                          • Popular
                                          • GitHub
                                          • Docu
                                          • Hilfe