Hello!
I tried to flash the Heiman tuya smoke sensor, with a CBU chipset. I was successful, but as I can see there is no UART communication between the CBU and the sub-device (internal), plus as I can see there is very little info outside:
ESPHome config:
esphome:
name: rilevatore-fumo-caldaia
friendly_name: Rilevatore Fumo Caldaia
name_add_mac_suffix: false
bk72xx:
board: cbu
logger:
level: VERBOSE
baud_rate: 0
web_server:
captive_portal:
mdns:
api:
password: !secret api
ota:
platform: esphome
password: !secret ota
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
button:
- platform: restart
name: Restart
debug:
update_interval: 30s
text_sensor:
- platform: debug
reset_reason:
name: Reset Reason
- platform: template
id: tuya_smoke_sensor_state
name: (Unconfirmed) Smoke Sensor State
filters:
- map:
- 0 -> Alarm
- 1 -> Normal
- platform: template
id: tuya_checking_result
name: (Unconfirmed) Checking Result
filters:
- map:
- 0 -> Checking
- 1 -> Check_Success
- 2 -> Check_Failure
- platform: template
id: tuya_battery_state
name: (Unconfirmed) Battery State
filters:
- map:
- 0 -> Low
- 1 -> Middle
- 2 -> High
sensor:
- platform: uptime
name: Uptime
- platform: tuya
sensor_datapoint: 15
name: (Unconfirmed) Battery Percentage
unit_of_measurement: "%"
uart:
rx_pin: RX1
tx_pin: TX1
baud_rate: 9600
data_bits: 8
parity: NONE
stop_bits: 1
debug:
time:
- platform: sntp
id: timer
tuya:
time_id: timer
# DPIDs processed from schema model: 000003h3i2
on_datapoint_update:
- sensor_datapoint: 1
datapoint_type: enum
then:
- text_sensor.template.publish:
id: tuya_smoke_sensor_state
state: !lambda "return std::to_string(x);"
- sensor_datapoint: 9
datapoint_type: enum
then:
- text_sensor.template.publish:
id: tuya_checking_result
state: !lambda "return std::to_string(x);"
- sensor_datapoint: 14
datapoint_type: enum
then:
- text_sensor.template.publish:
id: tuya_battery_state
state: !lambda "return std::to_string(x);"
switch:
- platform: tuya
switch_datapoint: 16
name: (Unconfirmed) Muffling
LOGS
[12:52:09][I][app:100]: ESPHome version 2024.12.4 compiled on Feb 5 2025, 12:13:22
[12:52:09][C][wifi:600]: WiFi:
[12:52:09][C][wifi:428]: Local MAC: C4:82:E1:C3:78:2F
[12:52:09][C][wifi:433]: SSID: 'Privata'[redacted]
[12:52:09][C][wifi:436]: IP Address: 192.168.178.66
[12:52:09][C][wifi:439]: BSSID: 60:B5:8D:B1:8C:73[redacted]
[12:52:09][C][wifi:441]: Hostname: 'rilevatore-fumo-caldaia'
[12:52:09][C][wifi:443]: Signal strength: -44 dB ▂▄▆█
[12:52:09][V][wifi:445]: Priority: 0.0
[12:52:09][C][wifi:447]: Channel: 1
[12:52:09][C][wifi:448]: Subnet: 255.255.255.0
[12:52:09][C][wifi:449]: Gateway: 192.168.178.1
[12:52:09][C][wifi:450]: DNS1: 192.168.178.1
[12:52:09][C][wifi:451]: DNS2: 192.168.178.1
[12:52:09][C][logger:185]: Logger:
[12:52:09][C][logger:186]: Level: VERBOSE
[12:52:09][C][logger:188]: Log Baud Rate: 0
[12:52:09][C][logger:189]: Hardware UART: DEFAULT
[12:52:09][C][uart.lt:101]: UART Bus:
[12:52:09][C][uart.lt:102]: Type: hardware
[12:52:09][C][uart.lt:104]: Port number: 1
[12:52:09][C][uart.lt:106]: TX Pin: 11
[12:52:09][C][uart.lt:107]: RX Pin: 10
[12:52:09][C][uart.lt:109]: RX Buffer Size: 256
[12:52:09][C][uart.lt:111]: Baud Rate: 9600 baud
[12:52:09][C][uart.lt:112]: Data Bits: 8
[12:52:09][C][uart.lt:113]: Parity: NONE
[12:52:09][C][uart.lt:114]: Stop bits: 1
[12:52:09][C][template.text_sensor:020]: Template Sensor '(Unconfirmed) Smoke Sensor State'
[12:52:09][C][template.text_sensor:020]: Template Sensor '(Unconfirmed) Checking Result'
[12:52:09][C][template.text_sensor:020]: Template Sensor '(Unconfirmed) Battery State'
[12:52:09][C][uptime.sensor:033]: Uptime Sensor 'Uptime'
[12:52:09][C][uptime.sensor:033]: Device Class: 'duration'
[12:52:09][C][uptime.sensor:033]: State Class: 'total_increasing'
[12:52:09][C][uptime.sensor:033]: Unit of Measurement: 's'
[12:52:09][C][uptime.sensor:033]: Accuracy Decimals: 0
[12:52:09][C][uptime.sensor:033]: Icon: 'mdi:timer-outline'
[12:52:09][V][uptime.sensor:033]: Unique ID: 'c482e1c3782f-uptime'
[12:52:09][C][uptime.sensor:034]: Type: Seconds
[12:52:09][C][restart.button:017]: Restart Button 'Restart'
[12:52:09][C][restart.button:017]: Icon: 'mdi:restart'
[12:52:09][C][tuya.sensor:029]: Tuya Sensor '(Unconfirmed) Battery Percentage'
[12:52:09][C][tuya.sensor:029]: State Class: ''
[12:52:09][C][tuya.sensor:029]: Unit of Measurement: '%'
[12:52:09][C][tuya.sensor:029]: Accuracy Decimals: 0
[12:52:09][C][tuya.sensor:030]: Sensor has datapoint ID 15
[12:52:09][C][tuya.switch:068]: Tuya Switch '(Unconfirmed) Muffling'
[12:52:09][C][tuya.switch:090]: Restore Mode: always OFF
[12:52:09][C][tuya.switch:024]: Switch has datapoint ID 16
[12:52:09][C][captive_portal:089]: Captive Portal:
[12:52:09][C][web_server:153]: Web Server:
[12:52:09][C][web_server:154]: Address: rilevatore-fumo-caldaia.local:80
[12:52:09][C][sntp:042]: SNTP Time:
[12:52:09][C][sntp:045]: Server 0: '0.pool.ntp.org'
[12:52:09][C][sntp:045]: Server 1: '1.pool.ntp.org'
[12:52:09][C][sntp:045]: Server 2: '2.pool.ntp.org'
[12:52:09][C][mdns:116]: mDNS:
[12:52:09][C][mdns:117]: Hostname: rilevatore-fumo-caldaia
[12:52:09][V][mdns:118]: Services:
[12:52:09][V][mdns:120]: - _esphomelib, _tcp, 6053
[12:52:09][V][mdns:122]: TXT: friendly_name = Rilevatore Fumo Caldaia
[12:52:09][V][mdns:122]: TXT: version = 2024.12.4
[12:52:09][V][mdns:122]: TXT: mac = c482e1c3782f
[12:52:09][V][mdns:122]: TXT: platform = BK7231N
[12:52:09][V][mdns:122]: TXT: board = cbu
[12:52:09][V][mdns:122]: TXT: network = wifi
[12:52:09][V][mdns:120]: - _http, _tcp, 80
[12:52:09][C][esphome.ota:073]: Over-The-Air updates:
[12:52:09][C][esphome.ota:074]: Address: rilevatore-fumo-caldaia.local:8892
[12:52:09][C][esphome.ota:075]: Version: 2
[12:52:09][C][esphome.ota:078]: Password configured
[12:52:09][C][safe_mode:018]: Safe Mode:
[12:52:09][C][safe_mode:019]: Boot considered successful after 60 seconds
[12:52:09][C][safe_mode:021]: Invoke after 10 boot attempts
[12:52:09][C][safe_mode:022]: Remain in safe mode for 300 seconds
[12:52:09][C][api:140]: API Server:
[12:52:09][C][api:141]: Address: rilevatore-fumo-caldaia.local:6053
[12:52:09][C][api:145]: Using noise encryption: NO
[12:52:09][C][lt.component:013]: LibreTiny:
[12:52:09][C][lt.component:014]: Version: v1.7.0 on cbu, compiled at Feb 5 2025 11:55:48, GCC 10.3.1 (-O1)
[12:52:09][C][lt.component:015]: Loglevel: 3
[12:52:09][C][debug:021]: Debug component:
[12:52:09][D][debug:035]: ESPHome version 2024.12.4
[12:52:09][D][debug:039]: Free Heap Size: 29488 bytes
[12:52:09][D][debug:016]: LibreTiny Version: 1.7.0
[12:52:09][D][debug:017]: Chip: BK7231N (7b1c) @ 120 MHz
[12:52:09][D][debug:018]: Chip ID: 0x2F78C3
[12:52:09][D][debug:019]: Board: cbu
[12:52:09][D][debug:020]: Flash: 2048 KiB / RAM: 256 KiB
[12:52:09][D][debug:021]: Reset Reason: SW Reboot
[12:52:09][V][text_sensor:013]: 'Reset Reason': Received new state SW Reboot
[12:52:09][D][text_sensor:064]: 'Reset Reason': Sending state 'SW Reboot'
[12:52:09][C][tuya:041]: Tuya:
[12:52:09][C][tuya:044]: Initialization failed. Current init_state: 0
[12:52:09][C][tuya:049]: If no further output is received, confirm that this is a supported Tuya device.
[12:52:18][V][wifi_lt:353][wifievent]: Event: AP client connected MAC=00:00:00:00:00:00
[12:52:18][V][tuya:438]: Sending Tuya: CMD=0x00 VERSION=0 DATA=[] INIT_STATE=0
[12:52:19][D][uart_debug:114]: >>> 55:AA:00:00:00:00:FF
[12:52:19][V][tuya:438]: Sending Tuya: CMD=0x00 VERSION=0 DATA=[] INIT_STATE=0
[12:52:19][D][uart_debug:114]: >>> 55:AA:00:00:00:00:FF
[12:52:19][V][tuya:438]: Sending Tuya: CMD=0x00 VERSION=0 DATA=[] INIT_STATE=0
[12:52:19][D][uart_debug:114]: >>> 55:AA:00:00:00:00:FF
[12:52:19][V][tuya:438]: Sending Tuya: CMD=0x00 VERSION=0 DATA=[] INIT_STATE=0
[12:52:19][D][uart_debug:114]: >>> 55:AA:00:00:00:00:FF
[12:52:20][V][tuya:438]: Sending Tuya: CMD=0x00 VERSION=0 DATA=[] INIT_STATE=0
[12:52:20][D][uart_debug:114]: >>> 55:AA:00:00:00:00:FF
[12:52:20][E][tuya:464]: Initialization failed at init_state 0
does anyone know what’s the magic in such devices?
As I understand there is another MCU who controls wifi on and off, and that dialogs with the primary MCU for anything else, but little I found outside in the web, and whatever I found or read didn’t give me much info for the specific case (this is a battery powered device, but in this specific case I’m powering it with a bench regulated transformer output.