20 lines
548 B
Plaintext
Executable File
20 lines
548 B
Plaintext
Executable File
#MESSAGE TEMPERATURE/HUMIDITE
|
|
#
|
|
if {$cmd == "11"} {
|
|
set temphum [exec sudo python /home/pi/Adafruit_Python_DHT/examples/AdafruitDHT.py 11 4];
|
|
set temperature [string range $temphum 5 8]
|
|
set humidity [string range $temphum 21 24]
|
|
#TEMPERATURE EXTERIEUR:
|
|
puts " Température: $temperature °C"
|
|
playMsg "SVXCard/Weatherstation" "tempext";
|
|
playTemp $temperature;
|
|
|
|
#HUMIDITY OUT
|
|
puts "Humidité $humidity %"
|
|
playMsg "SVXCard/Weatherstation" "humidityout";
|
|
playNumber $humidity;
|
|
playMsg "Default" "percent";
|
|
|
|
return 1
|
|
}
|