TUYA BLE: Error on install: {"message":"Invalid handler specified"}

Yeah, they didn’t update the integration, they posted instructions on github on the few changes to make to some text files. This new issue looks like a similar thing

It’s a big mess. As nobody maintain the integration, everyone make his own mods and post it.
In the past I used one of those mods to get a device working.
Then I had a bug and to correct it I applied the mods that I shared in this thread.
And now a new issue described here:

I hope someone will update the github and merge all the modifications.

1 Like

Ok. let’s not complain. I’m no expert with the code, I’m only 2 months old into home asst, so I appreciate learning from everyone else.

I coincidentally installed this like three days ago so it was working BEAUTIFULLY until last night. frustrated the heck out of me all day, esp after all that effort taken to figure out how to get it installed.

Anyway here’s one thing I realised. 2024.2 has some backward incompatible things, and one of the things is the way Tuya authenticates (which explains why CONF_Access_ID is no longer a valid… I’m guessing, variable?). But there’s an upside to it - you no longer need a developer account to integrate Tuya into HA which is awesome. Now the problem remains as to whether deleting the old login credentials is sufficient for tuya_ble to access the device, or does it need to get the new login credentials?

Anyway documentation on what I found here. I’m going to stare at the code for a bit and see if I can make any sense of it but I’m hoping someone can come in and build upon what I’ve got so far.

3 Likes

If anyone comes out with a solution that would be great.

I could get it working (for the moment…) using this:

Thank you @Moe555, I confirm it is working. I’m just surprised it can work in parallel with the new Tuya Integration… I hope it can remain stable and keep working. Thanks for the hint!

1 Like

I keep getting ‘incorrect username or password’. HA has detected a device but I cant configure it.

hello @donparlor , what did you pit in access it and username password field?

same here, did you find a solution?

First, I must clarify, I have the new Tuya integration running, the one released with 2024.2

Here are the steps I went through to install Tuya BLE integration:

  1. Remove Tuya BLE completely. If it claims integration is being in use, force removal.
  2. Go to your HACS tab and download this custom repository by @markusg1234
  3. Install the custom repository in your HACS
  4. Go to your HA integration window, install Tuya BLE
  5. When asked to enter your credentials, it will be the old credential page from the old Tuya integration (before 2024.2). Use your Tuya Developer IoT credentials.

So you still need to have all your Tuya Developer IoT credentials at hands. This is why I said I’m surprised the Tuya BLE integration can work in parallel with the new Tuya Integration…

Hi,

I’ve changed the cloud.py and config.py files and still getting the below error message when trying to first time start the Integration.

Config flow could not be loaded: {“message”:“Invalid handler specified”}

Running latest version of HA 2024.2.5

1 Like

I too have the same problem. I have changed all the entries in the required files.
Has anyone found the solution?

Hi,

Thanks for those steps.

Unfortunately I’m stuck as step 5, I enter my old tuya developer credentials but it just reports “Login error (2401): username or password wrong”

Using the same username and password I can log into the tuya developer web platform fine, so a bit lost.

Note I do not have the new Tuya integration running, I only have this single cubetouch device.

You had your Access ID/Client ID and Access Secret/Client Secret?
If so, I’m as lost as you, I don’t know how I got lucky and that it worked…
The original programmer has left the development team, I guess a damn good programmer needs to take the lead and help with this integration…

Yes I had the secrets.

I think I will give up with this integration and get a zigbee based fingerbot instead.

Same here, I already bought a Zigbee fingerbot and next time this integration fails I will switch to the Zigbee fingerbot.

I had the same problem. What seemed to fix things was adding the Tuya cloud integration. Then I was able to get the BLE integration to work. It looks like the code calls some of the cloud integration functions, so perhaps this updated something. It seems to be working now!

And today 3/31/2023 Tuya perhaps changed the endpoint as I had to change the code in cloud.py:

#        api = TuyaOpenAPI(
#            endpoint=data.get(CONF_SS_ID, ""),
#            access_secret=data.get(CONF_ACCESS_SECRET, ""),
#            auth_type=data.get(CONF_AUTH_TYPE, ""),
#        )

        api = TuyaOpenAPI(
            endpoint=data.get(CONF_ENDPOINT, ""),
            access_id=data.get(CONF_ACCESS_ID, ""),
            access_secret=data.get(CONF_ACCESS_SECRET, ""),
        )

fyi, mine is working fine.
I did not modify the files for a long time, but I just checked and my bluetooth tuya lock is working fine.

EDIT: broken with release 2024.4! Or maybe because I uninstalled tuya integration.
Fixed installing repo from @markusg1234

Try adding a new device or editing the existing device. That’s where it seems to be broken. Existing devices seem to work fine still.

For you info, I found a version working perfectly fine without tuya cloud here:

(It is in the zip file)

The discussion was initialy an evolution of tuya_ble to add support for a specific lock.
This last file is an evolution from tuya_ble to tuya_local_ble because the author replaced the cloud functions with local ones.

Maybe if someone is willing to upload it into a repository, that would be very nice :slight_smile:
Unfortunately I’m not able to do it and the author seem really busy but earlier in the same thread he asked if somone would like to do it.