Integrate Tuya Wireless Switch (Bluetooth) to HA

Hi there,

I’m a HA beginner. I’m trying to use some Moes smart switches (Bluetooth) to turn on/off smart lights (Yeelight) but it appears that those switches are not currently compatible with HA.

I have those smart switches connected to a Multi-mode gateway and controlled by Tuya Smart app. From the Tuya Smart app, I can set up a single-click button and use a switch to turn on/off a heater (which is a Tuya device).

In HA, the Tuya integration shows all the devices (switches, heater, the gateway) but while the heater is supported, all the other are shown “unsupported”. Is there some configuration I need to add to make them supported by HA?

Thanks,
Trung

2 Likes

Current official tuya integration doesn’t need any config changes but if it’s not supported, you just need to wait.

I heard something that localtuya is working on this, but, if you are newbie, it would be hard to ramp up on that one.

Will it be possible without the bluetooth tuna gateway ?

you can reverse engineer bluetooth messages and add it into an existing bluetooth integrations but tuya is somehow very protective about their message structure, so it would be time consuming with gateway.

Hi,
I just bought a fingerbot from tuya. I have a multi mode gateway laying around. I bought it more than year ago but never actually use it.
I plugged gateway just to check will it be found by local tuya. And yes, it is. I connected bluetooth fingerbot to it and it is working over smart app. This bluetooth device wasn’t found by local tuya. I add it manually to local tuya but it didnt work.
So I get an idea. I check devices on my alexa app just to see is this fingerbot discovered by alexa. And yes it is.
I went to home assistant, cloud setting to check is this device listed in alexa devices that are exposed in home assistant. And yes it is.
I can use my tuya bluetooth fingerbot device in home assistant without local tuya just because it is integrated with alexa and, as device, exposed to home assistant.
Hope this will be helpful.

1 Like

I tried LoalTuya and it doesn’t recognize the devices. Those Moes wireless switches have category “wxkg” in Tuya IoT cloud. As I check Tuya integration and localtuya, this category isn’t supported yet. Also, there is another problem with the devices, their instruction set returns empty functions:

{
  "result": {
    "category": "wxkg",
    "functions": []
  },
  "success": true,
  "t": 1659059680453,
  "tid": "689c20830ee111eda61ffaafaaa49229d7"
}

I can’t even send commands to them via Tuya API Explorer. Moes needs to fix this.

No, you will need a Bluetooth gateway.

I finally figured the way to work around this. Basically, what I need to do is to create a product on Tuya IoT, e.g. with Dimmer Switch category. Then add it to the Tuya smart app. From there, I can add Intelligence to the Moes wireless switch buttons to change the state of the dimmer switch. The final step is to create an automation in HA to toggle the lights or whatever based on the state of the dimmer switch.
No coding is required, no device listen is needed.

4 Likes

Hello! I have the same device and the same problem. Can your explain in more details how you did this two steps: “is to create a product on Tuya IoT, e.g. with Dimmer Switch category. Then add it to the Tuya smart app.” ? thnx

@trungdtbk I found out how to make the app in the Tuya IoT but there are a ton of steps afterwards that I don’t understand. Can you provide the steps you took? @dzhukow were you able to get it working?

So this https://www.aliexpress.com/item/1005005260959781.html can’t work with HA BLE?

No, tuya is trying to have a closed ecosystem

@trungdtbk

Can you please give us some details about how you did this? Stuck in the same boat. Thx.

Hello, can you please provide some details about how did you end up solving this issue? Appreciate your support, thanks

@mfisher224 @yabdali
I followed this document to create a virtual device: Add Virtual Device-Tuya IoT Development Platform-Tuya Developer

After clicking “Add Virtual Devices”, I selected “Add to Tuya App Account” and it generated a QR code scannable with Tuya app.

To connect every button of my real switch to HA, I added a virtual power strip with enough number of outlets, each mapping to an HA automation (when it’s turned on or off). They are then controllable via Tuya app scenes that accept button input from the switch.

1 Like

Thanks a lot, would you mind sharing some pics of the HA results and the Virtual Device? That may help visualize the outcome, thanks again.

Thanks, I managed to get through these steps you mentioned and linking to Tuya App. Just a quick question, I presume this type of work around would be Cloud managed, right? I mean the automation/linkage is not local since the device is virtual isn’t it?

Yes, it’s cloud-managed (I use a WiFi switch instead of BLE). Example config to tell the time on my Nest Hub:

service: tts.speak
metadata: {}
data:
  cache: true
  media_player_entity_id: media_player.nyx
  message: It is {{ now().strftime('%I:%M %p') }}
target:
  entity_id: tts.google_en_com

My device is something similar to Htovila Tuya Portable Mini Double Button Remotes Control Switch Cable-free Intelligent Dual Button Switch Intelligent Linkage Home Easy Installation Remotes Control Compatible with Fingerbots - Walmart.com. It uses 2x AAA batteries and no coin cells are required, but for fully offline setup I would recommend ZigBee switches instead (a few are available from IKEA: SOMRIG 305.603.54, RODRET 805.598.00, STYRBAR 804.883.70, etc.)

1 Like

Thanks a lot for your response, interesting work…