Tuya Bluetooth AM43 curtain motor

I have a tuya bluetooth AM43 motor curtain device. It is bluetooth only. Not wifi, not zigbee.

Model is AM43-0.45/40-ES-EB [TY]

I am looking for a way to control this via HA (via esphome, or direct bluetooth or any option).

Has anyone run into these ones and made them work? there are other versions of the same devices that use zigbee but not this one.



I’ve used esp32 as gateway AM43 blinds control through MQTT - #119 by akrigator

well i tried that before. However my device is the Tuya Bluetooth version. So this didn’t work. From the website

This component does NOT support Tuya-based versions of this
device as the protocol is completely different. If your device is 
controlled with the SmartLife app, then it will not work.

Any ideas? was your device the tuya bluetooth or generic bluetooth?

Oh, i did not get attention on tuya. However the main board looks same as mine. Previously i’ve resolder bluetooth with esp 8266 to have direct wifi control (GitHub - Smoria/AM43-WiFi: AM43 blinds engine to WiFi MQTT conversion). But in this cases it drains battery in several hours, so it should constantly powered by dc adapter

interesting project. Looking at the pictures on your GIthub, the board looks quite different, so i don’t know if this conversion will work. I am not sure that the Tuya BLE version i have is based on an ESP32 or something else. But i think it is a good idea to remove that i put an ESP32 in place, so i have the felixbility to do wifi and BLE. Ideally BLE to keep battery consumption low. Do you have any info on the interface for reading the position encoder and controlling the position in the rest of the board?

looks like my board has this:

Tuya BLE interface

i guess that tuya uses same commands to communicate with MCU as non-tuya

Hey, did you ever manage to set these blinds up in HomeAssistant? I think I have the same set as you and trying to find a solution on how to control them in HA

Hi, I have a Tuya Bluetooth AM43 with TYBT4L chip. Has anyone managed to connect this device to HA locally via BT without any hardware modification? I can provide diagnostic data if it is within my capabilities.

This is interesting, very inspiring modification.

I’m currently attempting at reverse engineering the device for support GitHub - pantherale0/ha_tuya_ble: Home Assistant support for Tuya BLE devices

I can get position, (datapoint 3) but unsure how to actually control the device yet. Have asked manufacture for the UART protocol, but if you can grab any communication between the BLE module and the MCU while adjusting we might be able to find the rest of the datapoints.


Datapoints I’ve discovered so far:

2 = Set position
3 = Position (RAW, reverse logic, 0 = 100, 100 = 0)
5 = UNKNOWN (ENUM)
101 = UNKNOWN (ENUM, maybe direction?)
103 = UNKNOWN (BOOL)
104 = UNKNOWN (BOOL)
105 = Speed

Setting DP 3 directly to a value does not appear to work or do anything in terms of blind control, looking at the similar zigbee devices, 2 is also a position so maybe that needs to be set instead.

EDIT: I can now control my device with the help of a esphome bluetooth proxy. Although states are not currently correct.

(zigbee-herdsman-converters/src/devices/tuya.ts at 7d058d9ae369853005a6533d8111fb390a1ed29e · Koenkk/zigbee-herdsman-converters · GitHub)

Just an update on this, the Tuya BLE component that I forked now mostly works (at least on setting the position anyway). The states are pretty much as good as they’ll get (as this device likes to spam messages sometimes).

Great. Looks like there are many versions of this device. I installed your fork, but unfortunately my device is not found.

After adding the integration and then filling out the form with ‘Tuya credentials’, I get the message “Tuya BLE - No unconfigured devices found”.

Same for paired and not paired device in Tuya app.

In Tuya - Home Assistant it reports as Blinds Drive-BLE (qqdxfdht).

obraz

Have you got a bluetooth proxy near it? I’ve noticed that unless it’s in the same room as a BT proxy or the host itself, it won’t connect (same with my phone).

Might be worth to try resetting it? There are a few variations of the same device and looks like your product id is different to mine so will have to add that into the integration anyway

FWIW, I don’t have a gateway or anything else. Just paired with the Smart Life app. The motor was also in the same room as my HA host when I first set it up. I then moved to a different room with a BT proxy.

Let’s see:

  • My AM43 sits next to a Raspberry Pi on which I have Home Assistant running in Docker.
  • I reset the AM43 (back to factory settings) and added it to the Tuya Smart app (I can control it from my smartphone).
  • I restarted HA/Docker after adding the integration.
  • Bluetooth works on HA, I have Xiaomi BLE integration and it detects all devices.

I tried changing the string ‘4pbr8eig’ to ‘qqdxfdht’ in the python files, but I don’t know if that’s enough.

Interestingly, I can’t see the Tuya BLE tile in Settings->Devices & Services. Propably it will appear when I add at least one device.

Ok, you might have to give it some time. In my experience it did not show up straight away, I had to sit pressing the buttons to keep the controller awake so HA would discover it (without mobile app connected, you might have to either kill the mobile app or turn your bluetooth off to make sure thats not still connected). I’m not sure on the discovery intervals as the existing code is a little bit “chaotic”.

Do you have a Tuya gateway? If so that might also be connected to it and causing a discovery problem.

I’ve just added another update for product qqdxfdht plus fixes for cover.open and cover.close. I can’t test battery sensor as mine does not report battery status, but its there anyway just in case.

EDIT: Have just thought, if this device relies on bluetooth mesh for connectivity then the TuyaBLE integration does not support that. Use the nRF Connect app to check (nRF Connect for Mobile - nordicsemi.com)

I don’t have the Tuya gateway, BT is disabled on the phone, I downloaded the latest code from your fork, I kept the controller active by pressing buttons, but unfortunately it didn’t show up in HA.

I understand that I should not enable the BT detection mode in the AM43 - “Settings Button” + “Down Button” when HA is looking for a device? This will permanently disconnect the AM43 from the Tuya Smart app.

I’ll keep trying as I may be missing something. I still have a question on how to use nRF Connect to check if the device is using Bluetooth Mesh. The app finds AM43 but there is no mention of BT Mesh.

By the way, thanks for all the help so far. After receiving the device, I found information on the web that the Tuya AM43 version does not work with HA, and a few days later your fork appeared. I am impressed by the Home Assistant community.

The app finding the AM43 is a good start. I’m wondering if the UUIDs are different on the BT module inside yours.

Trying connecting in the nRF app, if you could send a screenshot of the services on the device that would be great. For reference here is an example (note, I’m not home, this is just some random device that popped up so it will look different, but it should be under the same menus)

Tuya Smart app device information:

nRF Connect:

Scanner tab:

Client tab

Server tab:

1 Like

Thanks, ok, that’s a shame. It looks like the protocol implemented in the TYBT4L is different to what is implemented in the Tuya BLE integration. Unfortunately I can’t find a lot of info about that module online apart from the usual datasheets, but pin 15+16 is a serial UART (RX/TX), if that is connected to something on the board it probably communicates to an MCU which if so you can replace the Bluetooth chip with a esphome compatible chip instead.

That’s okay. This will be a good excuse to play around with ESP32/ESPHome :smiley:and/or maybe even do some reverse engineering of TYBT4L, although I still have a lot to learn there. Anyway, it is cool that you were able to add support for 4pbr8eig.

By the way, it would be great if Home Assistant would combine all the forks of Tuya BLE and add it as a default integration. Tuya is very popular.