Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Off Topic
    4. Aussentemperatur Wetterstation WS980Wifi in iobroker

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Aussentemperatur Wetterstation WS980Wifi in iobroker

    This topic has been deleted. Only users with topic management privileges can see it.
    • paul53
      paul53 @Pascal Bay last edited by

      @pascal-bay sagte: /usr/local/addons/weather/weather.tcl

      Wenn die Zeile vor "return $zahl" bei dir fehlt, dann füge sie ein.

      # - liest ein Word vom Binärstring liefert Zahl von -32768 bis 32768
      proc getw {idx} {
         global global_binout
         set sb [string index $global_binout $idx]
         scan $sb %c asciih
         set idx [expr $idx + 1]
         set sb [string index $global_binout $idx]  
         scan $sb %c asciil
         set zahl [expr $asciil + { $asciih * 256}]
         if {$zahl > 32767} then {set zahl ~[expr 65535 - $zahl]}
         return $zahl
      } 
      
      Pascal Bay 1 Reply Last reply Reply Quote 0
      • Pascal Bay
        Pascal Bay @paul53 last edited by

        @paul53 said in Aussentemperatur Wetterstation WS980Wifi in iobroker:

        if {$zahl > 32767} then {set zahl ~[expr 65535 - $zahl]}

        Vielen Dank! Bei mir sieht das so aus? Ein Tip, was ich ändern kann? Danke!

        Bildschirmfoto 2025-01-14 um 20.02.26.jpg

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

          @pascal-bay sagte in Aussentemperatur Wetterstation WS980Wifi in iobroker:

          Ein Tip, was ich ändern kann?

          @paul53 sagte in Aussentemperatur Wetterstation WS980Wifi in iobroker:

          Wenn die Zeile vor "return $zahl" bei dir fehlt, dann füge sie ein.

          das ist

          if {$zahl > 32767} then {set zahl ~[expr 65535 - $zahl]}
          
          1 Reply Last reply Reply Quote 0
          • paul53
            paul53 @Pascal Bay last edited by paul53

            @pascal-bay sagte: Bei mir sieht das so aus?

            Das ist die falsche Prozedur. Die richtige ist getw{idx}.

            EDIT: Woher ist deine "weather.tcl"? Die TCL-Datei aus "weatherV2b.zip" sieht anders aus. Anfang:

            #!/bin/tclsh
            
            load tclrega.so
            
            # - hier nur die IP Addresse anpassen
              set debug_mode 0
              set wait_between_status_requests 1
              set connection_timeout 500
              set wait_between_retries 200
              set status_retries 5
              set command_retries 10
              set matchport_host 192.168.0.129 
              set matchport_port 45000
            
            
            
            # - liest ein Byte vom Binärstring - liefert Zahl von 0 - 255
            proc getb {idx} {
               global global_binout
               set sb [string index $global_binout $idx]
               scan $sb %c ascii
               return $ascii
            }
            # - liest ein Word vom Binärstring liefert Zahl von -32768 bis 32768
            proc getw {idx} {
               global global_binout
               set sb [string index $global_binout $idx]
               scan $sb %c asciih
               set idx [expr $idx + 1]
               set sb [string index $global_binout $idx]  
               scan $sb %c asciil
               set zahl [expr $asciil + { $asciih * 256}]
               if {$zahl > 32767} then {set zahl ~[expr 65535 - $zahl]}
               return $zahl
            } 
            # - liest ein Longword vom Binärstring und liefert Zahl von 0 - 4294967295
            proc getl {idx} {
               global global_binout
               set sb [string index $global_binout $idx]
               scan $sb %c ascii3
               set idx [expr $idx + 1]
               set sb [string index $global_binout $idx]  
               scan $sb %c ascii2
               set idx [expr $idx + 1]
               set sb [string index $global_binout $idx]  
               scan $sb %c ascii1   
               set idx [expr $idx + 1]
               set sb [string index $global_binout $idx]  
               scan $sb %c ascii0   
               set zahl [expr $ascii0 + {$ascii1 * 256} + {$ascii2 * 65536} + {$ascii3 * 16777216}]
               return $zahl
            }
            
            Pascal Bay 1 Reply Last reply Reply Quote 1
            • Pascal Bay
              Pascal Bay @paul53 last edited by

              @paul53 Einmal mehr Danke. Ich habe die weather.tcl aus WS980WiFiV2a also noch 2b. Es scheint aber, dass die Zeile da ist. Anbei der richtige Auszug getw{idx}.

              Bildschirmfoto 2025-01-15 um 09.52.15.jpg

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

                @pascal-bay sagte: Auszug getw{idx}.

                Dann sollten negative Werte geliefert werden, denn aufgerufen wird die Prozedur für die Außentemperatur so:

                            set atemp [expr double([getw 10]) / 10]
                
                Pascal Bay 1 Reply Last reply Reply Quote 0
                • Pascal Bay
                  Pascal Bay @paul53 last edited by

                  @paul53 Danke. Sehe ich das richtig, dann ist mein getw{idx} richtig? Der Fehler muss also woanders liegen?

                  paul53 Pascal Bay 2 Replies Last reply Reply Quote 0
                  • paul53
                    paul53 @Pascal Bay last edited by

                    @pascal-bay sagte: Der Fehler muss also woanders liegen?

                    Sieht so aus.
                    Hast du die TCL-Datei ausgetauscht? Oben ist die globale Variable answer und im letzten Post ist sie global_binout.

                    1 Reply Last reply Reply Quote 0
                    • Pascal Bay
                      Pascal Bay @Pascal Bay last edited by

                      Du hast recht ich habe zwei TCL Dateien auf meinem Rechner. Ich gehe aber davon aus, dass die global_binout am laufen ist, denn alle anderen Werte werden korrekt in die Variablen gespeichert. Soll ich trotzdem versuchen mal die global_binout zu laden. Habe etwas Angst, dass dann der Rest auch nicht mehr läuft Klar wäre es super toll wenn ich das hin bekommen würde..... Danke für die Hilfe.

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

                        @pascal-bay sagte: habe zwei TCL Dateien

                        Aber nicht als /usr/local/addons/weather/weather.tcl, die durch CUxD ausgeführt wird.

                        @pascal-bay sagte in Aussentemperatur Wetterstation WS980Wifi in iobroker:

                        global_binout am laufen ist

                        global_binout ist eine globale Variable innerhalb des TCL-Skriptes. Sie beinhaltet den kompletten Antwort-String der Wetterstation.

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

                          @paul53 Vielen Dank für die Antwort. Ich probiere es einmal aus und melde mich wieder wenn ich es hinbekommen habe oder nochmals auf Hilfe angewiesen bin.

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

                          Support us

                          ioBroker
                          Community Adapters
                          Donate

                          942
                          Online

                          31.7k
                          Users

                          79.7k
                          Topics

                          1.3m
                          Posts

                          5
                          23
                          718
                          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