Local Tuya - Control Tuya devices locally (Fork from localtuya)

I think you can create template-buttons, for the different defined “values” now that you got the select to work correct

Thanks for your reply, for now that’s to complicated to figure out by my own. Could you guys help me in the right direction? Where to start?

Thanks everybody!

1 Like

In iot.tuya you can fetch some more info from your device, in api-explore (left pane) go through the menu, just for curiosity :slightly_smiling_face: , but maybe the
Device Control
and
Device Control(standard instruction set)

As for templating, im not an expert either
But with the knowledge of the specific instruction, i.e move up (if tha’t a selection you currently have) maybe Developer/Tools#States also can help you here.

i was thinking a button(maybe custom:button-card) … on_tap or on_hold = move_up /move down
Same for the other functions
I’ve seen quite a few which have made their own cards, same as they do for i.e mediaplayers/remote-controls and similar
Use the search function in this forum, and if you can’t find similar functions, then open a new Topic , with as much info/details you can provide, an your “example-card” as you would like/have tried to create
( Maybe there is already service_calls for your current functions )

Installation worked like a charm and auto discovery worked perfectly. Thanks so much for the plugin.
For others that come this way - this worked perfectly for the devices that I have

  1. Wipro Smart Switch 4N Module 2
  2. Wipro RGBCW_ SMART Garnet light bulb
  3. Wipro 16Amp Smart Plug
  4. arcnics® - 16A (Heavy) Smart WiFi Retrofit Switch
  5. Finery 3 Node WiFi Smart Switch Retrofit Kit
1 Like

I ran into issues with localtuya (spotlight being unavailable even when I could detect it on iot.tuya and my tuya app).
Removed that integration and added this (could not have both due to name conflict), and the device was detected right off the bat. Thank you.

Considering I am new to HA (and not a dev of any kind either), I have been reading up a ton. For newer stumblers here:

I enabled the cloud API option so hass-localtuya could detect the already added devices. Once everything was in order (devices working correctly), I added the tuya device to my blocklist to disable internet access to the spotlight and disabled cloud API in localtuya config.

Seems everything is in order so far.

1 Like

Update: 3.2.5 should supports IR Remotes it works similar to BroadLink remote.
learn commands using learn_command service and use via send_command service.

Usage: https://youtu.be/lWCHZm9xWno?t=189

Note: If connecting to the device fails due to no dps found and you are sure of “protocol_version” insert 0 in manual dps field.

3 Likes

Thanks to @umu_ugg - the IR remote is now supported. I can turn on my dumb AC with a cheap IR blaster. :clap:

1 Like

Do you have more details on how this works? Ie where to look for templates?

I’m trying to setup the WIFI Dual Meter (PJ1103A, product id: z95s7p3z54xbsjnl). The original localtuya was able to talk to the device but all entities had to be manually configured without any info even though there is a device configuration for it. With your version of localtuya, I still have to manually configure the entities but the DP ID is populated with the variable name which helps in knowing what each thing is.
This is the same device as mentioned in this issue. It looks like some people are able to get it working but my instance doesn’t automatically recognize all of the entities, only one entity.

This is what is automatically setup:

1 Like

The templates are supposed to be manually made which is the hard way but it mainly used to export the already configured devices. so if you have device you can export it as template and use it later to setup same or similar devices. it seems you have cloud setup so you should either rely on “automatic” or “manually” unless you already has template which it seems not.

If the automatic doesn’t added all entities then it seems your device isn’t fully added in database. if you can post the “device diagnostic” I can add it, you can download it from device page.

Thanks, I ended up trying the make-all fork and it brought everything in automatically. Below are the configs for this device:

I just wanted to say a big thank you!!

I was having a few issues with the original local Tuya, and as a quality of life change, the auto configuration is a godsend!

1 Like

Hello,
First of all thanks for your work. I had a question concerning Smart Scene Switch button I bought from Aliexpress. They are all Zigbee devices and I had them set in homeassistant through localtuya but i can not manage to create automation on a button click. all i have on tgrigger is the "option changed " like from single click to double click or from double click to long press etc
So how do i set just an automation for single click? I tested to set from single click to single click but it doesnt work (normal because when its already on single click if you use the button for another click the state doesn’t change)

1 Like

Don’t use the entities as a trigger in automation instead use the events triggers.
https://xzetsubou.github.io/hass-localtuya/ha_events/#__tabbed_1_2

1 Like

Thanks. It’s working perfectly

Did anyone try to add a Tuya Zigbee gateway without any devices added on it? I’m trying to figure out whether my Lidl Silvercrest Zigbee gateway will work and I can’t add it without explicitly defining DPs 101 and 102, and when I do this, I need to choose the entity type, and there is no “gateway” or “hub” entity type. Can anyone who succesfully added a Tuya gateway give me some details about their configuration?

Add a device to you hub ! through the app

I’m trying to set this up but am stuck.
My device is being found by the integration and I do have the device ID & local key but I keep getting:

Try to change Theme, to default (dark/light)( Just during the setup !)
Is it your first device ?, do you have your devices in iot.tuya ?

1 Like

Hi, I changed the theme to HA default but still the same error.

I was using rospogrigio (which was working) his version but since it has not been upgraded for some time I wanted to switch over because HA was giving warnings for this integration.

As the error shows the device doesn’t return any status. What is this device you’re trying to set-up?