Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. [gelöst] - Anzeige Kommastelle

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] - Anzeige Kommastelle

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

      Hallo zusammen,

      kann mir jemand sagen was ich tun muss damit mir hier auch zusätzlich zwei Nachkommastellen angezeigt werden oder zumindest eine?

      4109ccb8-ce2d-4bf0-b53a-c26175d67986-2021-09-30 09.59.52.jpeg

      de45b318-77a1-4c4f-b48f-8df77f9ac223-2021-09-30 10.00.49.jpeg

      {val:easee.0.EH806570.status.totalPower;val<1000?Math.round(val):parseFloat(val*0.0001).toFixed(1)}
      {val:easee.0.EH806570.status.totalPower;" kW"}

      So sieht der Datenpunkt aus.
      fdf799fc-f009-438e-a28d-0c2439387b0a-2021-09-30 10.02.32.jpeg

      Hier macht er es komischerweise
      ca8ab5d5-2f3d-42b5-a76e-12fa71fb54ac-2021-09-30 10.05.48.jpeg
      HTML sind aber identisch!

      Danke Euch!

      liv-in-sky 3 Replies Last reply Reply Quote 0
      • liv-in-sky
        liv-in-sky @Uli977 last edited by

        @uli977

        der wert 1,9555... ist keine zahl, da komma - das sollte ein punkt sein

        1 Reply Last reply Reply Quote 0
        • liv-in-sky
          liv-in-sky @Uli977 last edited by

          @uli977 die zweite zeile ist eigentlich kein binding - da kannst du einfach nur kW schreiben

          {vali:0_userdata.0.CONTROL-OWN.AAATEST.Script_Total ; vali<1000 ? Math.round(val)  : parseFloat(vali*0.0001).toFixed(1) }
          &ensp;kW
          
          &ensp;   ist ein leerzeichen im html-code
          
          1 Reply Last reply Reply Quote 0
          • liv-in-sky
            liv-in-sky @Uli977 last edited by liv-in-sky

            @uli977
            mit dieser formel werden immer 2 nachkomma angezeigt - mit dem wert, in dem ein komma ist !

            AApossis (131).gif

             {vali:0_userdata.0.CONTROL-OWN.AAATEST.TestString1 ; vali2 = parseFloat(vali.replace(',','.'));Math.round(vali2 * 100) / 100  }
            

            hilft das ?

            willst du nur eine nachkommastelle : ändere beide 100 in 10 am ende der formel

            Math.round(vali2 * 10) / 10
            
            1 Reply Last reply Reply Quote 0
            • Uli977
              Uli977 last edited by

              Vielen Dank, Ihr habt mir sehr geholfen!

              liv-in-sky 1 Reply Last reply Reply Quote 0
              • liv-in-sky
                liv-in-sky @Uli977 last edited by

                @uli977 haben WIR gerne gemacht

                Uli977 2 Replies Last reply Reply Quote 2
                • Uli977
                  Uli977 @liv-in-sky last edited by

                  @liv-in-sky Du 🙂

                  R 1 Reply Last reply Reply Quote 0
                  • R
                    RMortan @Uli977 last edited by

                    @uli977 Hallo

                    Darf ich mal fragen wo du die Bilder her hast bzw. Wie du es umgesetzt hast das deine PV Anlage so angezeigt wird.

                    Danke schon mal...

                    Lg

                    Uli977 1 Reply Last reply Reply Quote 0
                    • Uli977
                      Uli977 @RMortan last edited by Uli977

                      @rmortan

                      Ich habe mir dieses Beitrag angesehen und mir das ZIP File vom Beitrag von ak1 vom 06.10.2020 heruntergeladen und die Files (Widget und Bilder) importiert und damit weitergearbeitet.

                      https://forum.iobroker.net/topic/16169/iobroker-anbindung-an-einen-kostal-plenticore/636

                      7a184ab8-04a1-4b45-9930-90b3cd08e836-2021-09-30 13.28.54.jpeg

                      Nutze dafür den Easee Wallbox Adapter und den Kostal Plenticore Adapter, sowie ein Skript zur Steuerung für das Überschussladen.

                      Viele Grüße!

                      1 Reply Last reply Reply Quote 0
                      • Uli977
                        Uli977 @liv-in-sky last edited by Uli977

                        @liv-in-sky Kannst du mir nochmal helfen?

                        Ich muss hier noch den Wert eines zweiten Wechselrichters addieren, bekomme es aber nicht hin.

                        {val:plenticore.0.devices.local.Pv_P;val<1000?Math.round(val):parseFloat(val*0.001).toFixed(1)}

                        cc9e6c05-a03e-4f01-85b7-899049f7b771-2021-10-09 11.08.43.jpeg

                        Danke dir!

                        liv-in-sky 1 Reply Last reply Reply Quote 0
                        • liv-in-sky
                          liv-in-sky @Uli977 last edited by liv-in-sky

                          @uli977 sagte in [gelöst] - Anzeige Kommastelle:

                          {val:plenticore.0.devices.local.Pv_P;val<1000?Math.round(val):parseFloat(val*0.001).toFixed(1)}

                          bei mir funktioniert es so, wenn der datenpunkt eine zahl ist - ist das wieder ein string oder etwas mit komma ?

                          {val:plenticore.0.devices.local.Pv_P; val<1000 ? Math.round(val) : (val*0.001).toFixed(1) }
                          {val:plenticore.0.devices.local.Pv_P; val<1000 ? "W" : "kW"}
                          
                          

                          wenn das wieder so ein komma string ist, dann.

                          {val:plenticore.0.devices.local.Pv_P; val2=parseFloat(val.replace(',','.')); val2<1000 ? Math.round(val2 * 100) / 100 : Math.round(val2 * 0.001* 10) / 10 }
                          {val:plenticore.0.devices.local.Pv_P; parseFloat(val.replace(',','.'))<1000 ? "W" : "kW"}
                          
                          
                          
                          Uli977 1 Reply Last reply Reply Quote 0
                          • Uli977
                            Uli977 @liv-in-sky last edited by

                            @liv-in-sky

                            plenticore.0.devices.local.Pv_P
                            plenticore.1.devices.local.Pv_P

                            Diese beiden Werte müsste ich addieren und es sind Zahlen.

                            Wie sähe es aus wenn es Komma string sind?

                            Ich bekomme es nicht hin... Sorry!

                            Kannst du mir nochmal helfen?

                            1000 Dank!

                            Viele Grüße aus Mettmann!

                            liv-in-sky 1 Reply Last reply Reply Quote 0
                            • liv-in-sky
                              liv-in-sky @Uli977 last edited by

                              @uli977

                              wenn es eine zahl ist und addiert werden soll

                              probiermal mal

                              {wert2:plenticore.0.devices.local.Pv_P; wert1:plenticore.1.devices.local.Pv_P;  wertAll= Number(wert1) + Number(wert2); wertAll<1000 ? Math.round(wertAll) : (wertAll*0.001).toFixed(1) }
                              {wert2:plenticore.0.devices.local.Pv_P; wert1:plenticore.1.devices.local.Pv_P;  wertAll= Number(wert1) + Number(wert2); wertAll<1000 ? "W" : "kW"}
                              
                              Uli977 1 Reply Last reply Reply Quote 0
                              • Uli977
                                Uli977 @liv-in-sky last edited by

                                @liv-in-sky Das mit der Zahl hat schoinmal geklappt! Super, danke!

                                Und wenn es jetzt ein KommaString ist welcher addiert werden soll?
                                Ist es dann so korrekt?

                                {val: plenticore.0.devices.local.Home_P; val2=plenticore.1.devices.local.Home_P (val.replace(',','.')); val2<1000 ? Math.round(val2 * 100) / 100 : Math.round(val2 * 0.001* 10) / 10 }
                                {val: plenticore.0.devices.local.Home_P; plenticore.1.devices.local.Home_P (val.replace(',','.'))<1000 ? "W" : "kW"}
                                

                                Der zweite Wert kann aber auch Null sein, funktioniert es dann auch?

                                liv-in-sky 2 Replies Last reply Reply Quote 0
                                • liv-in-sky
                                  liv-in-sky @Uli977 last edited by

                                  @uli977

                                  leider nei - da muss:

                                  parseFloat(vali.replace(',','.'));
                                  

                                  raeplace ändert den string von komma zu punkt - das ganze wird dann mit parseFloat() in eine zahl verwandelt- erst dann kannst du nach größer kleier abfragen

                                  das mit null wird bei mir nicht angezeigt - da ist ein fehler - muss mal überlegen, ob ich das abfangen kann - das null bedeutet, das der wert null ist oder das der wert nicht abrufbar ist ? evtl muss das über eine eigenes blockly abgefangen werden un in einen extra dp geschrieben werden

                                  1 Reply Last reply Reply Quote 0
                                  • liv-in-sky
                                    liv-in-sky @Uli977 last edited by

                                    @uli977

                                    um das null mit benutzen zu können hilft die zwischenabfrage

                                    {wert2:0_userdata.0.CONTROL-OWN.AAATEST.aObject; wert1:0_userdata.0.CONTROL-OWN.TestZahlNull; wert1==null ? 0 : wert1;  wertAll= Number(wert1) + Number(wert2); wertAll<1000 ? Math.round(wertAll) : (wertAll*0.001).toFixed(1) }
                                    

                                    speziell der teil:

                                     wert1==null ? 0 : wert1;  
                                    

                                    wenn da wieder ein komma -string drinsteht mußt du

                                     wert1==null ? "0" : wert1;  
                                    

                                    das muss direkt hinter die variable-definition
                                    z.B.

                                    {val: plenticore.0.devices.local.Home_P;  val2=plenticore.1.devices.local.Home_P; val2==null ? "0" : val2; valadd=parseFloat(val2.replace(',','.'))+val; valadd<1000 ? Math.round(valadd* 100) / 100 : Math.round(valadd* 0.001* 10) / 10 }
                                    
                                    {val: plenticore.0.devices.local.Home_P; val2: plenticore.1.devices.local.Home_P; val2==null ? "0" : val2; valadd=parseFloat(val2.replace(',','.'))+val; valadd<1000 ? "W" : "kW"}
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post

                                    Support us

                                    ioBroker
                                    Community Adapters
                                    Donate
                                    FAQ Cloud / IOT
                                    HowTo: Node.js-Update
                                    HowTo: Backup/Restore
                                    Downloads
                                    BLOG

                                    699
                                    Online

                                    31.9k
                                    Users

                                    80.3k
                                    Topics

                                    1.3m
                                    Posts

                                    3
                                    16
                                    705
                                    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