Tuya local

You don’t have to restart the whole HA instance. Look a few posts up at #68.

@Tamsy : Fair enough, i’ll do that next time… But regardless, why does the devices not come back online (some times) when I restart HA? I dont want to have to reload the integration until they are working. :slight_smile:

I have added 4 devices in the yaml.config file as per the github instructions, however my integration shows up like this, rather than the usual way:

image

Once I drill into one of the devices it shows correctly (but obviously only 1 device):

image

Is this coming up correct? I would expect it to show “4 devices and 4 entities”…

I cant answer you that one. But out of what I have experienced with a couple of installations, all on RPI4 devices, HA Supervised installed is that the need for reloading some of the tuya devices after HA restarts is getting less after some time and eventually down to zero after a while. Kind of mystic indeed but I didn’t had to reload a single device out of all the installations I maintain for quite some time now after HA reboots. Feels like things have to settle for a while :crazy_face:

Why through configuration.yaml at all? Just use the much simpler and quite reliable config-flow method instead!

Because I couldnt work out how to add multiple devices using the Wizard. :smiley:

I managed to add one, but then the wizard closed and I couldnt add further devices… Might be me missing something.

After you have done one and have finished the configuration for it you simply start all over again:
Intergrations → Add Integration → Local Tuya Integration → …

It’s as simple as that :slightly_smiling_face:

1 Like

Ah… I was expecting to add more device in the same manner as for example the Zigbee integration, not new integrations for each device… I have redone a couple using the wizard now, and they are still displayed “inside” the integration, so I guess thats the correct way for this integration then:

image

1 Like

Yup, that’s the correct way :+1:t3:

2 Likes

I have configured my devices via the Integration Wizard in HA.
Unfortunately, part of my local tuya devices configuration has become defective/lost.
Since I have an older backup of my installation, I would like to retrieve the information from there.
Can you tell me where and in which file local tuya saves the configuration?

Be aware there seems to have been an outage last night with Tuya. This morning (Europe time) I rebooted my core module and all lights came back again.

Unfortunately, I was too impatient and thought it was a problem in my installation and deleted the entries marked as incorrect. Now I’m trying to restore them using my old backup so that I don’t have to laboriously find out all the keys and settings again. Therefore, it would be great if someone knows where local tuya saves this information.

Did you ever get this working? It looks like I lost the motion sensor ability when I add it in Home Assistant.
Adding the Motion Sensor from the flood light would enable me to make a simple automation.

Cheers.

Also lost the motion sensor, but without that it works in HA. Since the place I use it doesn’t need the motion sensor, I haven’t investigated anymore.

Be aware that the new HA release has a fully new Tuya implementation by Tuya itself. Although I do expect cloud connection is needed.

1 Like

Since the old tuya integration stopped working after recent update and new tuya integration still not support local control, I decided try localtuya. The github guide is quite simple and it took me quite some time to figure out that we have to do it one by one! So now I have added my bulbs and it is working, sort of.

questions: when using config flow to add new entity, in below screenshot:
image
I don’t know what values to choose from the dropdown and don’t know what do they mean. The dropdown value I got is slightly different than from the screenshot in github page:

When adding the bulb, I selected first one “20 (value: true)”, set brightness lower value to 0 and brightness upper value to 255, leave all others as default. After adding it, the entity appears, and I can turn it on and off, also set the brightness. However this is color bulb but there is no option to set the color.

Can someone post a screenshot of the settings/values to add color bulb?

@henry8866, As far as i know each brand an type has a different configuration. what worked for me was to use the tuya app itself to change a single value (only color from red to green) an then take a look at this list to see which entry changed. this way you can figure out all of the settings required.

but since you asked here is a screenshot of a color bulb:

2 Likes

Thanks. The dropdown values are different in my installation. These entries start with 20, 21 etc on my case. I’ll need to try it out.

I have just started using homeassistant after having used Domoticz for years.

My first project was to install LocalTuya and connect a first Led Filament lightbulb (A60GOLD) and it all worked fine BUT, for some reason I can’t find a way to change the white mode and brightness in Homeassistant while I can when using the Smartlife app.

Is this even possible and am I just looking in the wrong direction?

Thanks,
TechNoob

Hi All,

I’ve introduced Number and Select entity types to support Tuya devices that don’t fit neatly with the current entity types.

I primarily introduced as I’ve got an Arlec Smart Security Light (MAL315HA) that doesn’t have a traditional on/off mode. It’s DPS config represents the following:

101 - Mode: mode_auto/mode_on/mode_off <Select>
102 - Light State: true/false <Binary Sensor Only>
103 - Motion Sensitivity: [0-4] <Number>
104 - Light Timeout when in Auto mode (secs) <Number>
105 - Light Cutout Threshold [0-3900] <Number>
106 - Reset to Auto after 1 hr in Manual On: True/False <Switch>

The Number entity type is pretty self explanatory. Has configuration for maximum/minimum values.

The Select entity type allows configuring of values to send through to a DP. In addition, I’ve added a User friendly mapping, so (as an example) that you can have “On” as the setting for the Select, which maps to “mode_on” as the value being sent to the device.

So in the Smart Security Light Example, I have setup a Select against DPS: 101 with the following:

  • Name: Mode
  • Valid Entries: mode_off;mode_on;mode_auto
  • User Friendly Options: Off;On;Auto

If anyone is interested in giving it a try, the PR is #596. @Gabrie - This may assist with the light you were trying to setup

Hi all
I just installed a Tuya RGB Led Strip. I have added it to HA and I can turn it on-off but I can’t change the colors. Does anybody knows how I can make it work. The options are below