Domoticz can not see sht20

Moderator: leecollings

Post Reply
shef692003
Posts: 2
Joined: Friday 05 July 2019 8:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Domoticz can not see sht20

Post by shef692003 »

How to connect to domoticz sensor sht20? Good work oа raspberry pi in the python program, but does not see domoticz.
Attachments
sht20.jpg
sht20.jpg (75.61 KiB) Viewed 1696 times
Marcinek40
Posts: 5
Joined: Sunday 07 April 2019 11:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz can not see sht20

Post 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
Marcinek40
Posts: 5
Joined: Sunday 07 April 2019 11:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz can not see sht20

Post by Marcinek40 »

cron


*/5 * * * * python /home/pi/domoticz/scripts/SHT30.py
Marcinek40
Posts: 5
Joined: Sunday 07 April 2019 11:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz can not see sht20

Post by Marcinek40 »

Marcinek40
Posts: 5
Joined: Sunday 07 April 2019 11:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz can not see sht20

Post by Marcinek40 »

Marjorie
Posts: 1
Joined: Thursday 21 November 2019 8:17
Target OS: Linux
Domoticz version:
Contact:

Re: Domoticz can not see sht20

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest