Page 1 of 1

Domoticz can not see sht20

Posted: Friday 05 July 2019 16:05
by shef692003
How to connect to domoticz sensor sht20? Good work oа raspberry pi in the python program, but does not see domoticz.

Re: Domoticz can not see sht20

Posted: Thursday 08 August 2019 20:01
by Marcinek40
import smbus
import time
import requests

# Get I2C bus
bus = smbus.SMBus(1)

# SHT30 address, 0x44(68)
# Send measurement command, 0x2C(44)
# 0x06(06) High repeatability measurement
bus.write_i2c_block_data(0x44, 0x2C, [0x06])

time.sleep(0.5)

# SHT30 address, 0x44(68)
# Read data back from 0x00(00), 6 bytes
# cTemp MSB, cTemp LSB, cTemp CRC, Humididty MSB, Humidity LSB, Humidity CRC
data = bus.read_i2c_block_data(0x44, 0x00, 6)

# Convert the data
cTemp = ((((data[0] * 256.0) + data[1]) * 175) / 65535.0) - 45
fTemp = cTemp * 1.8 + 32
humidity = 100 * (data[3] * 256 + data[4]) / 65535.0

url = "http://192.168.1.71:8080/json.htm?type= ... =%.2f;%.2f" % (cTemp, humidity)
requests.get(url)



print "Wilgotnosc : %.2f %% " %humidity
print "Temp : %.2f C" %cTemp

Re: Domoticz can not see sht20

Posted: Thursday 08 August 2019 20:02
by Marcinek40
cron


*/5 * * * * python /home/pi/domoticz/scripts/SHT30.py

Re: Domoticz can not see sht20

Posted: Thursday 08 August 2019 20:03
by Marcinek40

Re: Domoticz can not see sht20

Posted: Thursday 08 August 2019 20:04
by Marcinek40

Re: Domoticz can not see sht20

Posted: Thursday 21 November 2019 8:21
by Marjorie
To change the update interval (teleperiod) of MQTT messages change the TelePeriod. Default interval is 300 seconds but can be set between 10 and 3600 seconds Upsers