NEWS
Aussentemperatur Wetterstation WS980Wifi in iobroker
- 
					
					
					
					
 @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!  
- 
					
					
					
					
 @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]}
- 
					
					
					
					
 @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 }
- 
					
					
					
					
 @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}.  
- 
					
					
					
					
 @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]
- 
					
					
					
					
 @paul53 Danke. Sehe ich das richtig, dann ist mein getw{idx} richtig? Der Fehler muss also woanders liegen? 
- 
					
					
					
					
 @pascal-bay sagte: Der Fehler muss also woanders liegen? Sieht so aus. 
 Hast du die TCL-Datei ausgetauscht? Oben ist die globale Variableanswerund im letzten Post ist sieglobal_binout.
- 
					
					
					
					
 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. 
- 
					
					
					
					
 @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_binoutist eine globale Variable innerhalb des TCL-Skriptes. Sie beinhaltet den kompletten Antwort-String der Wetterstation.
- 
					
					
					
					
 @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.