Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [gelöst] Datenpunkte aus json erstellen

    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] Datenpunkte aus json erstellen

    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Klaus 0 @mickym last edited by

      @mickym
      Danke für den Tip,

      hab aber mal mir den Link kurz angeschaut und gedacht ich bleibe lieber bei Blockly 🙂
      Bis ich damit was anfangen kann und das kapiert habe wird wahrscheinlich das Beamen schon erfunden ein:))

      LG
      Klaus

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

        @klaus-0 sagte in Datenpunkte aus json erstellen:

        Wie sehe das als Beispiel mit Blockly denn aus? Am liebsten wäre es mir wenn ich
        da dann unter Objekte die passenden Datenpunkte hätte.

        Da die notwendigen Informationen fehlen, hier mal allgemein:
        Screenshot_20240525-175921_Firefox.jpg

        OBJECT ID mit deinem Datenpunkt ersetzen und JSON mit dem JSON, bzw. dort ein Block WERT von ObjectID hin mit Referenz auf den Datenpunkt mit dem JSON

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

          @homoran Screenshot 2024-05-25 203816.png

          dann sieht das so aus. Weiß aber auch nicht was du mit Block WERT meinst. Bin halt noch nicht so in dem Thema.

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

            @klaus-0 sagte in Datenpunkte aus json erstellen:

            dann sieht das so aus.

            du musst dir erst einmal das Json holen.
            ich dachte das liegt in einem Datenpunkt.

            Da würdest du es mit
            Screenshot_20240525-205313_Firefox.jpg
            herausholen.

            Wenn du das JSON direkt frisch abholen willst, müsstest du es mit dem neuen httpGet Baustein machen

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

              @homoran
              Habe mich jetzt mal mit dem httpGet Baustein beschäftigt.

              Aber als Anfänger ist das mir irgendwie zu hoch. Bekomme das nicht hin. Kommt immer die Fehlermeldung.
              Screenshot 2024-05-27 164811.png

              Homoran paul53 2 Replies Last reply Reply Quote 0
              • Homoran
                Homoran Global Moderator Administrators @Klaus 0 last edited by

                @klaus-0 sagte in Datenpunkte aus json erstellen:

                @homoran
                Habe mich jetzt mal mit dem httpGet Baustein beschäftigt.

                Aber als Anfänger ist das mir irgendwie zu hoch. Bekomme das nicht hin. Kommt immer die Fehlermeldung.
                Screenshot 2024-05-27 164811.png

                vom objekt Data
                den block gibt es unter dem httpGet Block

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

                  @klaus-0

                  Blockly_temp.JPG

                  metaxa K 2 Replies Last reply Reply Quote 0
                  • metaxa
                    metaxa @paul53 last edited by

                    @paul53 Ich versuche gerade Ähnliches, bekomme aber die Fehlermeldung "undefined"

                    2c686dce-a3bc-40ff-9e70-4b41c6b07b2e-image.png

                    javascript.0	21:50:59.113	info	Stopping script script.js.common.800-850_Energie.840_Spritpreise_updaten
                    javascript.0	21:50:59.161	info	Start JavaScript script.js.common.800-850_Energie.840_Spritpreise_updaten (Blockly)
                    javascript.0	21:50:59.170	info	script.js.common.800-850_Energie.840_Spritpreise_updaten: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
                    javascript.1	21:50:59.335	info	Stop script script.js.common.800-850_Energie.840_Spritpreise_updaten
                    javascript.0	21:50:59.492	info	script.js.common.800-850_Energie.840_Spritpreise_updaten: undefined
                    

                    Die geholten Daten schauen so aus:

                    [
                      {
                        "id": 33395,
                        "name": "SOCAR Perchtoldsdorf",
                        "location": {
                          "address": "Ketzergasse 191a",
                          "postalCode": "2380",
                          "city": "Perchtoldsdorf",
                          "latitude": 48.1301731,
                          "longitude": 16.2919418
                        },
                        "contact": {
                          "telephone": "4318674570",
                          "fax": "4318674804",
                          "mail": "office-at@socarenergy.com",
                          "website": "https://www.socarenergy.at/"
                        },
                        "openingHours": [
                          {
                            "day": "MO",
                            "label": "Montag",
                            "order": 1,
                            "from": "00:00",
                            "to": "24:00"
                          },
                          {
                            "day": "DI",
                            "label": "Dienstag",
                            "order": 2,
                            "from": "00:00",
                            "to": "24:00"
                          },
                          {
                            "day": "MI",
                            "label": "Mittwoch",
                            "order": 3,
                            "from": "00:00",
                            "to": "24:00"
                          },
                          {
                            "day": "DO",
                            "label": "Donnerstag",
                            "order": 4,
                            "from": "00:00",
                            "to": "24:00"
                          },
                          {
                            "day": "FR",
                            "label": "Freitag",
                            "order": 5,
                            "from": "00:00",
                            "to": "24:00"
                          },
                          {
                            "day": "SA",
                            "label": "Samstag",
                            "order": 6,
                            "from": "00:00",
                            "to": "24:00"
                          },
                          {
                            "day": "SO",
                            "label": "Sonntag",
                            "order": 7,
                            "from": "00:00",
                            "to": "24:00"
                          },
                          {
                            "day": "FE",
                            "label": "Feiertag",
                            "order": 8,
                            "from": "00:00",
                            "to": "24:00"
                          }
                        ],
                        "offerInformation": {
                          "service": false,
                          "selfService": true,
                          "unattended": true
                        },
                        "paymentMethods": {
                          "cash": true,
                          "debitCard": true,
                          "creditCard": true,
                          "others": "UTA, DKV, Socarcard"
                        },
                        "paymentArrangements": {
                          "cooperative": false,
                          "clubCard": false
                        },
                        "position": 1,
                        "open": true,
                        "distance": 4.24828720258133,
                        "prices": [
                          {
                            "fuelType": "DIE",
                            "amount": 1.554,
                            "label": "Diesel"
                          }
                        ]
                      },
                      {
                        "id": 7812,
                        "name": "Vivod",
                    ...........
                    

                    Kannst du mir da event. bitte helfen?

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

                      @metaxa sagte: Daten schauen so aus:

                      Das ist ein Array --> Attribut "0.name".

                      metaxa 1 Reply Last reply Reply Quote 2
                      • K
                        Klaus 0 @paul53 last edited by

                        @paul53 Danke für die schnelle Anwort. Jetzt kommen die Fehlermeldungen. Screenshot 2024-05-27 220424.png

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

                          @klaus-0
                          In Data wird offenbar null geliefert. Debugge mal den Status code

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

                            @paul53 sagte in Datenpunkte aus json erstellen:

                            Das ist ein Array

                            Herzlichen Dank! somit ist mir auch klar wie ich an die weiteren Einträge komme (1.name, 2.name....)

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

                              @paul53 Ist dann auch das gleiche Problem. muss ich vielleicht erst Irgendwas Parsen oder so?Screenshot 2024-05-27 221527.png

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

                                @klaus-0 sagte: Ist dann auch das gleiche Problem.

                                Den Status code ohne "Attribut" debuggen. Er enthält normalerweise eine Zahl (200 bei Erfolg).
                                Die URL stimmt? Im Web-Browser kommt das JSON mit dieser URL?

                                K 2 Replies Last reply Reply Quote 0
                                • K
                                  Klaus 0 @paul53 last edited by

                                  @paul53 Im Web-Browser sieht das so aus
                                  Screenshot 2024-05-27 222231.png

                                  Beim Status code ohne Attribut kommt das
                                  Screenshot 2024-05-27 222321.png

                                  paul53 Homoran 2 Replies Last reply Reply Quote 0
                                  • paul53
                                    paul53 @Klaus 0 last edited by

                                    @klaus-0
                                    Mit der Fehlermeldung kann ich nichts anfangen. Da muss ein ITler ran.
                                    Hast Du es mal mit dem request-Block (und der Variablen result) versucht?

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

                                      @paul53
                                      hi Paul,

                                      das ist die Wetterstation die ich abfrage.

                                      https://www.jbmedia.eu/faq/wetterstation

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

                                        @klaus-0 sagte: das ist die Wetterstation die ich abfrage.

                                        Der Browser liefert das JSON, aber offenbar der httpGet-Block nicht. Keine Ahnung - weshalb.

                                        K Homoran 2 Replies Last reply Reply Quote 0
                                        • K
                                          Klaus 0 @paul53 last edited by

                                          @paul53 habe das jetzt mal so ausprobiert. dann kommt wenigstens keine Fehlermeldung. Bin ich da auf dem richtigen Weg?
                                          Screenshot 2024-05-27 223549.png

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

                                            @paul53 sagte in Datenpunkte aus json erstellen:

                                            aber offenbar der httpGet-Block nicht.

                                            wenn du das json willst, nicht status code, sonden data nehmen.
                                            und zum testen mal das timeout erhöhen

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            811
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            7
                                            88
                                            5423
                                            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