This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dh22 [2021/12/19 19:58] – admin | dh22 [2021/12/19 20:07] (current) – admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== DH22 ====== | + | ====== DH22 - HomeAssistant |
+ | |||
+ | Get values (temperature and humidity) from DH22, round the values and send it to HomeAssistant | ||
<code python> | <code python> | ||
# | # | ||
- | import os, sys | ||
import Adafruit_DHT | import Adafruit_DHT | ||
import time | import time | ||
import requests | import requests | ||
- | import html | ||
def sendData(name, | def sendData(name, | ||
Line 31: | Line 31: | ||
now = time.strftime(' | now = time.strftime(' | ||
- | sendData(' | + | sendData(' |
- | sendData(' | + | sendData(' |
print('" | print('" |