pattern.manufacturer in project/server/src/service/derive/derivable/device/rules.ts contains:
"_T%", // tuya whitelabel devices (insufficient data quality)
Tuya whitelabel manufacturers arrive as _TZ3000_... / _TZE200_..., so the intent is a literal underscore followed by T. But the rule is applied in device-insert.sql as a bare LIKE with no ESCAPE clause:
ssd1.manufacturer like r.value
In SQLite, _ is a single-character LIKE wildcard, and LIKE is case-insensitive for ASCII. So _T% matches any manufacturer whose second character is T — not just the Tuya prefixes.
Confirmed in production
GET /api/unstable/dimensions returns 1258 manufacturers. Not one of them has T as its second character.
Names that should be there and are not: Athom, ITEAD, Etekcity, Stelpro, Steinel, STMicroelectronics, Atlantic, Otio.
The S block of the live list is the clearest tell — Samsung, Signify, Siemens, Shelly, Synology, Seagate, Somfy, SONOFF, Sonos, Sunricher, Schneider Electric, SMLIGHT, Sagemcom, sengled — and not a single St... brand anywhere in 1258 manufacturers.
Athom is likely the most costly single loss, being a fairly common ESPHome hardware vendor.
Fix
Both halves are needed, or the pattern still doesn't mean what it says.
device-insert.sql (the manufacturer join, and the model join below it for consistency):
ssd1.manufacturer like r.value escape '\'
rules.ts:
"\_T%", // tuya whitelabel devices (insufficient data quality)
The other patterns are unaffected: 0x%, TUYA%, %ONVIF% and %???% contain no underscore, and ? is not a LIKE metacharacter.
Happy to open the PR if that's useful.
pattern.manufacturerinproject/server/src/service/derive/derivable/device/rules.tscontains:Tuya whitelabel manufacturers arrive as
_TZ3000_.../_TZE200_..., so the intent is a literal underscore followed byT. But the rule is applied indevice-insert.sqlas a bareLIKEwith noESCAPEclause:In SQLite,
_is a single-characterLIKEwildcard, andLIKEis case-insensitive for ASCII. So_T%matches any manufacturer whose second character is T — not just the Tuya prefixes.Confirmed in production
GET /api/unstable/dimensionsreturns 1258 manufacturers. Not one of them has T as its second character.Names that should be there and are not:
Athom,ITEAD,Etekcity,Stelpro,Steinel,STMicroelectronics,Atlantic,Otio.The
Sblock of the live list is the clearest tell — Samsung, Signify, Siemens, Shelly, Synology, Seagate, Somfy, SONOFF, Sonos, Sunricher, Schneider Electric, SMLIGHT, Sagemcom, sengled — and not a singleSt...brand anywhere in 1258 manufacturers.Athom is likely the most costly single loss, being a fairly common ESPHome hardware vendor.
Fix
Both halves are needed, or the pattern still doesn't mean what it says.
device-insert.sql(the manufacturer join, and the model join below it for consistency):rules.ts:The other patterns are unaffected:
0x%,TUYA%,%ONVIF%and%???%contain no underscore, and?is not aLIKEmetacharacter.Happy to open the PR if that's useful.