Tuya smoke alarm – binary_sensor not created in Home Assistant (BitmapTypeInformation error)

Summary: Tuya smoke alarm – missing binary_sensor in Home Assistant (BitmapTypeInformation error)

Environment

Home Assistant version : 2025.12.2
Installation type : Home Assistant OS
Python version : 3.13.9
Architecture : aarch64
Tuya integration : Built-in (cloud / official)
Device category : ywbj (Smart Smoke Alarm)
Product name : Smart Smoke Alarm
Product ID : gf9dejhmzffgdyfj

Issue Description

The Tuya smoke alarm is correctly added to Home Assistant using the official Tuya
cloud integration. Battery level, battery state, and mute switch work correctly.

However, no binary_sensor entity is created for smoke detection.
The most important entity (binary_sensor.smoke) is completely missing.

Relevant Error Log

Error while setting up tuya platform for binary_sensor:

BitmapTypeInformation.init() got an unexpected keyword argument ‘maxlen’

Traceback (most recent call last):
File “homeassistant/helpers/entity_platform.py”, line 451, in _async_setup_platform
await asyncio.shield(awaitable)
File “homeassistant/components/tuya/binary_sensor.py”, line 436, in async_setup_entry
async_discover_device([*manager.device_map])
File “homeassistant/components/tuya/binary_sensor.py”, line 395, in _get_dpcode_wrapper
return DPCodeBitmapBitWrapper.find_dpcode(…)
File “homeassistant/components/tuya/models.py”, line 132, in from_json
return cls(…, **parsed)

TypeError: BitmapTypeInformation.init() got an unexpected keyword argument ‘maxlen’

Because of this error, the Tuya binary_sensor platform fails to initialize,
preventing smoke-related entities from being created.

Device Data (Tuya API)

The Tuya API confirms that smoke detection data is available and exposed as an Enum:

“status_range”: {
“smoke_sensor_status”: {
“type”: “Enum”,
“value”: {
“range”: [“alarm”, “normal”]
}
}
}

Current device status:
“status”: {
“smoke_sensor_status”: “normal”
}

Expected vs Actual Behavior

Expected:

  • Create a binary sensor mapped from smoke_sensor_status
  • alarm → binary_sensor = ON
  • normal → binary_sensor = OFF
  • Device class: smoke

Actual:

  • No smoke-related binary_sensor is created
  • Tuya binary_sensor platform fails during setup

Observations

  • Smoke detection data is present in Tuya cloud
  • This is not a device or Tuya API limitation
  • Likely a regression in Home Assistant 2025.12.x
  • Other Tuya entities (battery, mute switch) work correctly
  • Downgrading to a pre-2025.12 version reportedly restores functionality

Even though the device itself reports smoke detection correctly.