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. Funktion zum Seitenabruf per Get funktioniert nicht mehr

NEWS

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    22
    1
    1.2k

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

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    14
    1
    2.5k

Funktion zum Seitenabruf per Get funktioniert nicht mehr

Geplant Angeheftet Gesperrt Verschoben Skripten / Logik
10 Beiträge 5 Kommentatoren 725 Aufrufe 5 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.
  • M Offline
    M Offline
    MP_Trixi
    schrieb am zuletzt editiert von
    #1

    Hallo,
    hatte hier im Forum mal eine Methode gefunden, mit der man Längen-/Breitengrade in eine "Klartext"-Adresse umwandeln konnte. Dies hat auch zuverlässig funktioniert. Nun bekomme ich folgenden Fehler:

    script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten: ReferenceError: request is not defined at script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2491:13 at new Promise (<anonymous>) at reqAsync (script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2481:16) at OSM_Reverse (script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2501:24) at script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2527:16 at script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2549:3 at Script.runInContext (node:vm:148:12) at Script.runInNewContext (node:vm:153:17) at execute (/opt/iobroker/node_modules/iobroker.javascript/main.js:1979:23) at prepareScript (/opt/iobroker/node_modules/iobroker.javascript/main.js:2228:13)
    

    Ich habe ein NPM Update durchgeführt - kann es daran liegen? Das Blockly dazu sieht so aus:

    <block xmlns="https://developers.google.com/blockly/xml" type="variables_set" id="wR~~7^?!0{b~ZWJW2z2Y" x="57" y="17">
      <field name="VAR" id="2]3hGy$Na|L2qX#+=;E8">lat</field>
      <value name="VALUE">
        <block type="convert_tonumber" id="hWzOOf8;.`B+Z9M:!wuy">
          <value name="VALUE">
            <block type="text_replace" id="iq$PAJMO5dQeXWkN:]f1">
              <value name="FROM">
                <shadow type="text" id="skgW?L6sL,jkQD*MQ^=,">
                  <field name="TEXT">,</field>
                </shadow>
              </value>
              <value name="TO">
                <shadow type="text" id="f|IG4zBx+b#B_Hl,BmB~">
                  <field name="TEXT">.</field>
                </shadow>
              </value>
              <value name="TEXT">
                <shadow type="text" id="LK6OfG42WP@L^,K!cJlO">
                  <field name="TEXT">text</field>
                </shadow>
                <block type="convert_tostring" id="O$]q.ry,tjC;).lNA.Zc">
                  <value name="VALUE">
                    <block type="get_value" id="(^S9Up?34JmWvIN[g:zP">
                      <field name="ATTR">val</field>
                      <field name="OID">alias.0.Fahrzeuge.VW_eGolf_MP96E.POSITION_BREITENGRAD</field>
                    </block>
                  </value>
                </block>
              </value>
            </block>
          </value>
        </block>
      </value>
      <next>
        <block type="debug" id="Mj})kCg^fazvUa.?[@N!">
          <field name="Severity">info</field>
          <value name="TEXT">
            <shadow type="text" id="%VvnK$gGYiUTOds]h/KE">
              <field name="TEXT">test</field>
            </shadow>
            <block type="variables_get" id="5}*nVoDiWWaX^^e,vd,E">
              <field name="VAR" id="2]3hGy$Na|L2qX#+=;E8">lat</field>
            </block>
          </value>
          <next>
            <block type="variables_set" id="|i,e7-xsVZtwL,YE9Pns">
              <field name="VAR" id=".hv$JjjT(QY(0c2!/tuc">lon</field>
              <value name="VALUE">
                <block type="convert_tonumber" id="zdJ=q9d8[uma}!QaRdR`">
                  <value name="VALUE">
                    <block type="text_replace" id="1r;?,i(:@$$@}X:Dv,$j">
                      <value name="FROM">
                        <shadow type="text" id=",33EQg[hFkLIGnA5BkCi">
                          <field name="TEXT">,</field>
                        </shadow>
                      </value>
                      <value name="TO">
                        <shadow type="text" id="?JpAIBzxRE{og!G7%t6s">
                          <field name="TEXT">.</field>
                        </shadow>
                      </value>
                      <value name="TEXT">
                        <shadow type="text" id="LK6OfG42WP@L^,K!cJlO">
                          <field name="TEXT">text</field>
                        </shadow>
                        <block type="convert_tostring" id="srs+,w3bMkJO$su2JuSd">
                          <value name="VALUE">
                            <block type="get_value" id="SV4g.3=xJ~~crtmE9*=4">
                              <field name="ATTR">val</field>
                              <field name="OID">alias.0.Fahrzeuge.VW_eGolf_MP96E.POSITION_LAENGENGRAD</field>
                            </block>
                          </value>
                        </block>
                      </value>
                    </block>
                  </value>
                </block>
              </value>
              <next>
                <block type="debug" id="CO,[BAbspFgPnMa37]c^">
                  <field name="Severity">info</field>
                  <value name="TEXT">
                    <shadow type="text" id="%VvnK$gGYiUTOds]h/KE">
                      <field name="TEXT">test</field>
                    </shadow>
                    <block type="variables_get" id="f*X{XjU:U3=yy5[8bVl1">
                      <field name="VAR" id=".hv$JjjT(QY(0c2!/tuc">lon</field>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id="gV3k#TgOw[TwD3PggX_z">
                      <field name="VAR" id="J3x^9.8?y5q~@YX!.0vq">zoom</field>
                      <value name="VALUE">
                        <block type="math_number" id="RiaGr]H5DPjOiCLI$~+H">
                          <field name="NUM">18</field>
                        </block>
                      </value>
                      <next>
                        <block type="variables_set" id="_]-UxYH%D~}#l6DWPyqA">
                          <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                          <value name="VALUE">
                            <block type="procedures_callcustomreturn" id="E6q6k3RA-DSW4n:wbmt5" inline="true">
                              <mutation name="OSM_Reverse">
                                <arg name="lat"></arg>
                                <arg name="lon"></arg>
                                <arg name="zoom"></arg>
                              </mutation>
                              <value name="ARG0">
                                <block type="variables_get" id="O~3vjlaQApGabQ#KZ_Np">
                                  <field name="VAR" id="2]3hGy$Na|L2qX#+=;E8">lat</field>
                                </block>
                              </value>
                              <value name="ARG1">
                                <block type="variables_get" id=";6In%LVgU8c~ZW=V^#!+">
                                  <field name="VAR" id=".hv$JjjT(QY(0c2!/tuc">lon</field>
                                </block>
                              </value>
                              <value name="ARG2">
                                <block type="variables_get" id="!Lp;DYb2Cg#%7WJ[ixj:">
                                  <field name="VAR" id="J3x^9.8?y5q~@YX!.0vq">zoom</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <next>
                            <block type="debug" id="=kG9Q3BHtv,N12i)o/cd" inline="true">
                              <field name="Severity">debug</field>
                              <value name="TEXT">
                                <shadow type="text" id="ik1UI0{#imdw4QxI,wuq">
                                  <field name="TEXT">test</field>
                                </shadow>
                                <block type="variables_get" id="ZJbVSK}WTjai..N)v+^}">
                                  <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                </block>
                              </value>
                              <next>
                                <block type="variables_set" id="O{z96Lp@j3i8Slita#*W">
                                  <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                  <value name="VALUE">
                                    <block type="text" id=".F~*Z,w04}/`Zb~EHIO6">
                                      <field name="TEXT"></field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="variables_set" id="39@-t*shJUx-}=TcBs72">
                                      <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                      <value name="VALUE">
                                        <block type="text" id="lCo5cXfY=#t]_-9??cvm">
                                          <field name="TEXT"></field>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="variables_set" id="Wa.e4=|kzt(4dQ2EsnIo">
                                          <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                          <value name="VALUE">
                                            <block type="text" id="0X6gVH,Zq7X)L$UxO`bK">
                                              <field name="TEXT"></field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="variables_set" id="$a!IHGzO]*0gQ)FyRs1v">
                                              <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                              <value name="VALUE">
                                                <block type="text" id="n6Q~K{?kb[4BO6$(X6rV">
                                                  <field name="TEXT"></field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="variables_set" id="z,*?N4M~aXp+cs$;LjM/">
                                                  <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                  <value name="VALUE">
                                                    <block type="text" id="(-u~=9GnJ#Sr=cgq;l@*">
                                                      <field name="TEXT"></field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id=";l(%na=dPiyRgvjT`p7J">
                                                      <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                                      <value name="VALUE">
                                                        <block type="get_attr" id="4BRp8)RL(Z,ya1V7L%,k">
                                                          <value name="PATH">
                                                            <shadow type="text" id="@+Kn.LF%vkB35cm%To%G">
                                                              <field name="TEXT">address.road</field>
                                                            </shadow>
                                                          </value>
                                                          <value name="OBJECT">
                                                            <block type="variables_get" id="/rsi@S]q*[hct$N@3[U^">
                                                              <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="variables_set" id="GF]n^bp:KR6CAP@XO@m~">
                                                          <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                                          <value name="VALUE">
                                                            <block type="get_attr" id="poO,V);aHMLGORNJUv:/">
                                                              <value name="PATH">
                                                                <shadow type="text" id="LOCBUCh^8H,AcN*N5f,)">
                                                                  <field name="TEXT">address.house_number</field>
                                                                </shadow>
                                                              </value>
                                                              <value name="OBJECT">
                                                                <block type="variables_get" id="sIO)[*}W,ats$rr:v~:X">
                                                                  <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="variables_set" id="+|Z)LBF*uHLG_;s%`TMl">
                                                              <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                                              <value name="VALUE">
                                                                <block type="get_attr" id="Pq^Bjecjs`n?o,y?!}!c">
                                                                  <value name="PATH">
                                                                    <shadow type="text" id="[6i]bv|+F1;gx@d8c.)e">
                                                                      <field name="TEXT">address.postcode</field>
                                                                    </shadow>
                                                                  </value>
                                                                  <value name="OBJECT">
                                                                    <block type="variables_get" id="jEFim1`IaNOjxazQ;n8K">
                                                                      <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="variables_set" id="$L;=BwnWkcz*c:Ja,v9A">
                                                                  <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                                                  <value name="VALUE">
                                                                    <block type="get_attr" id="bC`Q5Rr[PnjW}wgHvEBF">
                                                                      <value name="PATH">
                                                                        <shadow type="text" id="kTR_D-FK^72QX-fON74F">
                                                                          <field name="TEXT">address.town</field>
                                                                        </shadow>
                                                                      </value>
                                                                      <value name="OBJECT">
                                                                        <block type="variables_get" id="1FA1W?drJ[PO[.tc~HO)">
                                                                          <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="variables_set" id="-%#I%)w((I9lwE;_)A#%">
                                                                      <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                                      <value name="VALUE">
                                                                        <block type="text_join" id="RpLuH!Uf-MaFF~mb6h4p">
                                                                          <mutation items="2"></mutation>
                                                                          <value name="ADD0">
                                                                            <block type="text" id="}yk,46V7;kFJRO-Ip-O-">
                                                                              <field name="TEXT">-</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="ADD1">
                                                                            <block type="get_attr" id="Jhz8iS@D@-H8jo)JVk([">
                                                                              <value name="PATH">
                                                                                <shadow type="text" id="iE;/).FovyaCD.wgvjTq">
                                                                                  <field name="TEXT">address.village</field>
                                                                                </shadow>
                                                                              </value>
                                                                              <value name="OBJECT">
                                                                                <block type="variables_get" id="OZmIZS]J_Gt347jYw7dB">
                                                                                  <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="update" id="k[sWzO09~=r|YgT[3,rV">
                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                          <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresse</field>
                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                          <value name="VALUE">
                                                                            <block type="text_join" id=",m%e).l|wRoGRhe[;8zz">
                                                                              <mutation items="8"></mutation>
                                                                              <value name="ADD0">
                                                                                <block type="variables_get" id="5PrA%5d|f,*|,B|2@5gs">
                                                                                  <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="ADD1">
                                                                                <block type="text" id="/q[J]i}y=7pbi!,x]XXg">
                                                                                  <field name="TEXT"> </field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="ADD2">
                                                                                <block type="variables_get" id="4TMsfq5B00y%a5X66M(y">
                                                                                  <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="ADD3">
                                                                                <block type="text_newline" id="FSC3E3feS]Fz!Kl(-)8h">
                                                                                  <field name="Type">\n</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="ADD4">
                                                                                <block type="variables_get" id="ULW5Y`|bkW*t}gR#Y1YJ">
                                                                                  <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="ADD5">
                                                                                <block type="text" id="t}me`s,puqFxmOti@,|^">
                                                                                  <field name="TEXT"> </field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="ADD6">
                                                                                <block type="variables_get" id="l6XADM$`Pm6.lF,D{P{7">
                                                                                  <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="ADD7">
                                                                                <block type="variables_get" id="*?:kFXJb-C`f@(1iT8HY">
                                                                                  <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="update" id="VUUXD?6)(@jFTD8#RGH)">
                                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                              <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresseStrasse</field>
                                                                              <field name="WITH_DELAY">FALSE</field>
                                                                              <value name="VALUE">
                                                                                <block type="text_join" id="tSVh73})0[7gg84@K8nc">
                                                                                  <mutation items="3"></mutation>
                                                                                  <value name="ADD0">
                                                                                    <block type="variables_get" id="9]%z5BFP7t:.,jLDj}N)">
                                                                                      <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="ADD1">
                                                                                    <block type="text" id="*ko{:x9|_FBXwExl5M.M">
                                                                                      <field name="TEXT"> </field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="ADD2">
                                                                                    <block type="variables_get" id="va3.aM*gLU?5$*xh:{!@">
                                                                                      <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                              <next>
                                                                                <block type="update" id="k~(_C]sBA}gRpOnM)`ir">
                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                  <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresseOrt</field>
                                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                                  <value name="VALUE">
                                                                                    <block type="text_join" id="Ygp#T[/r|WLC+3GaHw_J">
                                                                                      <mutation items="4"></mutation>
                                                                                      <value name="ADD0">
                                                                                        <block type="variables_get" id="6;Gl%};w+YmZ!eF=#/n*">
                                                                                          <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD1">
                                                                                        <block type="text" id="*138?,sa=O9r}Nc0)K:z">
                                                                                          <field name="TEXT"> </field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD2">
                                                                                        <block type="variables_get" id="A*;egBI0mMMO?Os!Z.p|">
                                                                                          <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD3">
                                                                                        <block type="variables_get" id="n}hcIN-H_l47mmj0kZg}">
                                                                                          <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </value>
                                                                                  <next>
                                                                                    <block type="update" id="$Bvh[[ajBZW)=_VK-^_,">
                                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                      <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresseAktualisierungszeit</field>
                                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                                      <value name="VALUE">
                                                                                        <block type="time_get" id=".)CEL*sN#UjZTi]hDA?P">
                                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" format="true" language="false"></mutation>
                                                                                          <field name="OPTION">custom</field>
                                                                                          <field name="FORMAT">TT.MM.JJJJ SS:mm:ss</field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </next>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
      </next>
    </block>
    

    Die JS-Funktion, die den Fehler wohl verursacht, so:

    let result;
    function reqAsync() {
        return new Promise(function(resolve, reject){
            const options = {
                url: 'https://nominatim.openstreetmap.org/reverse.php?format=json&lat=' + lat + '&lon=' + lon + '&zoom=' + zoom,
                method: 'GET',
                headers: {
                    'Accept': 'application/json',
                    'Accept-Charset': 'utf-8',
                    'User-Agent': 'iobroker script'
                }
            }
            request(options, function(err,response,body){
                if(response.statusCode != 200) {
                    reject();
                }
                resolve(JSON.parse(body));
            })
        })
    }
    
    try {
        result = await reqAsync();
    } catch(e) {
        log(e);
        result = e;
    }
    return result;
    
    
    haus-automatisierungH CodierknechtC 2 Antworten Letzte Antwort
    0
    • M MP_Trixi

      Hallo,
      hatte hier im Forum mal eine Methode gefunden, mit der man Längen-/Breitengrade in eine "Klartext"-Adresse umwandeln konnte. Dies hat auch zuverlässig funktioniert. Nun bekomme ich folgenden Fehler:

      script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten: ReferenceError: request is not defined at script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2491:13 at new Promise (<anonymous>) at reqAsync (script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2481:16) at OSM_Reverse (script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2501:24) at script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2527:16 at script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2549:3 at Script.runInContext (node:vm:148:12) at Script.runInNewContext (node:vm:153:17) at execute (/opt/iobroker/node_modules/iobroker.javascript/main.js:1979:23) at prepareScript (/opt/iobroker/node_modules/iobroker.javascript/main.js:2228:13)
      

      Ich habe ein NPM Update durchgeführt - kann es daran liegen? Das Blockly dazu sieht so aus:

      <block xmlns="https://developers.google.com/blockly/xml" type="variables_set" id="wR~~7^?!0{b~ZWJW2z2Y" x="57" y="17">
        <field name="VAR" id="2]3hGy$Na|L2qX#+=;E8">lat</field>
        <value name="VALUE">
          <block type="convert_tonumber" id="hWzOOf8;.`B+Z9M:!wuy">
            <value name="VALUE">
              <block type="text_replace" id="iq$PAJMO5dQeXWkN:]f1">
                <value name="FROM">
                  <shadow type="text" id="skgW?L6sL,jkQD*MQ^=,">
                    <field name="TEXT">,</field>
                  </shadow>
                </value>
                <value name="TO">
                  <shadow type="text" id="f|IG4zBx+b#B_Hl,BmB~">
                    <field name="TEXT">.</field>
                  </shadow>
                </value>
                <value name="TEXT">
                  <shadow type="text" id="LK6OfG42WP@L^,K!cJlO">
                    <field name="TEXT">text</field>
                  </shadow>
                  <block type="convert_tostring" id="O$]q.ry,tjC;).lNA.Zc">
                    <value name="VALUE">
                      <block type="get_value" id="(^S9Up?34JmWvIN[g:zP">
                        <field name="ATTR">val</field>
                        <field name="OID">alias.0.Fahrzeuge.VW_eGolf_MP96E.POSITION_BREITENGRAD</field>
                      </block>
                    </value>
                  </block>
                </value>
              </block>
            </value>
          </block>
        </value>
        <next>
          <block type="debug" id="Mj})kCg^fazvUa.?[@N!">
            <field name="Severity">info</field>
            <value name="TEXT">
              <shadow type="text" id="%VvnK$gGYiUTOds]h/KE">
                <field name="TEXT">test</field>
              </shadow>
              <block type="variables_get" id="5}*nVoDiWWaX^^e,vd,E">
                <field name="VAR" id="2]3hGy$Na|L2qX#+=;E8">lat</field>
              </block>
            </value>
            <next>
              <block type="variables_set" id="|i,e7-xsVZtwL,YE9Pns">
                <field name="VAR" id=".hv$JjjT(QY(0c2!/tuc">lon</field>
                <value name="VALUE">
                  <block type="convert_tonumber" id="zdJ=q9d8[uma}!QaRdR`">
                    <value name="VALUE">
                      <block type="text_replace" id="1r;?,i(:@$$@}X:Dv,$j">
                        <value name="FROM">
                          <shadow type="text" id=",33EQg[hFkLIGnA5BkCi">
                            <field name="TEXT">,</field>
                          </shadow>
                        </value>
                        <value name="TO">
                          <shadow type="text" id="?JpAIBzxRE{og!G7%t6s">
                            <field name="TEXT">.</field>
                          </shadow>
                        </value>
                        <value name="TEXT">
                          <shadow type="text" id="LK6OfG42WP@L^,K!cJlO">
                            <field name="TEXT">text</field>
                          </shadow>
                          <block type="convert_tostring" id="srs+,w3bMkJO$su2JuSd">
                            <value name="VALUE">
                              <block type="get_value" id="SV4g.3=xJ~~crtmE9*=4">
                                <field name="ATTR">val</field>
                                <field name="OID">alias.0.Fahrzeuge.VW_eGolf_MP96E.POSITION_LAENGENGRAD</field>
                              </block>
                            </value>
                          </block>
                        </value>
                      </block>
                    </value>
                  </block>
                </value>
                <next>
                  <block type="debug" id="CO,[BAbspFgPnMa37]c^">
                    <field name="Severity">info</field>
                    <value name="TEXT">
                      <shadow type="text" id="%VvnK$gGYiUTOds]h/KE">
                        <field name="TEXT">test</field>
                      </shadow>
                      <block type="variables_get" id="f*X{XjU:U3=yy5[8bVl1">
                        <field name="VAR" id=".hv$JjjT(QY(0c2!/tuc">lon</field>
                      </block>
                    </value>
                    <next>
                      <block type="variables_set" id="gV3k#TgOw[TwD3PggX_z">
                        <field name="VAR" id="J3x^9.8?y5q~@YX!.0vq">zoom</field>
                        <value name="VALUE">
                          <block type="math_number" id="RiaGr]H5DPjOiCLI$~+H">
                            <field name="NUM">18</field>
                          </block>
                        </value>
                        <next>
                          <block type="variables_set" id="_]-UxYH%D~}#l6DWPyqA">
                            <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                            <value name="VALUE">
                              <block type="procedures_callcustomreturn" id="E6q6k3RA-DSW4n:wbmt5" inline="true">
                                <mutation name="OSM_Reverse">
                                  <arg name="lat"></arg>
                                  <arg name="lon"></arg>
                                  <arg name="zoom"></arg>
                                </mutation>
                                <value name="ARG0">
                                  <block type="variables_get" id="O~3vjlaQApGabQ#KZ_Np">
                                    <field name="VAR" id="2]3hGy$Na|L2qX#+=;E8">lat</field>
                                  </block>
                                </value>
                                <value name="ARG1">
                                  <block type="variables_get" id=";6In%LVgU8c~ZW=V^#!+">
                                    <field name="VAR" id=".hv$JjjT(QY(0c2!/tuc">lon</field>
                                  </block>
                                </value>
                                <value name="ARG2">
                                  <block type="variables_get" id="!Lp;DYb2Cg#%7WJ[ixj:">
                                    <field name="VAR" id="J3x^9.8?y5q~@YX!.0vq">zoom</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <next>
                              <block type="debug" id="=kG9Q3BHtv,N12i)o/cd" inline="true">
                                <field name="Severity">debug</field>
                                <value name="TEXT">
                                  <shadow type="text" id="ik1UI0{#imdw4QxI,wuq">
                                    <field name="TEXT">test</field>
                                  </shadow>
                                  <block type="variables_get" id="ZJbVSK}WTjai..N)v+^}">
                                    <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="variables_set" id="O{z96Lp@j3i8Slita#*W">
                                    <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                    <value name="VALUE">
                                      <block type="text" id=".F~*Z,w04}/`Zb~EHIO6">
                                        <field name="TEXT"></field>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="variables_set" id="39@-t*shJUx-}=TcBs72">
                                        <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                        <value name="VALUE">
                                          <block type="text" id="lCo5cXfY=#t]_-9??cvm">
                                            <field name="TEXT"></field>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="variables_set" id="Wa.e4=|kzt(4dQ2EsnIo">
                                            <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                            <value name="VALUE">
                                              <block type="text" id="0X6gVH,Zq7X)L$UxO`bK">
                                                <field name="TEXT"></field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="variables_set" id="$a!IHGzO]*0gQ)FyRs1v">
                                                <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                                <value name="VALUE">
                                                  <block type="text" id="n6Q~K{?kb[4BO6$(X6rV">
                                                    <field name="TEXT"></field>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="variables_set" id="z,*?N4M~aXp+cs$;LjM/">
                                                    <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                    <value name="VALUE">
                                                      <block type="text" id="(-u~=9GnJ#Sr=cgq;l@*">
                                                        <field name="TEXT"></field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="variables_set" id=";l(%na=dPiyRgvjT`p7J">
                                                        <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                                        <value name="VALUE">
                                                          <block type="get_attr" id="4BRp8)RL(Z,ya1V7L%,k">
                                                            <value name="PATH">
                                                              <shadow type="text" id="@+Kn.LF%vkB35cm%To%G">
                                                                <field name="TEXT">address.road</field>
                                                              </shadow>
                                                            </value>
                                                            <value name="OBJECT">
                                                              <block type="variables_get" id="/rsi@S]q*[hct$N@3[U^">
                                                                <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="variables_set" id="GF]n^bp:KR6CAP@XO@m~">
                                                            <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                                            <value name="VALUE">
                                                              <block type="get_attr" id="poO,V);aHMLGORNJUv:/">
                                                                <value name="PATH">
                                                                  <shadow type="text" id="LOCBUCh^8H,AcN*N5f,)">
                                                                    <field name="TEXT">address.house_number</field>
                                                                  </shadow>
                                                                </value>
                                                                <value name="OBJECT">
                                                                  <block type="variables_get" id="sIO)[*}W,ats$rr:v~:X">
                                                                    <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <next>
                                                              <block type="variables_set" id="+|Z)LBF*uHLG_;s%`TMl">
                                                                <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                                                <value name="VALUE">
                                                                  <block type="get_attr" id="Pq^Bjecjs`n?o,y?!}!c">
                                                                    <value name="PATH">
                                                                      <shadow type="text" id="[6i]bv|+F1;gx@d8c.)e">
                                                                        <field name="TEXT">address.postcode</field>
                                                                      </shadow>
                                                                    </value>
                                                                    <value name="OBJECT">
                                                                      <block type="variables_get" id="jEFim1`IaNOjxazQ;n8K">
                                                                        <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                                <next>
                                                                  <block type="variables_set" id="$L;=BwnWkcz*c:Ja,v9A">
                                                                    <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                                                    <value name="VALUE">
                                                                      <block type="get_attr" id="bC`Q5Rr[PnjW}wgHvEBF">
                                                                        <value name="PATH">
                                                                          <shadow type="text" id="kTR_D-FK^72QX-fON74F">
                                                                            <field name="TEXT">address.town</field>
                                                                          </shadow>
                                                                        </value>
                                                                        <value name="OBJECT">
                                                                          <block type="variables_get" id="1FA1W?drJ[PO[.tc~HO)">
                                                                            <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                    <next>
                                                                      <block type="variables_set" id="-%#I%)w((I9lwE;_)A#%">
                                                                        <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                                        <value name="VALUE">
                                                                          <block type="text_join" id="RpLuH!Uf-MaFF~mb6h4p">
                                                                            <mutation items="2"></mutation>
                                                                            <value name="ADD0">
                                                                              <block type="text" id="}yk,46V7;kFJRO-Ip-O-">
                                                                                <field name="TEXT">-</field>
                                                                              </block>
                                                                            </value>
                                                                            <value name="ADD1">
                                                                              <block type="get_attr" id="Jhz8iS@D@-H8jo)JVk([">
                                                                                <value name="PATH">
                                                                                  <shadow type="text" id="iE;/).FovyaCD.wgvjTq">
                                                                                    <field name="TEXT">address.village</field>
                                                                                  </shadow>
                                                                                </value>
                                                                                <value name="OBJECT">
                                                                                  <block type="variables_get" id="OZmIZS]J_Gt347jYw7dB">
                                                                                    <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                                  </block>
                                                                                </value>
                                                                              </block>
                                                                            </value>
                                                                          </block>
                                                                        </value>
                                                                        <next>
                                                                          <block type="update" id="k[sWzO09~=r|YgT[3,rV">
                                                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                            <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresse</field>
                                                                            <field name="WITH_DELAY">FALSE</field>
                                                                            <value name="VALUE">
                                                                              <block type="text_join" id=",m%e).l|wRoGRhe[;8zz">
                                                                                <mutation items="8"></mutation>
                                                                                <value name="ADD0">
                                                                                  <block type="variables_get" id="5PrA%5d|f,*|,B|2@5gs">
                                                                                    <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                                                                  </block>
                                                                                </value>
                                                                                <value name="ADD1">
                                                                                  <block type="text" id="/q[J]i}y=7pbi!,x]XXg">
                                                                                    <field name="TEXT"> </field>
                                                                                  </block>
                                                                                </value>
                                                                                <value name="ADD2">
                                                                                  <block type="variables_get" id="4TMsfq5B00y%a5X66M(y">
                                                                                    <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                                                                  </block>
                                                                                </value>
                                                                                <value name="ADD3">
                                                                                  <block type="text_newline" id="FSC3E3feS]Fz!Kl(-)8h">
                                                                                    <field name="Type">\n</field>
                                                                                  </block>
                                                                                </value>
                                                                                <value name="ADD4">
                                                                                  <block type="variables_get" id="ULW5Y`|bkW*t}gR#Y1YJ">
                                                                                    <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                                                                  </block>
                                                                                </value>
                                                                                <value name="ADD5">
                                                                                  <block type="text" id="t}me`s,puqFxmOti@,|^">
                                                                                    <field name="TEXT"> </field>
                                                                                  </block>
                                                                                </value>
                                                                                <value name="ADD6">
                                                                                  <block type="variables_get" id="l6XADM$`Pm6.lF,D{P{7">
                                                                                    <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                                                                  </block>
                                                                                </value>
                                                                                <value name="ADD7">
                                                                                  <block type="variables_get" id="*?:kFXJb-C`f@(1iT8HY">
                                                                                    <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                                                  </block>
                                                                                </value>
                                                                              </block>
                                                                            </value>
                                                                            <next>
                                                                              <block type="update" id="VUUXD?6)(@jFTD8#RGH)">
                                                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresseStrasse</field>
                                                                                <field name="WITH_DELAY">FALSE</field>
                                                                                <value name="VALUE">
                                                                                  <block type="text_join" id="tSVh73})0[7gg84@K8nc">
                                                                                    <mutation items="3"></mutation>
                                                                                    <value name="ADD0">
                                                                                      <block type="variables_get" id="9]%z5BFP7t:.,jLDj}N)">
                                                                                        <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                                                                      </block>
                                                                                    </value>
                                                                                    <value name="ADD1">
                                                                                      <block type="text" id="*ko{:x9|_FBXwExl5M.M">
                                                                                        <field name="TEXT"> </field>
                                                                                      </block>
                                                                                    </value>
                                                                                    <value name="ADD2">
                                                                                      <block type="variables_get" id="va3.aM*gLU?5$*xh:{!@">
                                                                                        <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                                                                      </block>
                                                                                    </value>
                                                                                  </block>
                                                                                </value>
                                                                                <next>
                                                                                  <block type="update" id="k~(_C]sBA}gRpOnM)`ir">
                                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                    <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresseOrt</field>
                                                                                    <field name="WITH_DELAY">FALSE</field>
                                                                                    <value name="VALUE">
                                                                                      <block type="text_join" id="Ygp#T[/r|WLC+3GaHw_J">
                                                                                        <mutation items="4"></mutation>
                                                                                        <value name="ADD0">
                                                                                          <block type="variables_get" id="6;Gl%};w+YmZ!eF=#/n*">
                                                                                            <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                                                                          </block>
                                                                                        </value>
                                                                                        <value name="ADD1">
                                                                                          <block type="text" id="*138?,sa=O9r}Nc0)K:z">
                                                                                            <field name="TEXT"> </field>
                                                                                          </block>
                                                                                        </value>
                                                                                        <value name="ADD2">
                                                                                          <block type="variables_get" id="A*;egBI0mMMO?Os!Z.p|">
                                                                                            <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                                                                          </block>
                                                                                        </value>
                                                                                        <value name="ADD3">
                                                                                          <block type="variables_get" id="n}hcIN-H_l47mmj0kZg}">
                                                                                            <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                                                          </block>
                                                                                        </value>
                                                                                      </block>
                                                                                    </value>
                                                                                    <next>
                                                                                      <block type="update" id="$Bvh[[ajBZW)=_VK-^_,">
                                                                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                        <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresseAktualisierungszeit</field>
                                                                                        <field name="WITH_DELAY">FALSE</field>
                                                                                        <value name="VALUE">
                                                                                          <block type="time_get" id=".)CEL*sN#UjZTi]hDA?P">
                                                                                            <mutation xmlns="http://www.w3.org/1999/xhtml" format="true" language="false"></mutation>
                                                                                            <field name="OPTION">custom</field>
                                                                                            <field name="FORMAT">TT.MM.JJJJ SS:mm:ss</field>
                                                                                          </block>
                                                                                        </value>
                                                                                      </block>
                                                                                    </next>
                                                                                  </block>
                                                                                </next>
                                                                              </block>
                                                                            </next>
                                                                          </block>
                                                                        </next>
                                                                      </block>
                                                                    </next>
                                                                  </block>
                                                                </next>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
      

      Die JS-Funktion, die den Fehler wohl verursacht, so:

      let result;
      function reqAsync() {
          return new Promise(function(resolve, reject){
              const options = {
                  url: 'https://nominatim.openstreetmap.org/reverse.php?format=json&lat=' + lat + '&lon=' + lon + '&zoom=' + zoom,
                  method: 'GET',
                  headers: {
                      'Accept': 'application/json',
                      'Accept-Charset': 'utf-8',
                      'User-Agent': 'iobroker script'
                  }
              }
              request(options, function(err,response,body){
                  if(response.statusCode != 200) {
                      reject();
                  }
                  resolve(JSON.parse(body));
              })
          })
      }
      
      try {
          result = await reqAsync();
      } catch(e) {
          log(e);
          result = e;
      }
      return result;
      
      
      haus-automatisierungH Online
      haus-automatisierungH Online
      haus-automatisierung
      Developer Most Active
      schrieb am zuletzt editiert von
      #2

      @mp_trixi https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/upgrade-guide.md#request-to-httpget

      🧑‍🎓 Autor des beliebten ioBroker-Master-Kurses
      🎥 Tutorials rund um das Thema DIY-Smart-Home: https://haus-automatisierung.com/
      📚 Meine inoffizielle ioBroker Dokumentation

      1 Antwort Letzte Antwort
      3
      • Jey CeeJ Online
        Jey CeeJ Online
        Jey Cee
        Developer
        schrieb am zuletzt editiert von Jey Cee
        #3

        @mp_trixi das modul request ist veraltet und wurde aus dem Javascript Adapter entfernt.

        Hier geht es darum request durch die neue Methode httpGet zu ersetzen: https://forum.iobroker.net/topic/74885/hilfe-bei-skripte-von-request-auf-httpget-umbauen

        @haus-automatisierung wusste nicht das du eine Anleitung dazu geschrieben hast. Sehr cool.

        Persönlicher Support
        Spenden -> paypal.me/J3YC33

        M 1 Antwort Letzte Antwort
        0
        • Jey CeeJ Jey Cee

          @mp_trixi das modul request ist veraltet und wurde aus dem Javascript Adapter entfernt.

          Hier geht es darum request durch die neue Methode httpGet zu ersetzen: https://forum.iobroker.net/topic/74885/hilfe-bei-skripte-von-request-auf-httpget-umbauen

          @haus-automatisierung wusste nicht das du eine Anleitung dazu geschrieben hast. Sehr cool.

          M Offline
          M Offline
          MP_Trixi
          schrieb am zuletzt editiert von
          #4

          @jey-cee
          @haus-automatisierung

          Ein Wahnsinn wie schnell das hier geht. Danke Euch!!! Ich schau mir das mal an ob ich mit meinen limitierten Mitteln das hinbekomme.

          1 Antwort Letzte Antwort
          0
          • M MP_Trixi

            Hallo,
            hatte hier im Forum mal eine Methode gefunden, mit der man Längen-/Breitengrade in eine "Klartext"-Adresse umwandeln konnte. Dies hat auch zuverlässig funktioniert. Nun bekomme ich folgenden Fehler:

            script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten: ReferenceError: request is not defined at script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2491:13 at new Promise (<anonymous>) at reqAsync (script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2481:16) at OSM_Reverse (script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2501:24) at script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2527:16 at script.js.common.VIS.Auto.VWeGolfAdresseAusGPSKoordinaten:2549:3 at Script.runInContext (node:vm:148:12) at Script.runInNewContext (node:vm:153:17) at execute (/opt/iobroker/node_modules/iobroker.javascript/main.js:1979:23) at prepareScript (/opt/iobroker/node_modules/iobroker.javascript/main.js:2228:13)
            

            Ich habe ein NPM Update durchgeführt - kann es daran liegen? Das Blockly dazu sieht so aus:

            <block xmlns="https://developers.google.com/blockly/xml" type="variables_set" id="wR~~7^?!0{b~ZWJW2z2Y" x="57" y="17">
              <field name="VAR" id="2]3hGy$Na|L2qX#+=;E8">lat</field>
              <value name="VALUE">
                <block type="convert_tonumber" id="hWzOOf8;.`B+Z9M:!wuy">
                  <value name="VALUE">
                    <block type="text_replace" id="iq$PAJMO5dQeXWkN:]f1">
                      <value name="FROM">
                        <shadow type="text" id="skgW?L6sL,jkQD*MQ^=,">
                          <field name="TEXT">,</field>
                        </shadow>
                      </value>
                      <value name="TO">
                        <shadow type="text" id="f|IG4zBx+b#B_Hl,BmB~">
                          <field name="TEXT">.</field>
                        </shadow>
                      </value>
                      <value name="TEXT">
                        <shadow type="text" id="LK6OfG42WP@L^,K!cJlO">
                          <field name="TEXT">text</field>
                        </shadow>
                        <block type="convert_tostring" id="O$]q.ry,tjC;).lNA.Zc">
                          <value name="VALUE">
                            <block type="get_value" id="(^S9Up?34JmWvIN[g:zP">
                              <field name="ATTR">val</field>
                              <field name="OID">alias.0.Fahrzeuge.VW_eGolf_MP96E.POSITION_BREITENGRAD</field>
                            </block>
                          </value>
                        </block>
                      </value>
                    </block>
                  </value>
                </block>
              </value>
              <next>
                <block type="debug" id="Mj})kCg^fazvUa.?[@N!">
                  <field name="Severity">info</field>
                  <value name="TEXT">
                    <shadow type="text" id="%VvnK$gGYiUTOds]h/KE">
                      <field name="TEXT">test</field>
                    </shadow>
                    <block type="variables_get" id="5}*nVoDiWWaX^^e,vd,E">
                      <field name="VAR" id="2]3hGy$Na|L2qX#+=;E8">lat</field>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id="|i,e7-xsVZtwL,YE9Pns">
                      <field name="VAR" id=".hv$JjjT(QY(0c2!/tuc">lon</field>
                      <value name="VALUE">
                        <block type="convert_tonumber" id="zdJ=q9d8[uma}!QaRdR`">
                          <value name="VALUE">
                            <block type="text_replace" id="1r;?,i(:@$$@}X:Dv,$j">
                              <value name="FROM">
                                <shadow type="text" id=",33EQg[hFkLIGnA5BkCi">
                                  <field name="TEXT">,</field>
                                </shadow>
                              </value>
                              <value name="TO">
                                <shadow type="text" id="?JpAIBzxRE{og!G7%t6s">
                                  <field name="TEXT">.</field>
                                </shadow>
                              </value>
                              <value name="TEXT">
                                <shadow type="text" id="LK6OfG42WP@L^,K!cJlO">
                                  <field name="TEXT">text</field>
                                </shadow>
                                <block type="convert_tostring" id="srs+,w3bMkJO$su2JuSd">
                                  <value name="VALUE">
                                    <block type="get_value" id="SV4g.3=xJ~~crtmE9*=4">
                                      <field name="ATTR">val</field>
                                      <field name="OID">alias.0.Fahrzeuge.VW_eGolf_MP96E.POSITION_LAENGENGRAD</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                            </block>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="debug" id="CO,[BAbspFgPnMa37]c^">
                          <field name="Severity">info</field>
                          <value name="TEXT">
                            <shadow type="text" id="%VvnK$gGYiUTOds]h/KE">
                              <field name="TEXT">test</field>
                            </shadow>
                            <block type="variables_get" id="f*X{XjU:U3=yy5[8bVl1">
                              <field name="VAR" id=".hv$JjjT(QY(0c2!/tuc">lon</field>
                            </block>
                          </value>
                          <next>
                            <block type="variables_set" id="gV3k#TgOw[TwD3PggX_z">
                              <field name="VAR" id="J3x^9.8?y5q~@YX!.0vq">zoom</field>
                              <value name="VALUE">
                                <block type="math_number" id="RiaGr]H5DPjOiCLI$~+H">
                                  <field name="NUM">18</field>
                                </block>
                              </value>
                              <next>
                                <block type="variables_set" id="_]-UxYH%D~}#l6DWPyqA">
                                  <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                  <value name="VALUE">
                                    <block type="procedures_callcustomreturn" id="E6q6k3RA-DSW4n:wbmt5" inline="true">
                                      <mutation name="OSM_Reverse">
                                        <arg name="lat"></arg>
                                        <arg name="lon"></arg>
                                        <arg name="zoom"></arg>
                                      </mutation>
                                      <value name="ARG0">
                                        <block type="variables_get" id="O~3vjlaQApGabQ#KZ_Np">
                                          <field name="VAR" id="2]3hGy$Na|L2qX#+=;E8">lat</field>
                                        </block>
                                      </value>
                                      <value name="ARG1">
                                        <block type="variables_get" id=";6In%LVgU8c~ZW=V^#!+">
                                          <field name="VAR" id=".hv$JjjT(QY(0c2!/tuc">lon</field>
                                        </block>
                                      </value>
                                      <value name="ARG2">
                                        <block type="variables_get" id="!Lp;DYb2Cg#%7WJ[ixj:">
                                          <field name="VAR" id="J3x^9.8?y5q~@YX!.0vq">zoom</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="debug" id="=kG9Q3BHtv,N12i)o/cd" inline="true">
                                      <field name="Severity">debug</field>
                                      <value name="TEXT">
                                        <shadow type="text" id="ik1UI0{#imdw4QxI,wuq">
                                          <field name="TEXT">test</field>
                                        </shadow>
                                        <block type="variables_get" id="ZJbVSK}WTjai..N)v+^}">
                                          <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="variables_set" id="O{z96Lp@j3i8Slita#*W">
                                          <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                          <value name="VALUE">
                                            <block type="text" id=".F~*Z,w04}/`Zb~EHIO6">
                                              <field name="TEXT"></field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="variables_set" id="39@-t*shJUx-}=TcBs72">
                                              <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                              <value name="VALUE">
                                                <block type="text" id="lCo5cXfY=#t]_-9??cvm">
                                                  <field name="TEXT"></field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="variables_set" id="Wa.e4=|kzt(4dQ2EsnIo">
                                                  <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                                  <value name="VALUE">
                                                    <block type="text" id="0X6gVH,Zq7X)L$UxO`bK">
                                                      <field name="TEXT"></field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id="$a!IHGzO]*0gQ)FyRs1v">
                                                      <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                                      <value name="VALUE">
                                                        <block type="text" id="n6Q~K{?kb[4BO6$(X6rV">
                                                          <field name="TEXT"></field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="variables_set" id="z,*?N4M~aXp+cs$;LjM/">
                                                          <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                          <value name="VALUE">
                                                            <block type="text" id="(-u~=9GnJ#Sr=cgq;l@*">
                                                              <field name="TEXT"></field>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="variables_set" id=";l(%na=dPiyRgvjT`p7J">
                                                              <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                                              <value name="VALUE">
                                                                <block type="get_attr" id="4BRp8)RL(Z,ya1V7L%,k">
                                                                  <value name="PATH">
                                                                    <shadow type="text" id="@+Kn.LF%vkB35cm%To%G">
                                                                      <field name="TEXT">address.road</field>
                                                                    </shadow>
                                                                  </value>
                                                                  <value name="OBJECT">
                                                                    <block type="variables_get" id="/rsi@S]q*[hct$N@3[U^">
                                                                      <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="variables_set" id="GF]n^bp:KR6CAP@XO@m~">
                                                                  <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                                                  <value name="VALUE">
                                                                    <block type="get_attr" id="poO,V);aHMLGORNJUv:/">
                                                                      <value name="PATH">
                                                                        <shadow type="text" id="LOCBUCh^8H,AcN*N5f,)">
                                                                          <field name="TEXT">address.house_number</field>
                                                                        </shadow>
                                                                      </value>
                                                                      <value name="OBJECT">
                                                                        <block type="variables_get" id="sIO)[*}W,ats$rr:v~:X">
                                                                          <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="variables_set" id="+|Z)LBF*uHLG_;s%`TMl">
                                                                      <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                                                      <value name="VALUE">
                                                                        <block type="get_attr" id="Pq^Bjecjs`n?o,y?!}!c">
                                                                          <value name="PATH">
                                                                            <shadow type="text" id="[6i]bv|+F1;gx@d8c.)e">
                                                                              <field name="TEXT">address.postcode</field>
                                                                            </shadow>
                                                                          </value>
                                                                          <value name="OBJECT">
                                                                            <block type="variables_get" id="jEFim1`IaNOjxazQ;n8K">
                                                                              <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="variables_set" id="$L;=BwnWkcz*c:Ja,v9A">
                                                                          <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                                                          <value name="VALUE">
                                                                            <block type="get_attr" id="bC`Q5Rr[PnjW}wgHvEBF">
                                                                              <value name="PATH">
                                                                                <shadow type="text" id="kTR_D-FK^72QX-fON74F">
                                                                                  <field name="TEXT">address.town</field>
                                                                                </shadow>
                                                                              </value>
                                                                              <value name="OBJECT">
                                                                                <block type="variables_get" id="1FA1W?drJ[PO[.tc~HO)">
                                                                                  <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="variables_set" id="-%#I%)w((I9lwE;_)A#%">
                                                                              <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                                              <value name="VALUE">
                                                                                <block type="text_join" id="RpLuH!Uf-MaFF~mb6h4p">
                                                                                  <mutation items="2"></mutation>
                                                                                  <value name="ADD0">
                                                                                    <block type="text" id="}yk,46V7;kFJRO-Ip-O-">
                                                                                      <field name="TEXT">-</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="ADD1">
                                                                                    <block type="get_attr" id="Jhz8iS@D@-H8jo)JVk([">
                                                                                      <value name="PATH">
                                                                                        <shadow type="text" id="iE;/).FovyaCD.wgvjTq">
                                                                                          <field name="TEXT">address.village</field>
                                                                                        </shadow>
                                                                                      </value>
                                                                                      <value name="OBJECT">
                                                                                        <block type="variables_get" id="OZmIZS]J_Gt347jYw7dB">
                                                                                          <field name="VAR" id="InM51wH+hhRZ1K}Uo6R:">result</field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                              <next>
                                                                                <block type="update" id="k[sWzO09~=r|YgT[3,rV">
                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                  <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresse</field>
                                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                                  <value name="VALUE">
                                                                                    <block type="text_join" id=",m%e).l|wRoGRhe[;8zz">
                                                                                      <mutation items="8"></mutation>
                                                                                      <value name="ADD0">
                                                                                        <block type="variables_get" id="5PrA%5d|f,*|,B|2@5gs">
                                                                                          <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD1">
                                                                                        <block type="text" id="/q[J]i}y=7pbi!,x]XXg">
                                                                                          <field name="TEXT"> </field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD2">
                                                                                        <block type="variables_get" id="4TMsfq5B00y%a5X66M(y">
                                                                                          <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD3">
                                                                                        <block type="text_newline" id="FSC3E3feS]Fz!Kl(-)8h">
                                                                                          <field name="Type">\n</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD4">
                                                                                        <block type="variables_get" id="ULW5Y`|bkW*t}gR#Y1YJ">
                                                                                          <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD5">
                                                                                        <block type="text" id="t}me`s,puqFxmOti@,|^">
                                                                                          <field name="TEXT"> </field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD6">
                                                                                        <block type="variables_get" id="l6XADM$`Pm6.lF,D{P{7">
                                                                                          <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD7">
                                                                                        <block type="variables_get" id="*?:kFXJb-C`f@(1iT8HY">
                                                                                          <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </value>
                                                                                  <next>
                                                                                    <block type="update" id="VUUXD?6)(@jFTD8#RGH)">
                                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                      <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresseStrasse</field>
                                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                                      <value name="VALUE">
                                                                                        <block type="text_join" id="tSVh73})0[7gg84@K8nc">
                                                                                          <mutation items="3"></mutation>
                                                                                          <value name="ADD0">
                                                                                            <block type="variables_get" id="9]%z5BFP7t:.,jLDj}N)">
                                                                                              <field name="VAR" id=";SRb,$QZLlU?vOmiT~JX">Strasse</field>
                                                                                            </block>
                                                                                          </value>
                                                                                          <value name="ADD1">
                                                                                            <block type="text" id="*ko{:x9|_FBXwExl5M.M">
                                                                                              <field name="TEXT"> </field>
                                                                                            </block>
                                                                                          </value>
                                                                                          <value name="ADD2">
                                                                                            <block type="variables_get" id="va3.aM*gLU?5$*xh:{!@">
                                                                                              <field name="VAR" id="~jZ,3*n[d]KZ1(ana89o">Hausnummer</field>
                                                                                            </block>
                                                                                          </value>
                                                                                        </block>
                                                                                      </value>
                                                                                      <next>
                                                                                        <block type="update" id="k~(_C]sBA}gRpOnM)`ir">
                                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                          <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresseOrt</field>
                                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                                          <value name="VALUE">
                                                                                            <block type="text_join" id="Ygp#T[/r|WLC+3GaHw_J">
                                                                                              <mutation items="4"></mutation>
                                                                                              <value name="ADD0">
                                                                                                <block type="variables_get" id="6;Gl%};w+YmZ!eF=#/n*">
                                                                                                  <field name="VAR" id="Q7gDYvdg}{GBIzzh?9vc">PLZ</field>
                                                                                                </block>
                                                                                              </value>
                                                                                              <value name="ADD1">
                                                                                                <block type="text" id="*138?,sa=O9r}Nc0)K:z">
                                                                                                  <field name="TEXT"> </field>
                                                                                                </block>
                                                                                              </value>
                                                                                              <value name="ADD2">
                                                                                                <block type="variables_get" id="A*;egBI0mMMO?Os!Z.p|">
                                                                                                  <field name="VAR" id="v]lk,gotsm)bM3Q2w9X:">Stadt</field>
                                                                                                </block>
                                                                                              </value>
                                                                                              <value name="ADD3">
                                                                                                <block type="variables_get" id="n}hcIN-H_l47mmj0kZg}">
                                                                                                  <field name="VAR" id="-QG.FU1X4c1lz=sfcH?*">Ortsteil</field>
                                                                                                </block>
                                                                                              </value>
                                                                                            </block>
                                                                                          </value>
                                                                                          <next>
                                                                                            <block type="update" id="$Bvh[[ajBZW)=_VK-^_,">
                                                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                              <field name="OID">0_userdata.0.VIS.Auto.VWeGolfAktuelleAdresseAktualisierungszeit</field>
                                                                                              <field name="WITH_DELAY">FALSE</field>
                                                                                              <value name="VALUE">
                                                                                                <block type="time_get" id=".)CEL*sN#UjZTi]hDA?P">
                                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" format="true" language="false"></mutation>
                                                                                                  <field name="OPTION">custom</field>
                                                                                                  <field name="FORMAT">TT.MM.JJJJ SS:mm:ss</field>
                                                                                                </block>
                                                                                              </value>
                                                                                            </block>
                                                                                          </next>
                                                                                        </block>
                                                                                      </next>
                                                                                    </block>
                                                                                  </next>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
            

            Die JS-Funktion, die den Fehler wohl verursacht, so:

            let result;
            function reqAsync() {
                return new Promise(function(resolve, reject){
                    const options = {
                        url: 'https://nominatim.openstreetmap.org/reverse.php?format=json&lat=' + lat + '&lon=' + lon + '&zoom=' + zoom,
                        method: 'GET',
                        headers: {
                            'Accept': 'application/json',
                            'Accept-Charset': 'utf-8',
                            'User-Agent': 'iobroker script'
                        }
                    }
                    request(options, function(err,response,body){
                        if(response.statusCode != 200) {
                            reject();
                        }
                        resolve(JSON.parse(body));
                    })
                })
            }
            
            try {
                result = await reqAsync();
            } catch(e) {
                log(e);
                result = e;
            }
            return result;
            
            
            CodierknechtC Online
            CodierknechtC Online
            Codierknecht
            Developer Most Active
            schrieb am zuletzt editiert von
            #5

            @mp_trixi
            Wenn JS eine Alternative wäre:

            const axios = require('axios');
            
            // Reverse-Geocoding anhand der aktuellen Koordinaten
            async function updateLocation(latitude, longitude) {
                const url = `https://nominatim.openstreetmap.org/reverse?lat=${latitude}&lon=${longitude}&format=json`;
                const response = await axios.get(url);
                if (response && response.data.display_name) {
                  log('Standort: ' + response.data.display_name);
                  setState('0_userdata.0.standort', response.data.display_name, true);
                }
            }
            
            

            "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." (Martin Fowler, "Refactoring")

            Proxmox 9.1.1 LXC|8 GB|Core i7-6700
            HmIP|ZigBee|Tasmota|Unifi
            Zabbix Certified Specialist
            Konnte ich Dir helfen? Dann benutze bitte das Voting unten rechts im Beitrag

            haus-automatisierungH 1 Antwort Letzte Antwort
            0
            • CodierknechtC Codierknecht

              @mp_trixi
              Wenn JS eine Alternative wäre:

              const axios = require('axios');
              
              // Reverse-Geocoding anhand der aktuellen Koordinaten
              async function updateLocation(latitude, longitude) {
                  const url = `https://nominatim.openstreetmap.org/reverse?lat=${latitude}&lon=${longitude}&format=json`;
                  const response = await axios.get(url);
                  if (response && response.data.display_name) {
                    log('Standort: ' + response.data.display_name);
                    setState('0_userdata.0.standort', response.data.display_name, true);
                  }
              }
              
              
              haus-automatisierungH Online
              haus-automatisierungH Online
              haus-automatisierung
              Developer Most Active
              schrieb am zuletzt editiert von
              #6

              @codierknecht Wo siehst Du den Vorteil von axios gegenüber den internen httpGet Methoden?

              🧑‍🎓 Autor des beliebten ioBroker-Master-Kurses
              🎥 Tutorials rund um das Thema DIY-Smart-Home: https://haus-automatisierung.com/
              📚 Meine inoffizielle ioBroker Dokumentation

              CodierknechtC jolicJ 2 Antworten Letzte Antwort
              0
              • haus-automatisierungH haus-automatisierung

                @codierknecht Wo siehst Du den Vorteil von axios gegenüber den internen httpGet Methoden?

                CodierknechtC Online
                CodierknechtC Online
                Codierknecht
                Developer Most Active
                schrieb am zuletzt editiert von
                #7

                @haus-automatisierung
                Gar keinen.
                Ich nutze halt überall axios. Also bleibe ich dabei ;-)

                "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." (Martin Fowler, "Refactoring")

                Proxmox 9.1.1 LXC|8 GB|Core i7-6700
                HmIP|ZigBee|Tasmota|Unifi
                Zabbix Certified Specialist
                Konnte ich Dir helfen? Dann benutze bitte das Voting unten rechts im Beitrag

                1 Antwort Letzte Antwort
                0
                • haus-automatisierungH haus-automatisierung

                  @codierknecht Wo siehst Du den Vorteil von axios gegenüber den internen httpGet Methoden?

                  jolicJ Offline
                  jolicJ Offline
                  jolic
                  schrieb am zuletzt editiert von jolic
                  #8

                  @haus-automatisierung said in Funktion zum Seitenabruf per Get funktioniert nicht mehr:

                  Wo siehst Du den Vorteil von axios gegenüber den internen httpGet Methoden?

                  Hi, rein interessehalber, weil ich auch gerne axios verwende: Die internen httpGet-Methoden in ioBroker nutzen (meines Wissens) keine Promises, sondern basieren auf Callback-Funktionen. Axios verwendet Promises, was den Umgang mit asynchronen Operationen vereinfacht.

                  Für einfache Anfragen sind die internen httpGet-Methoden ausreichend. Für komplexere Anfragen, bessere Fehlerbehandlung und saubereren Code finde ich Axios oft besser geeignet (meine Meinung).

                  haus-automatisierungH 1 Antwort Letzte Antwort
                  0
                  • jolicJ jolic

                    @haus-automatisierung said in Funktion zum Seitenabruf per Get funktioniert nicht mehr:

                    Wo siehst Du den Vorteil von axios gegenüber den internen httpGet Methoden?

                    Hi, rein interessehalber, weil ich auch gerne axios verwende: Die internen httpGet-Methoden in ioBroker nutzen (meines Wissens) keine Promises, sondern basieren auf Callback-Funktionen. Axios verwendet Promises, was den Umgang mit asynchronen Operationen vereinfacht.

                    Für einfache Anfragen sind die internen httpGet-Methoden ausreichend. Für komplexere Anfragen, bessere Fehlerbehandlung und saubereren Code finde ich Axios oft besser geeignet (meine Meinung).

                    haus-automatisierungH Online
                    haus-automatisierungH Online
                    haus-automatisierung
                    Developer Most Active
                    schrieb am zuletzt editiert von
                    #9

                    @jolic Dann schau gerne mal in die Doku und verwende die asynchronen Funktionen httpGetAsynx und httpPostAsync. Dann haste auch ein Promise.

                    🧑‍🎓 Autor des beliebten ioBroker-Master-Kurses
                    🎥 Tutorials rund um das Thema DIY-Smart-Home: https://haus-automatisierung.com/
                    📚 Meine inoffizielle ioBroker Dokumentation

                    jolicJ 1 Antwort Letzte Antwort
                    1
                    • haus-automatisierungH haus-automatisierung

                      @jolic Dann schau gerne mal in die Doku und verwende die asynchronen Funktionen httpGetAsynx und httpPostAsync. Dann haste auch ein Promise.

                      jolicJ Offline
                      jolicJ Offline
                      jolic
                      schrieb am zuletzt editiert von
                      #10

                      @haus-automatisierung said in Funktion zum Seitenabruf per Get funktioniert nicht mehr:

                      @jolic Dann schau gerne mal in die Doku und verwende die asynchronen Funktionen httpGetAsynx und httpPostAsync. Dann haste auch ein Promise.

                      Danke dir, das ist gut zu wissen!

                      Da der interne httpGet-Befehl in ioBroker nativ verfügbar ist, werde ich mir diesen bei meinem nächsten Projekt genauer anschauen.

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


                      Support us

                      ioBroker
                      Community Adapters
                      Donate

                      338

                      Online

                      32.5k

                      Benutzer

                      81.7k

                      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