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?
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.
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.
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.
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).
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.
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)
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 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.