SHT-31 temp/humidity sensor shows Temperature but not humidity. debug log does show a humidity value

I’ve hooked up a SHT-31 sesnor via the I2C and I can see in the debug log that it is getting a value for humidity, but when I look at the live reading it reports no data.

heres the line the debug spits out:

2023-11-03 16:23:33,903 - DEBUG - mycodo.controllers.controller_input_ab667dfa - Adding measurements to InfluxDB with ID ab667dfa-7296-41c0-b514-4d6039196144: {0: {‘measurement’: ‘temperature’, ‘unit’: ‘C’, ‘value’: 20.599298084992753, ‘timestamp_utc’: datetime.datetime(2023, 11, 3, 15, 23, 33, 862885)}, 1: {‘measurement’: ‘humidity’, ‘unit’: ‘percent’, ‘value’: 66.84977492942703, ‘timestamp_utc’: datetime.datetime(2023, 11, 3, 15, 23, 33, 862936)}, 2: {‘measurement’: ‘dewpoint’, ‘unit’: ‘C’, ‘value’: 14.219206667645034, ‘timestamp_utc’: datetime.datetime(2023, 11, 3, 15, 23, 33, 863065)}, 3: {‘measurement’: ‘vapor_pressure_deficit’, ‘unit’: ‘Pa’, ‘value’: 804.2017727141616, ‘timestamp_utc’: datetime.datetime(2023, 11, 3, 15, 23, 33, 863169)}}

Specifically: 1: {‘measurement’: ‘humidity’, ‘unit’: ‘percent’, ‘value’: 66.84977492942703, ‘timestamp_utc’: datetime.datetime(2023, 11, 3, 15, 23, 33, 862936)}
seems to suggest that mycodo is getting a humidity reading from the sensor. I’m not sure why its not making it to the live readings page.

Any ideas on what I can do to fix this?

I’ve tried both SHT-31-D and SHT-3* input devices

Configure → Diagnostics → Recreate InfluxDB Database

1 Like


Well that was fast, Thanks! Should I have been able to catch this on my own? I feel a little silly asking something that has such a trivial fix.

The issue is not obvious. It took me a while to figure out the issue, and it’s the very reason I added those options to the Diagnostic page. If influxdb receives an integer as it’s first value for a measurement, any subsequent decimal/float values added will not be stored. Even stranger is all values are cast as float before being stored, so the issue shouldn’t occur. I haven’t been able to reliably reproduce the issue, so I can’t really debug it further.