SrvSVXLink/Options/Logic.tcl_DHT

20 lines
548 B
Plaintext
Raw Permalink Normal View History

2022-08-24 08:18:01 +02:00
#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
}