esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

SHTC3 sensor misdetected as SHTC1 #3206

Closed nagyrobi closed 2 years ago

nagyrobi commented 2 years ago

The problem

Follow-up from https://discord.com/channels/429907082951524364/961539695270060052

SHTC3 sensor datasheet states that sensor should be identified with a binary pattern (paragraph 5.9, pages 8/9): image

ESPHome reads this register but only compares the result against hex value 0x847 which is binary 100001000111.

My sensor has register ID 0x887 which is binary 100010000111. Both numbers comply with the truth table from the doc.

esphome 0x847 ->    100001000111
mine    0x887 ->    100010000111
pattern from doc xxx1xxxxx000111

I assume that not only these numbers could be valid as the docs state the other bits marked as x as being unspecified info - seems I've ran exactly into such a case.

Detection of the SHTC3 needs to be fixed to match any binary number in the pattern xxx1xxxxx000111 as stated by the doc, as seems the factory releases chips with various other bits in the unspecified info area of the number.

Which version of ESPHome has the issue?

v2022.4.0-dev

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2022.4

What platform are you using?

ESP8266

Board

TYWE2S

Component causing the issue

shtcx

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Worth applying @ssieb 's patch from https://discord.com/channels/429907082951524364/961539695270060052/961684862874554388 to show the register ID in the dump config logs too, for people to check this number not only in serial logging (like Model: SHTC3 (0887).

nagyrobi commented 2 years ago

The PR above fixes it.