DzVents JSON with SHT3x-0x44 sensor
Posted: Saturday 15 February 2020 20:57
Hello,
I am new to this forum, so please let me know if this topic should be put somewhere else.
At this moment I use a Sonoff S20 with tasmota firmware and a BME280 sensor connected to it.
I have no problems at all with this code (will show the problem in a bit!)
I send a http request :
which receives:
Update the temperature and baro to a sensor in Domoticz:
The problem occurrs with my new SHT-31 sensor wich names itself SHT3X-0x44
The resonse:
The code I use to get the value is the same:
But (off course) the code doesn't get the "-0x44". I tried to work around it but that doesn't solved the problem...
Does anybody know a workaround for this?
Thanks in advance.
I am new to this forum, so please let me know if this topic should be put somewhere else.
At this moment I use a Sonoff S20 with tasmota firmware and a BME280 sensor connected to it.
I have no problems at all with this code (will show the problem in a bit!)
I send a http request :
Code: Select all
http://192.168.10.4/cm?cmnd=status%2010
Code: Select all
{
"StatusSNS": {
"Time": "2020-02-15T20:37:04",
"BMP180": {
"Temperature": 17.3,
"Pressure": 1008.4
},
"PressureUnit": "hPa",
"TempUnit": "C"
}
}
Code: Select all
if (item.isHTTPResponse) then
if (item.statusCode == 200) then
if (item.isJSON) then
local myTemperature = item.json.StatusSNS.BMP180.Temperature
local myPressure = item.json.StatusSNS.BMP180.Pressure
-- update device in Domoticz
domoticz.devices('Sonoff_TB').updateTempHumBaro(myTemperature,'0','0', myPressure)
The resonse:
Code: Select all
{
"StatusSNS": {
"Time": "2020-02-15T20:45:10",
"SHT3X-0x44": {
"Temperature": 19.6,
"Humidity": 54.1
},
"TempUnit": "C"
}
}
Code: Select all
local myTemperature = item.json.StatusSNS.SHT3X-0X44.Temperature
Code: Select all
local myTemperature = item.json.StatusSNS.'SHT3X-0X44'.Temperature
and
local myTemperature = item.json.StatusSNS."SHT3X-0X44".Temperature
Thanks in advance.