Tuya smoke detector (some progress)

Hi,

I got myself 2 of these Tuya smoke detectors.

Since the HA Tuya integration can not support smoke detectors (due to missing support in the Tuya API) I tried flashing one of these using tuya-convert, then flashed tasmota, downgraded to the 7.x tasmota-minimal and then flashed esphome with this config:

substitutions:
  devicename: esp_smoke_01
  upper_devicename: Smoke 01

esphome:
  name: $devicename
  platform: ESP8266
  board: esp01_1m
  
wifi:
  ssid: !secret esphome_wifi_ssid
  password: !secret esphome_wifi_password
  # enable the fallback hotspot
  ap:
    ssid: $devicename
    password: "qwe12345"

captive_portal:
  
api:
  password: !secret esphome_api_password

ota:
  password: !secret esphome_ota_password
  
logger:
  baud_rate: 0

text_sensor:
  - platform: version
    name: ${upper_devicename}_firmware_version
    
binary_sensor:
  - platform: status
    name: ${upper_devicename}_status
    
uart:
  - id: com_1
    rx_pin: GPIO1
    tx_pin: GPIO3
    baud_rate: 9600
    
tuya:
[20:14:13][I][app:101]: ESPHome version 1.15.0-dev compiled on Jun  2 2020, 20:13:42
[20:14:13][C][wifi:415]: WiFi:
[20:14:13][C][wifi:283]:   SSID: [redacted]
[20:14:13][C][wifi:284]:   IP Address: 192.168.2.222
[20:14:13][C][wifi:286]:   BSSID: [redacted]
[20:14:13][C][wifi:287]:   Hostname: 'esp_smoke_01'
[20:14:13][C][wifi:291]:   Signal strength: -61 dB ā–‚ā–„ā–†ā–ˆ
[20:14:13][C][wifi:295]:   Channel: 1
[20:14:13][C][wifi:296]:   Subnet: 255.255.255.0
[20:14:13][C][wifi:297]:   Gateway: 192.168.2.1
[20:14:13][C][wifi:298]:   DNS1: 192.168.2.1
[20:14:13][C][wifi:299]:   DNS2: (IP unset)
[20:14:13][C][uart_esp8266:071]: UART Bus:
[20:14:13][C][uart_esp8266:073]:   TX Pin: GPIO3
[20:14:13][C][uart_esp8266:076]:   RX Pin: GPIO1
[20:14:13][C][uart_esp8266:078]:   Baud Rate: 9600 baud
[20:14:13][C][uart_esp8266:079]:   Bits: 8
[20:14:13][C][uart_esp8266:080]:   Parity: NONE
[20:14:13][C][uart_esp8266:081]:   Stop bits: 1
[20:14:13][C][uart_esp8266:085]:   Using software serial
[20:14:13][C][logger:175]: Logger:
[20:14:13][C][logger:176]:   Level: DEBUG
[20:14:13][C][logger:177]:   Log Baud Rate: 0
[20:14:13][C][logger:178]:   Hardware UART: UART0
[20:14:13][C][status:034]: Status Binary Sensor 'Smoke 01_status'
[20:14:13][C][status:034]:   Device Class: 'connectivity'
[20:14:13][C][version.text_sensor:015]: Version Text Sensor 'Smoke 01_firmware_version'
[20:14:13][C][version.text_sensor:015]:   Icon: 'mdi:new-box'
[20:14:13][C][captive_portal:169]: Captive Portal:
[20:14:13][C][web_server:131]: Web Server:
[20:14:13][C][web_server:132]:   Address: esp_smoke_01.local:80
[20:14:13][C][ota:029]: Over-The-Air Updates:
[20:14:13][C][ota:030]:   Address: esp_smoke_01.local:8266
[20:14:13][C][ota:032]:   Using Password.
[20:14:13][C][api:095]: API Server:
[20:14:13][C][api:096]:   Address: esp_smoke_01.local:6053
[20:14:13][C][wifi_signal.sensor:009]: WiFi Signal 'Smoke 01_Wi-Fi_Signal'
[20:14:13][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dB'
[20:14:13][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[20:14:13][C][wifi_signal.sensor:009]:   Icon: 'mdi:wifi'
[20:14:13][C][tuya:023]: Tuya:
[20:14:13][C][tuya:026]:   Configuration will be reported when setup is complete. Current init_state: 0
[20:14:13][C][tuya:027]:   If no further output is received, confirm that this is a supported Tuya device.

Also tried GPIO13 and 15. NO go.

Itā€™s sort of usable, because pressing the test button, connects to wifi, status changes to ON and therefore is useable as a smoke detector in HA.

It would be a lot better if it would also report battery status when pressing the test buttonā€¦

When pressing the test-button for +5 seconds, it LED starts flashing fast and will remain connected to Wifi for flashing firmware. It works fast, reliable and perfect!

If anyone knows how to get the few remaining bits and pieces working, please post them here :slight_smile:

Apparently these have an additional microcontroller on them, which will make things considerably more challenging. Iā€™d recommend keeping an eye on the Tasmota community to see what, if anything, they figure out.

See also:

Any news here? :blush:

Just a guess, as in other tywe3s device, could you try to swap rx and tx:

uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 9600

Hi all, i have no success with tuya integration too (YG400A). So i tried other way. I just looked in datasheet for BL5980 (Low Voltage Photoelectric Smoke Detector ASIC). It has one pin for ,alarm state,. So i connect it to TYWE3S (pin 13) and vcc pin to power (because of managed power supply for TYWE3S by smoke alarm MCU (N76E003)). And it worksā€¦ See attachments.

20210614_143800|236x500

esphome:
  name: firesensor
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "*********"
  password: "**************"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Firesensor Fallback Hotspot"
    password: "58JM3ExEMeli"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "*********"

ota:
  password: "*********"
  
binary_sensor:
  - platform: gpio
    pin: 
      number: 13
      inverted: True
    name: "Smoke sensor"
    
switch:
  - platform: gpio
    pin: 13
    id: switchSmoke
    name: "SmokeSensorBackStep"
    on_turn_off:
    - delay: 500ms
    - switch.turn_on: switchSmoke
3 Likes

hi Peter! sounds great! do you have any experience regarding battery life (standard or lithium) and is it possible to get the % of the battery too?

Hi everyone,

just got my smoke detectors. Unfortunately they came with an up-to-date firmware because of which OTA flashing doesnā€™t currently work. So I was considering to attempt the serial flashing method.

Maybe a stupid question - but how do I open the case? I canā€™t seem to find any hooks or anything and donā€™t want to damage it.

To open the case I used a flat screw driver or plastic tool in the 3 slots in the bottom. The top part then pops off.

Iā€™ve copied the ops code and encountered the same error on initializing. I gather there is no more progress for esphome on these?