Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Mal wieder Webseite auslesen

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Mal wieder Webseite auslesen

    This topic has been deleted. Only users with topic management privileges can see it.
    • Homoran
      Homoran Global Moderator Administrators @liv-in-sky last edited by

      @liv-in-sky sagte in Mal wieder Webseite auslesen:

      du mußt die datenpunkte im blockly noch richtig eintragen

      werden die dann angelegt???
      oder muss ich erst welche (Number) anlegen?

      liv-in-sky 2 Replies Last reply Reply Quote 0
      • liv-in-sky
        liv-in-sky @Homoran last edited by

        @homoran

        musst du selbst anlegen 😞

        1 Reply Last reply Reply Quote 0
        • liv-in-sky
          liv-in-sky @Homoran last edited by

          @homoran number !!! ist der type

          Homoran 1 Reply Last reply Reply Quote 0
          • Homoran
            Homoran Global Moderator Administrators @liv-in-sky last edited by Homoran

            @liv-in-sky Ja doch 😉

            Hab ich alles - passiert nix
            müsste dann doch bei Skriptstart einmalig funktionieren, oder?

            {
              "from": "system.adapter.admin.0",
              "user": "system.user.admin",
              "ts": 1632744780482,
              "common": {
                "name": "Hospitalisierung",
                "role": "value",
                "type": "number",
                "desc": "Manuell erzeugt",
                "read": true,
                "write": true,
                "def": 0
              },
              "native": {},
              "acl": {
                "object": 1636,
                "owner": "system.user.admin",
                "ownerGroup": "system.group.administrator",
                "state": 1636
              },
              "_id": "0_userdata.0.Gesundheit.Hospitalisierung",
              "type": "state"
            }
            
            liv-in-sky 1 Reply Last reply Reply Quote 0
            • liv-in-sky
              liv-in-sky @Homoran last edited by liv-in-sky

              @homoran

              ja - ist ja kein trigger drin - einmal beim scriptstart - git es einen fehler im log - werden die daten im log angezeigt ?

              Homoran 2 Replies Last reply Reply Quote 0
              • Homoran
                Homoran Global Moderator Administrators @liv-in-sky last edited by Homoran

                @liv-in-sky sagte in Mal wieder Webseite auslesen:

                git es einen fehler im log - werden die daten im log angezeigt

                nope und nope

                habe csv-parse und auch fs als Module in der Instanz hinzugefügt

                liv-in-sky 1 Reply Last reply Reply Quote 0
                • liv-in-sky
                  liv-in-sky @Homoran last edited by

                  @homoran

                  check ich nicht ????

                  schaut das so aus ?

                  Image 9.png

                  1 Reply Last reply Reply Quote 0
                  • Homoran
                    Homoran Global Moderator Administrators @liv-in-sky last edited by Homoran

                    @liv-in-sky
                    Hab mir den code mal näher angesehen

                    var input = require('fs').readFileSync('/Daten/covid19_5.csv').toString();

                    try {

                    require("request")('https://www.lzg.nrw.de/covid19/daten/covid19_5.csv', async function (error, response, result) {

                    ...

                    Was ist die erste Zeile?
                    hier ist Daten groß geschrieben

                    im request ist alles ok - der Pfad passt

                    EDIT:

                    sieht bei mir so aus:
                    covid_Blockly01.png

                    liv-in-sky 1 Reply Last reply Reply Quote 0
                    • liv-in-sky
                      liv-in-sky @Homoran last edited by

                      @homoran sagte in Mal wieder Webseite auslesen:

                      var input = require('fs').readFileSync('/Daten/covid19_5.csv').toString();

                      ist überbleibsel - kannste löschen - wird nicht benutzt

                      bei mir funktioniert es - daher die verwunderung - es gibt keinen grund, dass da ein fehler bei dir ist - vorallem sollte dann auch ein fehler im log sein

                      aktiviere mal diese zeile - kommt dann was im llog

                      Image 10.png

                      Homoran 1 Reply Last reply Reply Quote 0
                      • Homoran
                        Homoran Global Moderator Administrators @liv-in-sky last edited by Homoran

                        @liv-in-sky sagte in Mal wieder Webseite auslesen:

                        es gibt keinen grund, dass da ein fehler bei dir ist

                        doch - das ist eine antike Installation.
                        Bin immer noch nicht dazu gekommen sie um- und hochzuziehen

                        Gibt es da Befehle, die neuere Versionen benötigen?
                        Ich kopiere es gerade auf ein Testsystem

                        liv-in-sky 1 Reply Last reply Reply Quote 0
                        • liv-in-sky
                          liv-in-sky @Homoran last edited by

                          @homoran

                          eigentlich sehe ich da keine befehle, die ärger machen könnten - aber teste mal in einem anderen system

                          lösche diese zeile zur sicherheit raus:

                          var input = require('fs').readFileSync('/Daten/covid19_5.csv').toString();
                          
                          Homoran 1 Reply Last reply Reply Quote 0
                          • Homoran
                            Homoran Global Moderator Administrators @liv-in-sky last edited by

                            @liv-in-sky sagte in Mal wieder Webseite auslesen:

                            lösche diese zeile zur sicherheit raus:

                            und läuft 😂

                            liv-in-sky 1 Reply Last reply Reply Quote 0
                            • liv-in-sky
                              liv-in-sky @Homoran last edited by

                              @homoran
                              puuh

                              Homoran 1 Reply Last reply Reply Quote 1
                              • Homoran
                                Homoran Global Moderator Administrators @liv-in-sky last edited by

                                @liv-in-sky

                                DANKE!!
                                sieht jetzt so aus:
                                covid_Blockly02.png

                                Logging ist auch aktiviert.
                                Dann muss ich mal morgen sehen, wie ich die Daten der letzten Tage in die History bringe

                                liv-in-sky 1 Reply Last reply Reply Quote 0
                                • liv-in-sky
                                  liv-in-sky @Homoran last edited by liv-in-sky

                                  @homoran

                                  hier das geänderte script - es muss ein neuer dp für das datum hinzugefügt werden - so sollte nur einmal am tag geschrieben werden, egal, was du für ein scheule hast

                                  dann ist in der history nur ein wert pro tag

                                  Image 7.png

                                  <xml xmlns="https://developers.google.com/blockly/xml">
                                   <variables>
                                     <variable id="W3q,ZUH:5Q6saMtf{AUA">s65</variable>
                                     <variable id="T%=$W;0kK#gD_`r(}o:9">s35</variable>
                                     <variable id="Yr7zlPOZj)6N*k!]cQvq">s37</variable>
                                     <variable id="}-E+#=$du-36bQ-k{+2:">time</variable>
                                   </variables>
                                   <block type="comment" id="7/}6Z]{o5y_9ePTV%Ocv" x="113" y="63">
                                     <field name="COMMENT">https://forum.iobroker.net/topic/48057/mal-wieder-webseite-auslesen/33</field>
                                     <next>
                                       <block type="comment" id="3[R3_Kd(YKh$LFgBu3Zr">
                                         <field name="COMMENT">csv parse  request</field>
                                         <next>
                                           <block type="comment" id="+ig?Un6h,r/:z=PWAQCT">
                                             <field name="COMMENT">@homoran</field>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                   <block type="procedures_defcustomnoreturn" id="]33#,HkQS%bDF`vB`P^q" x="337" y="212">
                                     <mutation statements="false">
                                       <arg name="s65" varid="W3q,ZUH:5Q6saMtf{AUA"></arg>
                                       <arg name="s35" varid="T%=$W;0kK#gD_`r(}o:9"></arg>
                                       <arg name="s37" varid="Yr7zlPOZj)6N*k!]cQvq"></arg>
                                       <arg name="time" varid="}-E+#=$du-36bQ-k{+2:"></arg>
                                     </mutation>
                                     <field name="NAME">etwas tun</field>
                                     <field name="SCRIPT">ICANCnZhciBwYXJzZSA9IHJlcXVpcmUoJ2Nzdi1wYXJzZScpOw0KLy92YXIgaW5wdXQgPSByZXF1aXJlKCdmcycpLnJlYWRGaWxlU3luYygnL0RhdGVuL2NvdmlkMTlfNS5jc3YnKS50b1N0cmluZygpOw0KDQoNCg0KdHJ5IHsNCiAgcmVxdWlyZSgicmVxdWVzdCIpKCdodHRwczovL3d3dy5semcubnJ3LmRlL2NvdmlkMTkvZGF0ZW4vY292aWQxOV81LmNzdicsIGFzeW5jIGZ1bmN0aW9uIChlcnJvciwgcmVzcG9uc2UsIHJlc3VsdCkgew0KICAgLy8gY29uc29sZS5sb2cocmVzdWx0KTsNCiAgIA0KcGFyc2UocmVzdWx0LCB7Y29tbWVudDogJyMnfSwgZnVuY3Rpb24oZXJyLCBvdXRwdXQpew0KCS8vIHNob3cgcmVzdWx0DQoJY29uc29sZS5sb2coSlNPTi5zdHJpbmdpZnkob3V0cHV0KSk7DQpmb3IobGV0IHI9MDtyPG91dHB1dC5sZW5ndGg7cisrKXsNCiAgIC8vIGxvZyhvdXRwdXRbcl1bNDZdKQ0KfQ0KbG9nKG91dHB1dFtvdXRwdXQubGVuZ3RoLTFdWzY1XSkNCmQ2NT1OdW1iZXIob3V0cHV0W291dHB1dC5sZW5ndGgtMV1bNjVdKSoxMDANCmxvZyhvdXRwdXRbb3V0cHV0Lmxlbmd0aC0xXVszN10pDQpkMzc9TnVtYmVyKG91dHB1dFtvdXRwdXQubGVuZ3RoLTFdWzM3XSkNCmxvZyhvdXRwdXRbb3V0cHV0Lmxlbmd0aC0xXVszNV0pDQpkMzU9TnVtYmVyKG91dHB1dFtvdXRwdXQubGVuZ3RoLTFdWzM1XSkNCmxvZyhvdXRwdXRbb3V0cHV0Lmxlbmd0aC0xXVsyXSkNCmQyPVN0cmluZyhvdXRwdXRbb3V0cHV0Lmxlbmd0aC0xXVsyXSkNCmlmKGQyIT1nZXRTdGF0ZSh0aW1lKS52YWwpew0Kc2V0U3RhdGUoczY1LE1hdGgucm91bmQoZDY1ICogMTAwKSAvIDEwMCkNCnNldFN0YXRlKHMzNSxNYXRoLnJvdW5kKGQzNSAqIDEwMCkgLyAxMDApDQpzZXRTdGF0ZShzMzcsTWF0aC5yb3VuZCgzNyAqIDEwMCkgLyAxMDApDQpzZXRTdGF0ZSh0aW1lLGQyKQ0KfQ0KfSk7DQogIA0KIH0pLm9uKCJlcnJvciIsIGZ1bmN0aW9uIChlKSB7Y29uc29sZS5lcnJvcihlKTt9KTsNCn0gY2F0Y2ggKGUpIHsgY29uc29sZS5lcnJvcihlKTsgfSAgIA0KDQoNCg0K</field>
                                     <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                                   </block>
                                   <block type="procedures_callcustomnoreturn" id="VtDoZ,@!?HK~J,vK;+*R" x="238" y="287">
                                     <mutation name="etwas tun">
                                       <arg name="s65"></arg>
                                       <arg name="s35"></arg>
                                       <arg name="s37"></arg>
                                       <arg name="time"></arg>
                                     </mutation>
                                     <value name="ARG0">
                                       <block type="text" id="7#PKlzH+`3;Z9]dS(cEB">
                                         <field name="TEXT">0_userdata.0.CONTROL-OWN.AAATEST.HOMORAN-CSV.s65</field>
                                       </block>
                                     </value>
                                     <value name="ARG1">
                                       <block type="text" id="vlrWSNU/ZNiILFfr(E|E">
                                         <field name="TEXT">0_userdata.0.CONTROL-OWN.AAATEST.HOMORAN-CSV.s35</field>
                                       </block>
                                     </value>
                                     <value name="ARG2">
                                       <block type="text" id="F[Nb@+#:(/JyXaX-uQyl">
                                         <field name="TEXT">0_userdata.0.CONTROL-OWN.AAATEST.HOMORAN-CSV.s37</field>
                                       </block>
                                     </value>
                                     <value name="ARG3">
                                       <block type="text" id="NG`ShBH)Ye1e53:w(D2e">
                                         <field name="TEXT">0_userdata.0.CONTROL-OWN.AAATEST.HOMORAN-CSV.time</field>
                                       </block>
                                     </value>
                                   </block>
                                  </xml>
                                  

                                  Homoran 1 Reply Last reply Reply Quote 0
                                  • Homoran
                                    Homoran Global Moderator Administrators @liv-in-sky last edited by

                                    @liv-in-sky

                                    DANKE! - sehe ich mir später einmal an.
                                    Ich muss mal etwas suchen, Paul hatte irgendwo einen Schnipsel zum Runden auf zwei Nachkommastellen ohne das Ergebnis als Text zu erhalten.
                                    Das wollte ich mal versuchen mit einzubauen.
                                    Gesundheit_runden.png
                                    So toll sieht das nämlich nicht aus

                                    liv-in-sky 2 Replies Last reply Reply Quote 0
                                    • liv-in-sky
                                      liv-in-sky @Homoran last edited by

                                      @homoran wollt ich gerade machen - oder willst du selbst

                                      Homoran 1 Reply Last reply Reply Quote 0
                                      • liv-in-sky
                                        liv-in-sky @Homoran last edited by

                                        @homoran

                                        Math.round(num * 100) / 100
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • Homoran
                                          Homoran Global Moderator Administrators @liv-in-sky last edited by

                                          @liv-in-sky sagte in Mal wieder Webseite auslesen:

                                          oder willst du selbst

                                          ich will eigentlich selbst, Wenn du dich nicht bremsen kannst "darfst" du es gerne machen - ich sehe dann später erst rein, ob ich es genau so gemacht hätte

                                          liv-in-sky 1 Reply Last reply Reply Quote 0
                                          • liv-in-sky
                                            liv-in-sky @Homoran last edited by

                                            @homoran du willt lernen - dann lass ich dich lernen 🙂

                                            Homoran 1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            962
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            monitoring
                                            3
                                            53
                                            1232
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo