I had exactly the same problem: HTU21D sensor was correctly connected and configured, but didn’t work with Home Assistant. What I was seeing in the log file was either error “Bad reading: 5” or “Bad writing in bus: 121”, followed by “HTU21D sensor not detected in bus 1”. Searching for these errors didn’t give me anything…
I followed this post to download and build a C program that could actually give me some temperature/humidity values. So far, I could confirm that the sensor itself is wired properly and works.
I dug a bit deeper and tried to use the python library that Home Assistant was using to read HTU21D data (the hass module was written by the same guy), and confirmed that the test command i2csense -s htu21d
resulted in the same errors, either 5 or 121, as above. Now I could see that these errors come from either write_byte or read_i2c_block_data in the smbus package. That was a clue…
Finally, I was able to find a workaround from somebody with similar symptoms: using an old I2C module driver, i2c_bcm2708, instead of the new one.
ls -la i2c1*
-rwxr-xr-x 1 root root 886 Aug 7 01:53 i2c1-bcm2708.dtbo
As for how I am surviving in the meantime, I rolled back to an old version I had backed up last summer. It took a while to bring the interfaces up to date, but at least it works and I have heat again.
Home Automation is still for the tech-savvy, I am afraid, i.e., not ready for hoi polloi use.