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. Summe aus verschiedenen Datenpunkte

NEWS

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

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

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

Summe aus verschiedenen Datenpunkte

Scheduled Pinned Locked Moved Skripten / Logik
javascript
20 Posts 6 Posters 1.8k Views 4 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.
  • tigertim08T tigertim08

    klar ohne .log schwierig. Im .log fängt der Fehler mit compile failed an...

    avascript.0	2020-05-27 18:48:25.617	error	(394) at processTicksAndRejections (internal/process/task_queues.js:97:5)
    javascript.0	2020-05-27 18:48:25.617	error	(394) at runMicrotasks (<anonymous>:null:null)
    javascript.0	2020-05-27 18:48:25.616	error	(394) at /opt/iobroker/node_modules/standard-as-callback/built/index.js:19:49
    javascript.0	2020-05-27 18:48:25.616	error	(394) at tryCatcher (/opt/iobroker/node_modules/standard-as-callback/built/utils.js:11:23)
    javascript.0	2020-05-27 18:48:25.616	error	(394) at /opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInRedis.js:580:17
    javascript.0	2020-05-27 18:48:25.616	error	(394) at /opt/iobroker/node_modules/iobroker.javascript/main.js:1055:17
    javascript.0	2020-05-27 18:48:25.615	error	(394) at /opt/iobroker/node_modules/iobroker.javascript/main.js:1464:17
    javascript.0	2020-05-27 18:48:25.615	error	(394) at prepareScript (/opt/iobroker/node_modules/iobroker.javascript/main.js:1411:37)
    javascript.0	2020-05-27 18:48:25.614	error	(394) at compile (/opt/iobroker/node_modules/iobroker.javascript/main.js:1188:28)
    javascript.0	2020-05-27 18:48:25.614	error	(394) at Object.createScript (vm.js:263:10)
    javascript.0	2020-05-27 18:48:25.614	error	(394) at new Script (vm.js:88:7)
    javascript.0	2020-05-27 18:48:25.614	error	(394) SyntaxError: Invalid or unexpected token
    javascript.0	2020-05-27 18:48:25.613	error	(394) ^^^^
    javascript.0	2020-05-27 18:48:25.613	error	(394) unit: '€’,
    javascript.0	2020-05-27 18:48:25.612	error	at script.js.common.Test.Stromkosten_Gesamt:5
    javascript.0	2020-05-27 18:48:25.612	error	(394) script.js.common.Test.Stromkosten_Gesamt compile failed:
    javascript.0	2020-05-27 18:48:25.603	info	(394) Start javascript script.js.common.Test.Stromkosten_Gesamt
    
    paul53P Offline
    paul53P Offline
    paul53
    wrote on last edited by
    #10

    @tigertim08 sagte:

    unit: '€’

    Falsches Zeichen hinter €.

    Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
    Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

    tigertim08T 1 Reply Last reply
    0
    • paul53P paul53

      @tigertim08 sagte:

      unit: '€’

      Falsches Zeichen hinter €.

      tigertim08T Offline
      tigertim08T Offline
      tigertim08
      wrote on last edited by
      #11

      @paul53 danke, Fehlermeldung compile failed besteht weiter

      
      javascript.0	2020-05-27 19:21:26.987	error	(394) at processTicksAndRejections (internal/process/task_queues.js:97:5)
      javascript.0	2020-05-27 19:21:26.986	error	(394) at runMicrotasks (<anonymous>:null:null)
      javascript.0	2020-05-27 19:21:26.986	error	(394) at /opt/iobroker/node_modules/standard-as-callback/built/index.js:19:49
      javascript.0	2020-05-27 19:21:26.986	error	(394) at tryCatcher (/opt/iobroker/node_modules/standard-as-callback/built/utils.js:11:23)
      javascript.0	2020-05-27 19:21:26.986	error	(394) at /opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInRedis.js:580:17
      javascript.0	2020-05-27 19:21:26.986	error	(394) at /opt/iobroker/node_modules/iobroker.javascript/main.js:1055:17
      javascript.0	2020-05-27 19:21:26.986	error	(394) at /opt/iobroker/node_modules/iobroker.javascript/main.js:1464:17
      javascript.0	2020-05-27 19:21:26.985	error	(394) at prepareScript (/opt/iobroker/node_modules/iobroker.javascript/main.js:1411:37)
      javascript.0	2020-05-27 19:21:26.985	error	(394) at compile (/opt/iobroker/node_modules/iobroker.javascript/main.js:1188:28)
      javascript.0	2020-05-27 19:21:26.985	error	(394) at Object.createScript (vm.js:263:10)
      javascript.0	2020-05-27 19:21:26.985	error	(394) at new Script (vm.js:88:7)
      javascript.0	2020-05-27 19:21:26.985	error	(394) SyntaxError: Unexpected token 'function'
      javascript.0	2020-05-27 19:21:26.984	error	(394) ^^^^^^^^
      javascript.0	2020-05-27 19:21:26.984	error	(394) function(obj) {
      javascript.0	2020-05-27 19:21:26.984	error	at script.js.common.Test.Stromkosten_Gesamt:13
      javascript.0	2020-05-27 19:21:26.984	error	(394) script.js.common.Test.Stromkosten_Gesamt compile failed:
      javascript.0	2020-05-27 19:21:26.982	info	(394) Start javascript script.js.common.Test.Stromkosten_Gesamt
      javascript.0	2020-05-27 19:21:25.461	info	(394) Stop script script.js.common.Test.Stromkosten_Gesamt
      
      
      paul53P 1 Reply Last reply
      0
      • tigertim08T tigertim08

        @paul53 danke, Fehlermeldung compile failed besteht weiter

        
        javascript.0	2020-05-27 19:21:26.987	error	(394) at processTicksAndRejections (internal/process/task_queues.js:97:5)
        javascript.0	2020-05-27 19:21:26.986	error	(394) at runMicrotasks (<anonymous>:null:null)
        javascript.0	2020-05-27 19:21:26.986	error	(394) at /opt/iobroker/node_modules/standard-as-callback/built/index.js:19:49
        javascript.0	2020-05-27 19:21:26.986	error	(394) at tryCatcher (/opt/iobroker/node_modules/standard-as-callback/built/utils.js:11:23)
        javascript.0	2020-05-27 19:21:26.986	error	(394) at /opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInRedis.js:580:17
        javascript.0	2020-05-27 19:21:26.986	error	(394) at /opt/iobroker/node_modules/iobroker.javascript/main.js:1055:17
        javascript.0	2020-05-27 19:21:26.986	error	(394) at /opt/iobroker/node_modules/iobroker.javascript/main.js:1464:17
        javascript.0	2020-05-27 19:21:26.985	error	(394) at prepareScript (/opt/iobroker/node_modules/iobroker.javascript/main.js:1411:37)
        javascript.0	2020-05-27 19:21:26.985	error	(394) at compile (/opt/iobroker/node_modules/iobroker.javascript/main.js:1188:28)
        javascript.0	2020-05-27 19:21:26.985	error	(394) at Object.createScript (vm.js:263:10)
        javascript.0	2020-05-27 19:21:26.985	error	(394) at new Script (vm.js:88:7)
        javascript.0	2020-05-27 19:21:26.985	error	(394) SyntaxError: Unexpected token 'function'
        javascript.0	2020-05-27 19:21:26.984	error	(394) ^^^^^^^^
        javascript.0	2020-05-27 19:21:26.984	error	(394) function(obj) {
        javascript.0	2020-05-27 19:21:26.984	error	at script.js.common.Test.Stromkosten_Gesamt:13
        javascript.0	2020-05-27 19:21:26.984	error	(394) script.js.common.Test.Stromkosten_Gesamt compile failed:
        javascript.0	2020-05-27 19:21:26.982	info	(394) Start javascript script.js.common.Test.Stromkosten_Gesamt
        javascript.0	2020-05-27 19:21:25.461	info	(394) Stop script script.js.common.Test.Stromkosten_Gesamt
        
        
        paul53P Offline
        paul53P Offline
        paul53
        wrote on last edited by paul53
        #12

        @tigertim08 sagte:

        compile failed besteht weiter

        Es fehlen eine schließende geschweifte Klammer und ein Komma.

        on({id: /\.05_current_year$/, change: 'any'}, function(obj) {
        

        und in Zeile 23 eine schließende runde Klammer.

        });
        

        Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
        Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

        tigertim08T 1 Reply Last reply
        0
        • paul53P paul53

          @tigertim08 sagte:

          compile failed besteht weiter

          Es fehlen eine schließende geschweifte Klammer und ein Komma.

          on({id: /\.05_current_year$/, change: 'any'}, function(obj) {
          

          und in Zeile 23 eine schließende runde Klammer.

          });
          
          tigertim08T Offline
          tigertim08T Offline
          tigertim08
          wrote on last edited by
          #13

          @paul53 said in Summe aus verschiedenen Datenpunkte:

          });

          Super, Danke! Jetzt meckert er nur noch das ich einen string zu einem state assigne. Die Werte werden doch aber auch als State ausgegeben oder habe ich da einen Denkfehler?

          javascript.0	2020-05-28 08:25:30.653	warn	(394) at processImmediate (internal/timers.js:456:21)
          javascript.0	2020-05-28 08:25:30.653	warn	(394) at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:4851:37)
          javascript.0	2020-05-28 08:25:30.653	warn	(394) at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:450:25)
          javascript.0	2020-05-28 08:25:30.652	warn	(394) at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1051:38)
          javascript.0	2020-05-28 08:25:30.652	warn	(394) at Object.<anonymous> (script.js.common.Test.Stromkosten_Gesamt:22:5)
          javascript.0	2020-05-28 08:25:30.652	warn	(394) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1354:20)
          javascript.0	2020-05-28 08:25:30.651	warn	(394) You are assigning a string to the state "javascript.0.Stromkosten.2020.Summe" which expects a boolean. Please fix your code to use a boolean or change the state type to string. This warning mig
          javascript.0	2020-05-28 08:25:30.651	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.hm-rpc__0__LEQ0536791__2__ENERGY_COUNTER.cost.05_current_year, timerId=undefined) => {"val":"1.88","ack":true,"ts":1590647
          javascript.0	2020-05-28 08:25:30.651	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.hm-rpc__0__MEQ0107335__2__ENERGY_COUNTER.cost.05_current_year, timerId=undefined) => {"val":"5.22","ack":true,"ts":1590647
          javascript.0	2020-05-28 08:25:30.650	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.hm-rpc__0__NEQ0153556__2__ENERGY_COUNTER.cost.05_current_year, timerId=undefined) => {"val":"0.00","ack":true,"ts":1590647
          javascript.0	2020-05-28 08:25:30.650	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.hm-rpc__0__NEQ0153678__2__ENERGY_COUNTER.cost.05_current_year, timerId=undefined) => {"val":"1.53","ack":true,"ts":1590647
          javascript.0	2020-05-28 08:25:30.650	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.sonoff__0__Tasmota_TV_Technik__ENERGY_Today.cost.05_current_year, timerId=undefined) => {"val":"0.00","ack":true,"ts":1590
          javascript.0	2020-05-28 08:25:30.649	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.sonoff__0__PC_Tim__ENERGY_Today.cost.05_current_year, timerId=undefined) => {"val":"0.01","ack":true,"ts":1590647120353,"q
          javascript.0	2020-05-28 08:25:30.649	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.sonoff__0__Wasserbett__ENERGY_Today.cost.05_current_year, timerId=undefined) => {"val":"0.01","ack":true,"ts":159064712735
          javascript.0	2020-05-28 08:25:29.695	info	(394) script.js.common.Test.Stromkosten_Gesamt: registered 1 subscription and 0 schedules
          javascript.0	2020-05-28 08:25:29.695	info	(394) script.js.common.Test.Stromkosten_Gesamt: subscribe: {"pattern":{"id":{},"change":"any","q":0},"name":"script.js.common.Test.Stromkosten_Gesamt"}
          
          HomoranH 1 Reply Last reply
          0
          • tigertim08T tigertim08

            @paul53 said in Summe aus verschiedenen Datenpunkte:

            });

            Super, Danke! Jetzt meckert er nur noch das ich einen string zu einem state assigne. Die Werte werden doch aber auch als State ausgegeben oder habe ich da einen Denkfehler?

            javascript.0	2020-05-28 08:25:30.653	warn	(394) at processImmediate (internal/timers.js:456:21)
            javascript.0	2020-05-28 08:25:30.653	warn	(394) at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:4851:37)
            javascript.0	2020-05-28 08:25:30.653	warn	(394) at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:450:25)
            javascript.0	2020-05-28 08:25:30.652	warn	(394) at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1051:38)
            javascript.0	2020-05-28 08:25:30.652	warn	(394) at Object.<anonymous> (script.js.common.Test.Stromkosten_Gesamt:22:5)
            javascript.0	2020-05-28 08:25:30.652	warn	(394) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1354:20)
            javascript.0	2020-05-28 08:25:30.651	warn	(394) You are assigning a string to the state "javascript.0.Stromkosten.2020.Summe" which expects a boolean. Please fix your code to use a boolean or change the state type to string. This warning mig
            javascript.0	2020-05-28 08:25:30.651	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.hm-rpc__0__LEQ0536791__2__ENERGY_COUNTER.cost.05_current_year, timerId=undefined) => {"val":"1.88","ack":true,"ts":1590647
            javascript.0	2020-05-28 08:25:30.651	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.hm-rpc__0__MEQ0107335__2__ENERGY_COUNTER.cost.05_current_year, timerId=undefined) => {"val":"5.22","ack":true,"ts":1590647
            javascript.0	2020-05-28 08:25:30.650	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.hm-rpc__0__NEQ0153556__2__ENERGY_COUNTER.cost.05_current_year, timerId=undefined) => {"val":"0.00","ack":true,"ts":1590647
            javascript.0	2020-05-28 08:25:30.650	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.hm-rpc__0__NEQ0153678__2__ENERGY_COUNTER.cost.05_current_year, timerId=undefined) => {"val":"1.53","ack":true,"ts":1590647
            javascript.0	2020-05-28 08:25:30.650	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.sonoff__0__Tasmota_TV_Technik__ENERGY_Today.cost.05_current_year, timerId=undefined) => {"val":"0.00","ack":true,"ts":1590
            javascript.0	2020-05-28 08:25:30.649	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.sonoff__0__PC_Tim__ENERGY_Today.cost.05_current_year, timerId=undefined) => {"val":"0.01","ack":true,"ts":1590647120353,"q
            javascript.0	2020-05-28 08:25:30.649	info	(394) script.js.common.Test.Stromkosten_Gesamt: getState(id=sourceanalytix.0.sonoff__0__Wasserbett__ENERGY_Today.cost.05_current_year, timerId=undefined) => {"val":"0.01","ack":true,"ts":159064712735
            javascript.0	2020-05-28 08:25:29.695	info	(394) script.js.common.Test.Stromkosten_Gesamt: registered 1 subscription and 0 schedules
            javascript.0	2020-05-28 08:25:29.695	info	(394) script.js.common.Test.Stromkosten_Gesamt: subscribe: {"pattern":{"id":{},"change":"any","q":0},"name":"script.js.common.Test.Stromkosten_Gesamt"}
            
            HomoranH Do not disturb
            HomoranH Do not disturb
            Homoran
            Global Moderator Administrators
            wrote on last edited by Homoran
            #14

            @tigertim08 sagte in Summe aus verschiedenen Datenpunkte:

            You are assigning a string to the state "javascript.0.Stromkosten.2020.Summe" which expects a boolean. Please fix your code to use a boolean or change the state type to string. This warning mig

            Dein Datenpunkt ist vom Typ "Logikwert"
            Der muss "Zahl" sein

            kein Support per PN! - Fragen im Forum stellen -
            Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.
            Das Forum freut sich über eine Spende. Benutzt dazu den Spendenbutton im Header. Danke!
            der Installationsfixer: curl -fsL https://iobroker.net/fix.sh | bash -

            1 Reply Last reply
            0
            • tigertim08T Offline
              tigertim08T Offline
              tigertim08
              wrote on last edited by
              #15

              laut Datenpunkt ist er das. Habe ihn auch nochmal gelöscht und fom Skript anlegen lassen

              var idSumme = 'javascript.0.Stromkosten.2020.Summe';
              {1}
              createState(idSumme,  { 
                  name: 'Summe aller Verbraucher',
                  unit: '€',
                  type: 'number',
                  def:  0,
                  min: 0
              });
              on({id: /\.05_current_year$/,
                  change: 'any'},
              
              function(obj) {
                  var a = getState('sourceanalytix.0.sonoff__0__Wasserbett__ENERGY_Today.cost.05_current_year').val,
                      b = getState('sourceanalytix.0.sonoff__0__PC_Tim__ENERGY_Today.cost.05_current_year').val,
                      c = getState('sourceanalytix.0.sonoff__0__Tasmota_TV_Technik__ENERGY_Today.cost.05_current_year').val,
                      d = getState('sourceanalytix.0.hm-rpc__0__NEQ0153678__2__ENERGY_COUNTER.cost.05_current_year').val,
                      e = getState('sourceanalytix.0.hm-rpc__0__NEQ0153556__2__ENERGY_COUNTER.cost.05_current_year').val,
                      f = getState('sourceanalytix.0.hm-rpc__0__MEQ0107335__2__ENERGY_COUNTER.cost.05_current_year').val,
                      g = getState('sourceanalytix.0.hm-rpc__0__LEQ0536791__2__ENERGY_COUNTER.cost.05_current_year').val;
                  var summe = a + b + c + d + e + f + g;
                  setState(idSumme, summe);
              });
              
              HomoranH 1 Reply Last reply
              0
              • tigertim08T tigertim08

                laut Datenpunkt ist er das. Habe ihn auch nochmal gelöscht und fom Skript anlegen lassen

                var idSumme = 'javascript.0.Stromkosten.2020.Summe';
                {1}
                createState(idSumme,  { 
                    name: 'Summe aller Verbraucher',
                    unit: '€',
                    type: 'number',
                    def:  0,
                    min: 0
                });
                on({id: /\.05_current_year$/,
                    change: 'any'},
                
                function(obj) {
                    var a = getState('sourceanalytix.0.sonoff__0__Wasserbett__ENERGY_Today.cost.05_current_year').val,
                        b = getState('sourceanalytix.0.sonoff__0__PC_Tim__ENERGY_Today.cost.05_current_year').val,
                        c = getState('sourceanalytix.0.sonoff__0__Tasmota_TV_Technik__ENERGY_Today.cost.05_current_year').val,
                        d = getState('sourceanalytix.0.hm-rpc__0__NEQ0153678__2__ENERGY_COUNTER.cost.05_current_year').val,
                        e = getState('sourceanalytix.0.hm-rpc__0__NEQ0153556__2__ENERGY_COUNTER.cost.05_current_year').val,
                        f = getState('sourceanalytix.0.hm-rpc__0__MEQ0107335__2__ENERGY_COUNTER.cost.05_current_year').val,
                        g = getState('sourceanalytix.0.hm-rpc__0__LEQ0536791__2__ENERGY_COUNTER.cost.05_current_year').val;
                    var summe = a + b + c + d + e + f + g;
                    setState(idSumme, summe);
                });
                
                HomoranH Do not disturb
                HomoranH Do not disturb
                Homoran
                Global Moderator Administrators
                wrote on last edited by
                #16

                @tigertim08 sagte in Summe aus verschiedenen Datenpunkte:

                laut Datenpunkt ist er das.

                dann gilt wohl der erste Tei lder Meldung:

                You are assigning a string to the state "javascript.0.Stromkosten.2020.Summe" which expects a boolean. Please fix your code to use a boolean or change the state type to string. This warning mig

                Also das Ergebnis nach Zahl wandeln

                kein Support per PN! - Fragen im Forum stellen -
                Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.
                Das Forum freut sich über eine Spende. Benutzt dazu den Spendenbutton im Header. Danke!
                der Installationsfixer: curl -fsL https://iobroker.net/fix.sh | bash -

                1 Reply Last reply
                0
                • tigertim08T Offline
                  tigertim08T Offline
                  tigertim08
                  wrote on last edited by tigertim08
                  #17

                  Wie ändere ich das denn? Hatte die einzelnen Datenpunkte schon gecheckt, diese sind auch als "number" klassifiziert.

                  2020-05-28_13-29-25.png

                  Kann es an der Unit liegen? Also das die Unit dazu führt das es bei der Folgeverarbeitung ein String und keine Nummer mehr ist?

                  HomoranH 1 Reply Last reply
                  0
                  • tigertim08T tigertim08

                    Wie ändere ich das denn? Hatte die einzelnen Datenpunkte schon gecheckt, diese sind auch als "number" klassifiziert.

                    2020-05-28_13-29-25.png

                    Kann es an der Unit liegen? Also das die Unit dazu führt das es bei der Folgeverarbeitung ein String und keine Nummer mehr ist?

                    HomoranH Do not disturb
                    HomoranH Do not disturb
                    Homoran
                    Global Moderator Administrators
                    wrote on last edited by
                    #18

                    @tigertim08 sagte in Summe aus verschiedenen Datenpunkte:

                    Hatte die einzelnen Datenpunkte schon gecheckt,

                    nicht die datenpunkte!

                    Die Variable im Skript scheint Typ String zu sein

                    kein Support per PN! - Fragen im Forum stellen -
                    Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.
                    Das Forum freut sich über eine Spende. Benutzt dazu den Spendenbutton im Header. Danke!
                    der Installationsfixer: curl -fsL https://iobroker.net/fix.sh | bash -

                    1 Reply Last reply
                    0
                    • tigertim08T Offline
                      tigertim08T Offline
                      tigertim08
                      wrote on last edited by tigertim08
                      #19

                      (gelöst) DANKE! Für die Unterstützung :)

                      okay, also wenn ich den State umwandle sollte es gehen?

                      var idSumme = 'javascript.0.Stromkosten.2020';
                      {1}
                      createState(idSumme,  { 
                          name: 'Summe der Verbraucher',
                          unit: '€',
                          type: 'number',
                          def:  0,
                          min: 0
                      });
                      on({id: /\.05_current_year$/,
                          change: 'any'},
                      
                      function(obj) {
                          var a = parseFloat(getState('sourceanalytix.0.sonoff__0__Wasserbett__ENERGY_Today.cost.05_current_year').val),
                              b = parseFloat(getState('sourceanalytix.0.sonoff__0__PC_Tim__ENERGY_Today.cost.05_current_year').val),
                              c = parseFloat(getState('sourceanalytix.0.sonoff__0__Tasmota_TV_Technik__ENERGY_Today.cost.05_current_year').val),
                              d = parseFloat(getState('sourceanalytix.0.hm-rpc__0__NEQ0153678__2__ENERGY_COUNTER.cost.05_current_year').val),
                              e = parseFloat(getState('sourceanalytix.0.hm-rpc__0__NEQ0153556__2__ENERGY_COUNTER.cost.05_current_year').val),
                              f = parseFloat(getState('sourceanalytix.0.hm-rpc__0__MEQ0107335__2__ENERGY_COUNTER.cost.05_current_year').val),
                              g = parseFloat(getState('sourceanalytix.0.hm-rpc__0__LEQ0536791__2__ENERGY_COUNTER.cost.05_current_year').val);
                          var summe = a + b + c + d + e + f + g;
                          setState(idSumme, summe);
                      });
                      

                      habe es mit parseFloat probiert allerdings bleibt jetzt der Datenpunkt leer. Warnmeldungen werden mir aber nicht mehr angezeit.

                      T 1 Reply Last reply
                      0
                      • tigertim08T tigertim08

                        (gelöst) DANKE! Für die Unterstützung :)

                        okay, also wenn ich den State umwandle sollte es gehen?

                        var idSumme = 'javascript.0.Stromkosten.2020';
                        {1}
                        createState(idSumme,  { 
                            name: 'Summe der Verbraucher',
                            unit: '€',
                            type: 'number',
                            def:  0,
                            min: 0
                        });
                        on({id: /\.05_current_year$/,
                            change: 'any'},
                        
                        function(obj) {
                            var a = parseFloat(getState('sourceanalytix.0.sonoff__0__Wasserbett__ENERGY_Today.cost.05_current_year').val),
                                b = parseFloat(getState('sourceanalytix.0.sonoff__0__PC_Tim__ENERGY_Today.cost.05_current_year').val),
                                c = parseFloat(getState('sourceanalytix.0.sonoff__0__Tasmota_TV_Technik__ENERGY_Today.cost.05_current_year').val),
                                d = parseFloat(getState('sourceanalytix.0.hm-rpc__0__NEQ0153678__2__ENERGY_COUNTER.cost.05_current_year').val),
                                e = parseFloat(getState('sourceanalytix.0.hm-rpc__0__NEQ0153556__2__ENERGY_COUNTER.cost.05_current_year').val),
                                f = parseFloat(getState('sourceanalytix.0.hm-rpc__0__MEQ0107335__2__ENERGY_COUNTER.cost.05_current_year').val),
                                g = parseFloat(getState('sourceanalytix.0.hm-rpc__0__LEQ0536791__2__ENERGY_COUNTER.cost.05_current_year').val);
                            var summe = a + b + c + d + e + f + g;
                            setState(idSumme, summe);
                        });
                        

                        habe es mit parseFloat probiert allerdings bleibt jetzt der Datenpunkt leer. Warnmeldungen werden mir aber nicht mehr angezeit.

                        T Offline
                        T Offline
                        ticaki
                        wrote on last edited by ticaki
                        #20

                        @tigertim08

                        Werfe mal das parseFloat() raus und füge:

                        log('a: '+a);
                        log('b: '+b);
                        log('c: '+c);
                        log('d: '+d);
                        log('e: '+e);
                        log('f: '+f);
                        log('g: '+g);
                        

                        nach Zeile 20 ein. Poste die Logeinträge. Denke mal das es ein Problem mit ".," oder Einheitenangaben ist.

                        Weather-Warnings Espresense NSPanel-Lovelace-ui Tagesschau

                        Spenden

                        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

                        591

                        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