Navigation

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

    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

    [gelöst] Alias Datenpunkt ... JSON parsen

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

      ... ich suche seit Stunden und finde den Fehler nicht ...

      Diesen MQTT Ausdruck ...

      ca807791-68b2-4942-aaee-e98c17604575-grafik.png
      ... möchte ich so auflösen ...

      66ea1606-4729-4e75-980b-69bfddb39ed2-grafik.png

      Ich bekomme aber nur ...

      f10df10a-047e-4da8-b2ca-81f6fdbf06bc-grafik.png

      Was mache ich falsch ?! 😠

      paul53 Homoran 3 Replies Last reply Reply Quote 0
      • paul53
        paul53 @RaspiUser last edited by

        @raspiuser sagte: Was mache ich falsch ?!

        Da ist noch eine leere Eigenschaft drin.

        JSON.parse(val)[''].Total_in
        
        RaspiUser 1 Reply Last reply Reply Quote 1
        • Homoran
          Homoran Global Moderator Administrators @RaspiUser last edited by

          @raspiuser sagte in Alias Datenpunkt ... JSON parsen:

          Was mache ich falsch ?!

          das Json als Bild zu posten, anstelle als Text in code-tags.
          Dann hätte man es herauskopieren können und dir die Struktur per jsonviewer.stack.hu visualisieren können.

          1 Reply Last reply Reply Quote 0
          • RaspiUser
            RaspiUser @paul53 last edited by

            @paul53 said in Alias Datenpunkt ... JSON parsen:

            leere Eigenschaft

            ... und wie muss ich die "2 Gänsefüßchen oben" dann in der Konvertierung berücksichtigen ?!

            @homoran said in Alias Datenpunkt ... JSON parsen:

            als Text in code-tags

            {
              "Time": "2023-08-18T15:46:09",
              "": {
                "Total_in": 12694.23,
                "Total_out": 26346.67,
                "Power_curr": 64
              }
            }
            

            ... ich hab das mal dort eingegeben ... bringt für mich aber nur weitere Fragen ...

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

              @raspiuser sagte in Alias Datenpunkt ... JSON parsen:

              bringt für mich aber nur weitere Fragen ...

              welche?
              Screenshot_20230818-165903_Firefox.jpg

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

                @homoran

                ... jetzt wird die "leere Eigenschaft" anders dargestellt, aber was ich da jetzt konkret tun muss um die ursprüngliche Frage zu beantworten ... sorry ...

                Ro75 Homoran 2 Replies Last reply Reply Quote 0
                • Ro75
                  Ro75 @RaspiUser last edited by

                  @raspiuser wie @paul53 es geschrieben hat:

                  JSON.parse(val)[''].Total_in
                  
                  1 Reply Last reply Reply Quote 1
                  • RaspiUser
                    RaspiUser last edited by

                    Sorry ... ich Trottel habe (wahrscheinlich durch die Suche und das schwüle Wetter geschwächt ...) die "Gänsefüßchen" nicht als ' erkannt ...

                    Vielen Dank für den A...tritt ...

                    🤕

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

                      @raspiuser sagte in [gelöst] Alias Datenpunkt ... JSON parsen:

                      ... jetzt wird die "leere Eigenschaft" anders dargestellt,

                      und das ist die Struktur
                      in der obersten Ebene befindet sich Time und ein weiteres Json ohne Bezeichnung [''], darin dann u.a total_in und das ganze durch den Punkt . getrennt ergibt

                      @ro75 sagte in [gelöst] Alias Datenpunkt ... JSON parsen:

                      JSON.parse(val)[''].Total_in

                      1 Reply Last reply Reply Quote 0
                      • paul53
                        paul53 @RaspiUser last edited by

                        @raspiuser sagte: Diesen MQTT Ausdruck ...

                        Welche Software erzeugt solche eigentlich unzulässigen JSON?

                        RaspiUser 1 Reply Last reply Reply Quote 0
                        • RaspiUser
                          RaspiUser @paul53 last edited by

                          @paul53 said in [gelöst] Alias Datenpunkt ... JSON parsen:

                          Welche Software erzeugt solche eigentlich unzulässigen JSON?

                          TASMOTA Stromzähler ...

                          >D
                          >B
                          =>sensor53 r
                          >M 1
                          +1,14,s,0,9600
                          1,77070100010800ff@1000,Netzbezug-Summe,kWh,Total_in,2
                          1,77070100020800ff@1000,Einspeisung-Summe,kWh,Total_out,2
                          1,77070100100700ff@1,Verbrauch-Momentan,W,Power_curr,0
                          #
                          
                          T 1 Reply Last reply Reply Quote 0
                          • T
                            TT-Tom @RaspiUser last edited by

                            @raspiuser

                            Schreibe +1,14,s,0,9600,Strom
                            Dann hast du kein leeres Topic

                            Im Alias muss dann JSON.parse(val)Strom.Total_in stehen

                            paul53 1 Reply Last reply Reply Quote 0
                            • paul53
                              paul53 @TT-Tom last edited by

                              @tt-tom sagte: Im Alias muss dann JSON.parse(val)Strom.Total_in stehen

                              JSON.parse(val).Strom.Total_in
                              
                              1 Reply Last reply Reply Quote 1
                              • RaspiUser
                                RaspiUser last edited by

                                @TT-Tom
                                ... aber dann steht in jeder Zeile auch "Strom" ... und ich möchte da in der WebUI nix stehen haben ...
                                Die Lösung mit der "Leerstelle" ist mir da lieber. 🙄

                                @paul53
                                ... der "." macht den Unterschied ... 😉

                                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

                                862
                                Online

                                32.1k
                                Users

                                80.7k
                                Topics

                                1.3m
                                Posts

                                5
                                14
                                567
                                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