Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. systeminfo Adapter - wie xml richtig filtern

    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

    systeminfo Adapter - wie xml richtig filtern

    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      ing-michel last edited by ing-michel

      Hallo zusammen. Ich breche mir gerade einen ab, die Niederschlagsvorhersage aus OpenWeatherMap auszulesen. Das JSON liefert diese Daten nicht mehr.

      mein Wunsch: ich möchte Datenpunkte mit dem Wert "date" aus <time> und "Value" aus <precipitation> anlegen

      erstes Beispiel
      Datenpunkt "2021-05-05" mit dem Wert"10.23"

      <weatherdata><forecast>< time day="2021-05-05"><precipitation value="10.23">

      Habe nun den Namen mit "OWM_rain.[time/precipitation]" angelegt
      und den Filter mit "forecast[?(@.time,@.value)]"

      Ich checke aber nicht, wie es richtig heißen muss.

      Kann mir da jemand helfen?
      Danke und liebe Grüße
      Michel

      Bildschirmfoto 2021-05-05 um 14.21.20.png

      <weatherdata>
      <location>
      <name>xxxx</name>
      <type/>
      <country>DE</country>
      <timezone>7200</timezone>
      <credit/>
      <meta>
      <lastupdate/>
      <calctime>0</calctime>
      <nextupdate/>
      </meta>
      <sun rise="2021-05-05T03:37:05" set="2021-05-05T19:03:48"/>
      <forecast>
      <time day="2021-05-05">
      <sun rise="2021-05-05T03:37:05" set="2021-05-05T19:03:48"/>
      <symbol number="501" name="moderate rain" var="10d"/>
      <precipitation probability="1" value="10.23" type="rain"/>
      <windDirection deg="244" code="WSW" name="West-southwest"/>
      <windSpeed mps="12.81" unit="m/s" name="Strong breeze"/>
      <windGust gust="17.8" unit="m/s"/>
      <temperature day="6" min="5.4" max="6.92" night="5.4" eve="5.92" morn="6.7" unit="celsius"/>
      <feels_like day="0.44" night="2.18" eve="0.61" morn="2.18" unit="celsius"/>
      <pressure unit="hPa" value="990"/>
      <humidity value="89" unit="%"/>
      <clouds value="broken clouds" all="80" unit="%"/>
      </time>
      <time day="2021-05-06">
      <sun rise="2021-05-06T03:35:05" set="2021-05-06T19:05:40"/>
      <symbol number="500" name="light rain" var="10d"/>
      <precipitation probability="0.99" value="5.12" type="rain"/>
      <windDirection deg="279" code="W" name="West"/>
      <windSpeed mps="12.52" unit="m/s" name="Strong breeze"/>
      <windGust gust="17.42" unit="m/s"/>
      <temperature day="6.89" min="2.45" max="8.4" night="2.45" eve="7.43" morn="5.95" unit="celsius"/>
      <feels_like day="2.35" night="1.02" eve="4.12" morn="1.02" unit="celsius"/>
      <pressure unit="hPa" value="1004"/>
      <humidity value="81" unit="%"/>
      <clouds value="overcast clouds" all="100" unit="%"/>
      </time>
      <time day="2021-05-07">
      <sun rise="2021-05-07T03:33:08" set="2021-05-07T19:07:31"/>
      <symbol number="500" name="light rain" var="10d"/>
      <precipitation probability="0.93" value="5.18" type="rain"/>
      <windDirection deg="281" code="W" name="West"/>
      <windSpeed mps="6.9" unit="m/s" name="Moderate breeze"/>
      <windGust gust="9.87" unit="m/s"/>
      <temperature day="7.54" min="1.71" max="8.59" night="5.68" eve="7.08" morn="4.06" unit="celsius"/>
      <feels_like day="4.27" night="1.84" eve="3.6" morn="1.84" unit="celsius"/>
      <pressure unit="hPa" value="1008"/>
      <humidity value="74" unit="%"/>
      <clouds value="overcast clouds" all="100" unit="%"/>
      
      1 Reply Last reply Reply Quote 0
      • TheBam
        TheBam last edited by

        @ing-michel

        Wandel das XML erst mal in ein JSON um. Gibt ein sehr tolles packed das nutze ich auch xml2json danach kannst es einfach als json auslesen

        I 1 Reply Last reply Reply Quote 0
        • I
          ing-michel @TheBam last edited by

          @thebam Hi, danke für Deine Rückmeldung.

          In den Adaptern finde ich xml2json nicht. Wie kann ich das installieren?

          TheBam 1 Reply Last reply Reply Quote 0
          • TheBam
            TheBam @ing-michel last edited by

            @ing-michel

            Im JavaScript Adapter kannst du packete installieren wenn du auf den Schraubenschlüssel klickst.

            Dieses Modul meine ich : https://www.npmjs.com/package/xml2json

            Da ist auch ein Beispiel dabei in dem Link wie du es dann im JS Code verwendest

            I 1 Reply Last reply Reply Quote 0
            • I
              ing-michel @TheBam last edited by

              @thebam Danke Dir!

              R 1 Reply Last reply Reply Quote 0
              • R
                rvbrocken @ing-michel last edited by rvbrocken

                @ing-michel
                Hallo,
                das sollte hier nicht hin.

                I 1 Reply Last reply Reply Quote 0
                • I
                  ing-michel @rvbrocken last edited by

                  @rvbrocken Was meinst Du genau?

                  R 1 Reply Last reply Reply Quote 0
                  • R
                    rvbrocken @ing-michel last edited by

                    @ing-michel
                    Hallo,

                    ich bin einen Schritt weiter. D.h. Mein "Allnet" kann doch JSON. Ist also kein XML Thema mehr.

                    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

                    930
                    Online

                    31.9k
                    Users

                    80.1k
                    Topics

                    1.3m
                    Posts

                    3
                    8
                    478
                    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