Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Visualisierung
    4. Binding-Problem

    NEWS

    • Neues Video "KI im Smart Home" - ioBroker plus n8n

    • Neues Video über Aliase, virtuelle Geräte und Kategorien

    • Wir empfehlen: Node.js 22.x

    Binding-Problem

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      ManfredHi last edited by

      Hallo.
      Ich komme mit einem Binding in der VIS einfach nicht weiter:

      {wert:0_userdata.0.Strom.PV.Prognose_heute; ((parseFloat(wert * 0.85)).toFixed(1) + " - " + ((parseFloat(wert)).toFixed(1)+ " kWh").replace(".",",")}
      

      Als Ergebnis soll dann z.b. 65,1 - 75,1 kWh
      stehen.

      Irgendwie funktioniert es nicht. Wo hab ich da den Fehler? Danke.

      Homoran haus-automatisierung 2 Replies Last reply Reply Quote 0
      • Homoran
        Homoran Global Moderator Administrators @ManfredHi last edited by

        @manfredhi sagte in Binding-Problem:

        Irgendwie funktioniert es nicht.

        geht nicht ist keine exskte Fehlerbeschreibung!

        Was passiert?
        Was enthält der DP?
        bekommst du mit kürzeren Formeln etwas raus?

        M 1 Reply Last reply Reply Quote 0
        • M
          ManfredHi @Homoran last edited by

          @homoran
          WEnn ich nur den ersten Teil verwende funktioniert es

          {wert:0_userdata.0.Strom.PV.Prognose_heute; ((parseFloat(wert * 0.85)).toFixed(1) + " - ").replace(".",",")}
          

          Da kommt z.B. als Ergebnis dann "65,1 -" raus.
          Sobald ich aber dann den zweiten TEil einfüge, kommt als ergebnis nur eine 0 raus.

          Der DP enthält eine Zahl mit 3 Kommastellen.

          Homoran 1 Reply Last reply Reply Quote 0
          • Homoran
            Homoran Global Moderator Administrators @ManfredHi last edited by

            @manfredhi passen die Anzahl und Positionen der Klammern?
            kann das am Handy nicht richtig nachvollziehen

            M 1 Reply Last reply Reply Quote 0
            • M
              ManfredHi @Homoran last edited by

              @homoran

              Ich hab es jetzt so gemacht. Es funktioniert. Ob es aber der richtige Weg ist weiß ich nicht:

              {wert:0_userdata.0.Strom.PV.Prognose_heute; ((parseFloat(wert * 0.85)).toFixed(1)).replace(".",",")} - {wert:0_userdata.0.Strom.PV.Prognose_heute; ((parseFloat(wert)).toFixed(1)).replace(".",",")} kWh
              
              bahnuhr 1 Reply Last reply Reply Quote 0
              • bahnuhr
                bahnuhr Forum Testing Most Active @ManfredHi last edited by

                @manfredhi sagte in Binding-Problem:

                {v1:0_userdata.0.Strom.PV.Prognose_heute;((parseFloat(v1*0.85)).toFixed(1)).replace(".",",")+" - "+((parseFloat(v1)).toFixed(1)).replace(".",",")}
                
                1 Reply Last reply Reply Quote 0
                • haus-automatisierung
                  haus-automatisierung Developer Most Active @ManfredHi last edited by

                  @manfredhi Klammerfehler:

                  {wert:0_userdata.0.Strom.PV.Prognose_heute;(parseFloat(wert * 0.85).toFixed(1) + ' - ' + parseFloat(wert).toFixed(1) + ' kWh').replace('.',',')}
                  
                  M 1 Reply Last reply Reply Quote 0
                  • M
                    ManfredHi @haus-automatisierung last edited by

                    @bahnuhr und @haus-automatisierung
                    Vielen Dank Euch beiden. Funktioniert perfekt.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    Support us

                    ioBroker
                    Community Adapters
                    Donate

                    545
                    Online

                    32.1k
                    Users

                    80.7k
                    Topics

                    1.3m
                    Posts

                    4
                    8
                    224
                    Loading More Posts
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes
                    Reply
                    • Reply as topic
                    Log in to reply
                    Community
                    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                    The ioBroker Community 2014-2023
                    logo