Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. JavaScript
  5. [gelöst] Problem: Abruf von Strompreisen mit JS und Axios

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.7k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    2.2k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    16
    1
    3.2k

[gelöst] Problem: Abruf von Strompreisen mit JS und Axios

Geplant Angeheftet Gesperrt Verschoben JavaScript
16 Beiträge 3 Kommentatoren 876 Aufrufe 2 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • JohGreJ JohGre

    Instanz ist angelegt?
    URL: https://api.awattar.at/v1/marketdata eingetragen. Sonst kann man eh nicht viel konfigurieren

    fuzzy1955F Online
    fuzzy1955F Online
    fuzzy1955
    schrieb am zuletzt editiert von
    #6

    @johgre sagte in Problem: Abruf von Strompreisen mit JS und Axios:

    URL: https://api.awattar.at/v1/marketdata eingetragen

    Ja, habe ich gemacht.
    Clipboard02.jpg

    Raspberry PI5 mit Linux Debian 13 (Trixie), IoBroker v7.7.2, VIS-2, MariaDB (MySQL)
    mehrere Shellies Plus xx, Modbus: Waveshare Relay 8 Channels, Waveshare RS485-TO-ETH , Smartmeter ET340.
    PV: 10 kWp Module, 2 x Deye WR SUN-10K, 2 x 10 kWh MeritSun LiFe Speicher, KEBA P30 Wallbox, Fronius Wattpilot home 11

    1 Antwort Letzte Antwort
    0
    • JohGreJ Offline
      JohGreJ Offline
      JohGre
      schrieb am zuletzt editiert von
      #7

      aa2b0d7d-d6b6-41c1-980d-aa841bf55e49-image.png
      Der aWattar Adapter holt nur einmal am Tag die Daten, bei mir um 14:55 Uhr. Was hast du da konfiguriert

      nuc i5: RaspberryMatic, ioBroker, pi-hole, SQL-Server, OMV-NAS, Influx-DB & Grafana, OpenHab, tasmoadmin

      fuzzy1955F 1 Antwort Letzte Antwort
      0
      • arteckA arteck

        @fuzzy1955 schau doch mal was du im response bekommst

        console.warn(JSON.stringify(response));
        

        in die zeile 12

        fuzzy1955F Online
        fuzzy1955F Online
        fuzzy1955
        schrieb am zuletzt editiert von
        #8

        @arteck sagte in Problem: Abruf von Strompreisen mit JS und Axios:

        in die zeile 12

        Fehler beim Abrufen des Strompreises: Converting circular structure to JSON
            --> starting at object with constructor 'ClientRequest'
            |     property 'res' -> object with constructor 'IncomingMessage'
            --- property 'req' closes the circle
        

        Raspberry PI5 mit Linux Debian 13 (Trixie), IoBroker v7.7.2, VIS-2, MariaDB (MySQL)
        mehrere Shellies Plus xx, Modbus: Waveshare Relay 8 Channels, Waveshare RS485-TO-ETH , Smartmeter ET340.
        PV: 10 kWp Module, 2 x Deye WR SUN-10K, 2 x 10 kWh MeritSun LiFe Speicher, KEBA P30 Wallbox, Fronius Wattpilot home 11

        arteckA 1 Antwort Letzte Antwort
        0
        • fuzzy1955F fuzzy1955

          @arteck sagte in Problem: Abruf von Strompreisen mit JS und Axios:

          in die zeile 12

          Fehler beim Abrufen des Strompreises: Converting circular structure to JSON
              --> starting at object with constructor 'ClientRequest'
              |     property 'res' -> object with constructor 'IncomingMessage'
              --- property 'req' closes the circle
          
          arteckA Offline
          arteckA Offline
          arteck
          Developer Most Active
          schrieb am zuletzt editiert von
          #9

          @fuzzy1955 sagte in Problem: Abruf von Strompreisen mit JS und Axios:

          Converting circular structure to JSON

          da hst du es ja..

          zigbee hab ich, zwave auch, nuc's genauso und HA auch

          fuzzy1955F 1 Antwort Letzte Antwort
          0
          • arteckA arteck

            @fuzzy1955 sagte in Problem: Abruf von Strompreisen mit JS und Axios:

            Converting circular structure to JSON

            da hst du es ja..

            fuzzy1955F Online
            fuzzy1955F Online
            fuzzy1955
            schrieb am zuletzt editiert von
            #10

            @arteck sagte in Problem: Abruf von Strompreisen mit JS und Axios:

            da hst du es ja..

            Ja, aber ich weiß dazu keine Lösung. Kannst du mir weiterhelfen?

            Raspberry PI5 mit Linux Debian 13 (Trixie), IoBroker v7.7.2, VIS-2, MariaDB (MySQL)
            mehrere Shellies Plus xx, Modbus: Waveshare Relay 8 Channels, Waveshare RS485-TO-ETH , Smartmeter ET340.
            PV: 10 kWp Module, 2 x Deye WR SUN-10K, 2 x 10 kWh MeritSun LiFe Speicher, KEBA P30 Wallbox, Fronius Wattpilot home 11

            1 Antwort Letzte Antwort
            0
            • JohGreJ JohGre

              aa2b0d7d-d6b6-41c1-980d-aa841bf55e49-image.png
              Der aWattar Adapter holt nur einmal am Tag die Daten, bei mir um 14:55 Uhr. Was hast du da konfiguriert

              fuzzy1955F Online
              fuzzy1955F Online
              fuzzy1955
              schrieb am zuletzt editiert von
              #11

              @johgre sagte in Problem: Abruf von Strompreisen mit JS und Axios:

              Der aWattar Adapter holt nur einmal am Tag die Daten, bei mir um 14:55 Uhr.

              Aah... jetzt fällt es mir wieder ein. Ich fand es zu mühsam, die Daten aus 24 Stundenverzeichnissen rauszuklauben. Darum bin ich auf die Version mit JS gekommen.

              Raspberry PI5 mit Linux Debian 13 (Trixie), IoBroker v7.7.2, VIS-2, MariaDB (MySQL)
              mehrere Shellies Plus xx, Modbus: Waveshare Relay 8 Channels, Waveshare RS485-TO-ETH , Smartmeter ET340.
              PV: 10 kWp Module, 2 x Deye WR SUN-10K, 2 x 10 kWh MeritSun LiFe Speicher, KEBA P30 Wallbox, Fronius Wattpilot home 11

              1 Antwort Letzte Antwort
              0
              • arteckA Offline
                arteckA Offline
                arteck
                Developer Most Active
                schrieb am zuletzt editiert von
                #12

                @fuzzy1955 sagte in Problem: Abruf von Strompreisen mit JS und Axios:

                @arteck sagte in Problem: Abruf von Strompreisen mit JS und Axios:

                da hst du es ja..

                Ja, aber ich weiß dazu keine Lösung. Kannst du mir weiterhelfen?

                ja wird aber nach 12 uhr

                zigbee hab ich, zwave auch, nuc's genauso und HA auch

                fuzzy1955F 1 Antwort Letzte Antwort
                0
                • JohGreJ Offline
                  JohGreJ Offline
                  JohGre
                  schrieb am zuletzt editiert von
                  #13

                  Habe mal ChatGPT bemüht.

                  async function fetchPowerData() {
                      try {
                          const response = await axios.get(apiUrl);
                          const powerData = response.data;
                          
                          console.log("Strompreisdaten: " + JSON.stringify(powerData.data));
                          const dataArray = powerData.data;
                              dataArray.forEach(entry => {
                                  const isoDate = entry.date;
                                  const value = entry.value;
                                  const date = new Date(isoDate);
                                  const localTime = date.toLocaleString();
                  
                                  console.log(`Original: ${isoDate} => Lokal: ${localTime} | Wert: ${value}`);
                  
                              });
                   
                      } catch (e) {
                          console.error("Fehler beim Abrufen des Strompreises: " + e.message);
                      }
                  }
                  

                  Das iteriert jetzt durch das ResponseArray und schreibt alle Werte mal raus.

                  nuc i5: RaspberryMatic, ioBroker, pi-hole, SQL-Server, OMV-NAS, Influx-DB & Grafana, OpenHab, tasmoadmin

                  fuzzy1955F 2 Antworten Letzte Antwort
                  2
                  • arteckA arteck

                    @fuzzy1955 sagte in Problem: Abruf von Strompreisen mit JS und Axios:

                    @arteck sagte in Problem: Abruf von Strompreisen mit JS und Axios:

                    da hst du es ja..

                    Ja, aber ich weiß dazu keine Lösung. Kannst du mir weiterhelfen?

                    ja wird aber nach 12 uhr

                    fuzzy1955F Online
                    fuzzy1955F Online
                    fuzzy1955
                    schrieb am zuletzt editiert von
                    #14

                    @arteck sagte in Problem: Abruf von Strompreisen mit JS und Axios:

                    ja wird aber nach 12 uhr

                    Danke, bei mir wird es eher 20 Uhr.

                    Raspberry PI5 mit Linux Debian 13 (Trixie), IoBroker v7.7.2, VIS-2, MariaDB (MySQL)
                    mehrere Shellies Plus xx, Modbus: Waveshare Relay 8 Channels, Waveshare RS485-TO-ETH , Smartmeter ET340.
                    PV: 10 kWp Module, 2 x Deye WR SUN-10K, 2 x 10 kWh MeritSun LiFe Speicher, KEBA P30 Wallbox, Fronius Wattpilot home 11

                    1 Antwort Letzte Antwort
                    0
                    • JohGreJ JohGre

                      Habe mal ChatGPT bemüht.

                      async function fetchPowerData() {
                          try {
                              const response = await axios.get(apiUrl);
                              const powerData = response.data;
                              
                              console.log("Strompreisdaten: " + JSON.stringify(powerData.data));
                              const dataArray = powerData.data;
                                  dataArray.forEach(entry => {
                                      const isoDate = entry.date;
                                      const value = entry.value;
                                      const date = new Date(isoDate);
                                      const localTime = date.toLocaleString();
                      
                                      console.log(`Original: ${isoDate} => Lokal: ${localTime} | Wert: ${value}`);
                      
                                  });
                       
                          } catch (e) {
                              console.error("Fehler beim Abrufen des Strompreises: " + e.message);
                          }
                      }
                      

                      Das iteriert jetzt durch das ResponseArray und schreibt alle Werte mal raus.

                      fuzzy1955F Online
                      fuzzy1955F Online
                      fuzzy1955
                      schrieb am zuletzt editiert von
                      #15

                      @johgre sagte in Problem: Abruf von Strompreisen mit JS und Axios:

                      Das iteriert jetzt durch das ResponseArray und schreibt alle Werte mal raus

                      Aaah .... danke! Das hilft mir sehr weiter!

                      Raspberry PI5 mit Linux Debian 13 (Trixie), IoBroker v7.7.2, VIS-2, MariaDB (MySQL)
                      mehrere Shellies Plus xx, Modbus: Waveshare Relay 8 Channels, Waveshare RS485-TO-ETH , Smartmeter ET340.
                      PV: 10 kWp Module, 2 x Deye WR SUN-10K, 2 x 10 kWh MeritSun LiFe Speicher, KEBA P30 Wallbox, Fronius Wattpilot home 11

                      1 Antwort Letzte Antwort
                      0
                      • JohGreJ JohGre

                        Habe mal ChatGPT bemüht.

                        async function fetchPowerData() {
                            try {
                                const response = await axios.get(apiUrl);
                                const powerData = response.data;
                                
                                console.log("Strompreisdaten: " + JSON.stringify(powerData.data));
                                const dataArray = powerData.data;
                                    dataArray.forEach(entry => {
                                        const isoDate = entry.date;
                                        const value = entry.value;
                                        const date = new Date(isoDate);
                                        const localTime = date.toLocaleString();
                        
                                        console.log(`Original: ${isoDate} => Lokal: ${localTime} | Wert: ${value}`);
                        
                                    });
                         
                            } catch (e) {
                                console.error("Fehler beim Abrufen des Strompreises: " + e.message);
                            }
                        }
                        

                        Das iteriert jetzt durch das ResponseArray und schreibt alle Werte mal raus.

                        fuzzy1955F Online
                        fuzzy1955F Online
                        fuzzy1955
                        schrieb am zuletzt editiert von
                        #16

                        @johgre sagte in [gelöst] Problem: Abruf von Strompreisen mit JS und Axios:

                        Das iteriert jetzt durch das ResponseArray und schreibt alle Werte mal raus.

                        Danke nochmals! Das ResponseArray läuft super! Genau das brauchte ich :blush:

                        Raspberry PI5 mit Linux Debian 13 (Trixie), IoBroker v7.7.2, VIS-2, MariaDB (MySQL)
                        mehrere Shellies Plus xx, Modbus: Waveshare Relay 8 Channels, Waveshare RS485-TO-ETH , Smartmeter ET340.
                        PV: 10 kWp Module, 2 x Deye WR SUN-10K, 2 x 10 kWh MeritSun LiFe Speicher, KEBA P30 Wallbox, Fronius Wattpilot home 11

                        1 Antwort Letzte Antwort
                        1
                        Antworten
                        • In einem neuen Thema antworten
                        Anmelden zum Antworten
                        • Älteste zuerst
                        • Neuste zuerst
                        • Meiste Stimmen


                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        862

                        Online

                        32.4k

                        Benutzer

                        81.5k

                        Themen

                        1.3m

                        Beiträge
                        Community
                        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                        ioBroker Community 2014-2025
                        logo
                        • Anmelden

                        • Du hast noch kein Konto? Registrieren

                        • Anmelden oder registrieren, um zu suchen
                        • Erster Beitrag
                          Letzter Beitrag
                        0
                        • Home
                        • Aktuell
                        • Tags
                        • Ungelesen 0
                        • Kategorien
                        • Unreplied
                        • Beliebt
                        • GitHub
                        • Docu
                        • Hilfe