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. English
  3. Scripting / Logic
  4. JavaScript
  5. Zeitstempel entfernen

NEWS

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

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

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    2.5k

Zeitstempel entfernen

Scheduled Pinned Locked Moved JavaScript
20 Posts 3 Posters 2.0k Views 1 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.
  • paul53P paul53

    @mp24 sagte: Ob es funktioniert sehe ich ja erst bei Wertänderung.

    Nicht unbedingt (Zeile 9):

    setState(idSysvar, parseFloat(getState(idAdapter).val.split(' ')[1]));
    
    M Offline
    M Offline
    mp24
    wrote on last edited by
    #6

    @paul53
    Kaum macht Man(n) es richtig, dann klappt es auch. Die 38 % stehen über dem Tank in der Vis.
    Und ich habe es stundenlang mit trim, ltrim, replace usw. versucht.
    Vielen Dank nochmal
    mp24

    1 Reply Last reply
    0
    • paul53P paul53

      @mp24 sagte: Ob es funktioniert sehe ich ja erst bei Wertänderung.

      Nicht unbedingt (Zeile 9):

      setState(idSysvar, parseFloat(getState(idAdapter).val.split(' ')[1]));
      
      M Offline
      M Offline
      mp24
      wrote on last edited by
      #7

      @paul53
      Ich erhalte Warnungen:
      javascript.0 (16643) at script.js.common.von_IOBroker_nach_Homematic.Zisterne_Hoehenstand_ohne_Zeit:10:1
      Bzw. 21:3
      Was könnte das bedeuten ?

      Vielen Dank
      mp24

      paul53P 1 Reply Last reply
      0
      • M mp24

        @paul53
        Ich erhalte Warnungen:
        javascript.0 (16643) at script.js.common.von_IOBroker_nach_Homematic.Zisterne_Hoehenstand_ohne_Zeit:10:1
        Bzw. 21:3
        Was könnte das bedeuten ?

        Vielen Dank
        mp24

        paul53P Offline
        paul53P Offline
        paul53
        wrote on last edited by
        #8

        @mp24 sagte: javascript.0 (16643) at script.js.common.von_IOBroker_nach_Homematic.Zisterne_Hoehenstand_ohne_Zeit:10:1

        Mehr nicht? Schau mal in den Tab "Protokolle", ob es dort nicht mehr Informationen gibt.

        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

        M 1 Reply Last reply
        0
        • paul53P paul53

          @mp24 sagte: javascript.0 (16643) at script.js.common.von_IOBroker_nach_Homematic.Zisterne_Hoehenstand_ohne_Zeit:10:1

          Mehr nicht? Schau mal in den Tab "Protokolle", ob es dort nicht mehr Informationen gibt.

          M Offline
          M Offline
          mp24
          wrote on last edited by
          #9

          @paul53
          Die Fehlermeldungen:
          You are assigning a number to the state "hm-rega.0.1740" which expects a string. Please fix your code to use a string or change the state type to number. This warning might become an error in future versions

          at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1437:20)

          Der Wert der vom Broker übermittelt wird ist vom Typ string. In der Homematic Zahl.
          Muss erst noch gewandelt werden ?

          paul53P 1 Reply Last reply
          0
          • M mp24

            @paul53
            Die Fehlermeldungen:
            You are assigning a number to the state "hm-rega.0.1740" which expects a string. Please fix your code to use a string or change the state type to number. This warning might become an error in future versions

            at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1437:20)

            Der Wert der vom Broker übermittelt wird ist vom Typ string. In der Homematic Zahl.
            Muss erst noch gewandelt werden ?

            paul53P Offline
            paul53P Offline
            paul53
            wrote on last edited by
            #10

            @mp24 sagte: You are assigning a number to the state "hm-rega.0.1740"

            Ändere den Typ des Datenpunktes in "Zahl".

            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

            M 1 Reply Last reply
            0
            • paul53P paul53

              @mp24 sagte: You are assigning a number to the state "hm-rega.0.1740"

              Ändere den Typ des Datenpunktes in "Zahl".

              M Offline
              M Offline
              mp24
              wrote on last edited by
              #11

              @paul53
              Der Datenpunkt in der Homematic ist Zahl. Aber von MQTT kommt String an

              HomoranH paul53P 2 Replies Last reply
              0
              • M mp24

                @paul53
                Der Datenpunkt in der Homematic ist Zahl. Aber von MQTT kommt String an

                HomoranH Offline
                HomoranH Offline
                Homoran
                Global Moderator Administrators
                wrote on last edited by Homoran
                #12

                @mp24 sagte in Zeitstempel entfernen:

                Der Datenpunkt in der Homematic ist Zahl. Aber von MQTT kommt String an

                das log sagt aber was anderes :-(
                und das Skript von @paul53 schreibt eine Zahl

                kein Support per PN! - Fragen im Forum stellen - es gibt fast nichts, was nicht auch für andere interessant ist.

                Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.

                der Installationsfixer: curl -fsL https://iobroker.net/fix.sh | bash -

                1 Reply Last reply
                0
                • M mp24

                  @paul53
                  Der Datenpunkt in der Homematic ist Zahl. Aber von MQTT kommt String an

                  paul53P Offline
                  paul53P Offline
                  paul53
                  wrote on last edited by
                  #13

                  @mp24 sagte: Der Datenpunkt in der Homematic ist Zahl.

                  Das hat die Instanz "hm-rega.0" aber noch nicht mitbekommen.

                  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

                  M 2 Replies Last reply
                  1
                  • paul53P paul53

                    @mp24 sagte: Der Datenpunkt in der Homematic ist Zahl.

                    Das hat die Instanz "hm-rega.0" aber noch nicht mitbekommen.

                    M Offline
                    M Offline
                    mp24
                    wrote on last edited by
                    #14

                    @paul53
                    Genau. Der Rega Adapter stand noch auf String. Rega Adapter neu gestartet - steht nuun auf Zahl. Aber neue Fehler:

                    at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1082:38)
                    
                    at Immediate._onImmediate (/opt/iobroker/node_modules/@iobroker/js-controller-adapter/src/lib/adapter/adapter.js:5909:56)
                    
                    1 Reply Last reply
                    0
                    • paul53P paul53

                      @mp24 sagte: Der Datenpunkt in der Homematic ist Zahl.

                      Das hat die Instanz "hm-rega.0" aber noch nicht mitbekommen.

                      M Offline
                      M Offline
                      mp24
                      wrote on last edited by
                      #15

                      @paul53
                      Noch mehr Fehlermeldungen:
                      javascript.0
                      2022-03-18 18:32:05.739 info State value to set for "hm-rega.0.1740" has to be type "number" but received type "string"
                      javascript.0
                      2022-03-18 18:32:05.713 warn at processImmediate (internal/timers.js:464:21)
                      javascript.0
                      2022-03-18 18:32:05.713 warn at Immediate._onImmediate (/opt/iobroker/node_modules/@iobroker/js-controller-adapter/src/lib/adapter/adapter.js:5909:56)
                      javascript.0
                      2022-03-18 18:32:05.713 warn at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:530:29)
                      javascript.0
                      2022-03-18 18:32:05.713 warn at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1082:38)
                      javascript.0
                      2022-03-18 18:32:05.713 warn at Object.<anonymous> (script.js.common.von_IOBroker_nach_Homematic.Zisterne_Hoehenstand_ohne_Zeit:17:4)
                      javascript.0
                      2022-03-18 18:32:05.712 warn at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1437:20)
                      javascript.0
                      2022-03-18 18:32:05.393 warn You are assigning a string to the state "hm-rega.0.1740" which expects a number. Please fix your code to use a number or change the state type to string. This warning might become an error in future versions.

                      paul53P 1 Reply Last reply
                      0
                      • M mp24

                        @paul53
                        Noch mehr Fehlermeldungen:
                        javascript.0
                        2022-03-18 18:32:05.739 info State value to set for "hm-rega.0.1740" has to be type "number" but received type "string"
                        javascript.0
                        2022-03-18 18:32:05.713 warn at processImmediate (internal/timers.js:464:21)
                        javascript.0
                        2022-03-18 18:32:05.713 warn at Immediate._onImmediate (/opt/iobroker/node_modules/@iobroker/js-controller-adapter/src/lib/adapter/adapter.js:5909:56)
                        javascript.0
                        2022-03-18 18:32:05.713 warn at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:530:29)
                        javascript.0
                        2022-03-18 18:32:05.713 warn at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1082:38)
                        javascript.0
                        2022-03-18 18:32:05.713 warn at Object.<anonymous> (script.js.common.von_IOBroker_nach_Homematic.Zisterne_Hoehenstand_ohne_Zeit:17:4)
                        javascript.0
                        2022-03-18 18:32:05.712 warn at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1437:20)
                        javascript.0
                        2022-03-18 18:32:05.393 warn You are assigning a string to the state "hm-rega.0.1740" which expects a number. Please fix your code to use a number or change the state type to string. This warning might become an error in future versions.

                        paul53P Offline
                        paul53P Offline
                        paul53
                        wrote on last edited by paul53
                        #16

                        @mp24 sagte: warn You are assigning a string to the state "hm-rega.0.1740" which expects a number.

                        parseFloat() macht eine Zahl aus dem String-Teil hinter dem Leerzeichen. Hast Du was am Skript geändert?

                        const idAdapter = 'mqtt.0.Zisterne.Hoehenstand';
                        const idSysvar = 'hm-rega.0.1740';
                         
                        // Skriptstart
                        setState(idSysvar, parseFloat(getState(idAdapter).val.split(' ')[1]));
                         
                        // Aktualisierung bei Wertänderung
                        on(idAdapter, function(dp) {
                            setState(idSysvar, parseFloat(dp.state.val.split(' ')[1])); 
                        });
                        

                        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

                        M 2 Replies Last reply
                        0
                        • paul53P paul53

                          @mp24 sagte: warn You are assigning a string to the state "hm-rega.0.1740" which expects a number.

                          parseFloat() macht eine Zahl aus dem String-Teil hinter dem Leerzeichen. Hast Du was am Skript geändert?

                          const idAdapter = 'mqtt.0.Zisterne.Hoehenstand';
                          const idSysvar = 'hm-rega.0.1740';
                           
                          // Skriptstart
                          setState(idSysvar, parseFloat(getState(idAdapter).val.split(' ')[1]));
                           
                          // Aktualisierung bei Wertänderung
                          on(idAdapter, function(dp) {
                              setState(idSysvar, parseFloat(dp.state.val.split(' ')[1])); 
                          });
                          
                          M Offline
                          M Offline
                          mp24
                          wrote on last edited by
                          #17

                          @paul53
                          So sieht das Script aus:

                          var idAdapter = 'mqtt.0.Zisterne.Hoehenstand'/*Quelle*/
                          var idSysvar = 'hm-rega.0.1740'/*Ziel*/
                          
                          
                          
                          
                          // Skriptstart
                          
                          // setState(idSysvar, getState(idAdapter).val);
                          setState(idSysvar, parseFloat(getState(idAdapter).val.split(' ')[1])); 
                           
                          
                          // Aktualisierung bei Wertänderung
                          
                          on(idAdapter, function(dp) {
                          
                             setState(idSysvar, dp.state.val);
                              
                          
                          });
                          
                          paul53P 1 Reply Last reply
                          0
                          • paul53P paul53

                            @mp24 sagte: warn You are assigning a string to the state "hm-rega.0.1740" which expects a number.

                            parseFloat() macht eine Zahl aus dem String-Teil hinter dem Leerzeichen. Hast Du was am Skript geändert?

                            const idAdapter = 'mqtt.0.Zisterne.Hoehenstand';
                            const idSysvar = 'hm-rega.0.1740';
                             
                            // Skriptstart
                            setState(idSysvar, parseFloat(getState(idAdapter).val.split(' ')[1]));
                             
                            // Aktualisierung bei Wertänderung
                            on(idAdapter, function(dp) {
                                setState(idSysvar, parseFloat(dp.state.val.split(' ')[1])); 
                            });
                            
                            M Offline
                            M Offline
                            mp24
                            wrote on last edited by
                            #18

                            @paul53
                            Und so die hmrega 1740:

                            
                              "_id": "hm-rega.0.1740",
                              "type": "state",
                              "common": {
                                "name": "SV_Zisterne-Hoehenstand",
                                "type": "number",
                                "read": true,
                                "write": true,
                                "role": "state",
                                "min": 0,
                                "max": 100,
                                "unit": "%",
                            
                            1 Reply Last reply
                            0
                            • M mp24

                              @paul53
                              So sieht das Script aus:

                              var idAdapter = 'mqtt.0.Zisterne.Hoehenstand'/*Quelle*/
                              var idSysvar = 'hm-rega.0.1740'/*Ziel*/
                              
                              
                              
                              
                              // Skriptstart
                              
                              // setState(idSysvar, getState(idAdapter).val);
                              setState(idSysvar, parseFloat(getState(idAdapter).val.split(' ')[1])); 
                               
                              
                              // Aktualisierung bei Wertänderung
                              
                              on(idAdapter, function(dp) {
                              
                                 setState(idSysvar, dp.state.val);
                                  
                              
                              });
                              
                              paul53P Offline
                              paul53P Offline
                              paul53
                              wrote on last edited by paul53
                              #19

                              @mp24 sagte: So sieht das Script aus:

                              Zeile 17:

                                  setState(idSysvar, parseFloat(dp.state.val.split(' ')[1])); 
                              

                              Hattest Du doch schon.

                              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

                              M 1 Reply Last reply
                              1
                              • paul53P paul53

                                @mp24 sagte: So sieht das Script aus:

                                Zeile 17:

                                    setState(idSysvar, parseFloat(dp.state.val.split(' ')[1])); 
                                

                                Hattest Du doch schon.

                                M Offline
                                M Offline
                                mp24
                                wrote on last edited by
                                #20

                                @paul53 said in Zeitstempel entfernen:

                                setState(idSysvar, parseFloat(dp.state.val.split(' ')[1])); 
                                

                                Aus dem Hinweis gestern Zeile 9:
                                habe ich geschlossen. das nur der Befehl in Zeike 9 gehört.
                                Das es zweimal gesetzt werden muss habe ich falsch verstanden.

                                Ich senke demütig mein Haupt und bitte um Entschuldigung
                                mp24

                                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

                                355

                                Online

                                32.7k

                                Users

                                82.4k

                                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