ตั้งเวลาเปิดพัดลมให้แมวด้วย Python กับ DHT11
1.ติดตั้งสิ่งที่จำเป็น  sudo apt-get install git-core  sudo apt - get install build - essential python - dev  git clone https :// github . com / adafruit / Adafruit_Python_DHT . git  cd  Adafruit_Python_DHT  sudo python setup . py install   2.แก้ไข code ตัวอย่างสำหรับตรวจสอบอุณหภูมิ  cd Adafruit_Python_DHT/examples  nano  AdafruitDHT.py  แก้ตรงส่วนเช็คอุณหภูมิด้านล่างของไฟล์ ถ้าอุณหภูมิสูงกว่า 27 องศา return ค่าเป็น 1  humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)  if humidity is not None and temperature is not None:      if temperature > 27:          print 1      else:          print 0   else:      print('Error')    3.สร้างไฟล์ dht11mqtt.h  เพื่อเรียกใช้ python แล้วสั่งไปที่ MQTT Broker อีกที ( 11  คือ DHT 11 , 4  คือ GPIO 4 )  #!/bin/bash  result=`python /home/pi/Adafruit_Python_DHT/examples/AdafruitDHT.py "11" "4"`  if [ $result == "1" ]; then      echo "hot"    ...
 
