Tuya LOCAL with energy monitoring and without tuya-convert

Yes, it’s a bit behind until we get the PR for inclusion in HACS default repo list merged. Don’t think you can pick to install from master directly in HACS when there are releases made?

it seems so, i can select it there … no more config errors now
now , i need to find the values for an RGB led strip :slight_smile:

Cool, didn’t know about that. You should try the suggested values (from the comments), they usually work. But you can get a complete list of all datapoints if you add the device from Integrations instead.

yeah, trying first yaml, with those values from 20 , 21 and so on ,but i add too much lines, the light is unavailble … so need to check what line is giving issues … seems not so easy

whats the ID i need to choose here for an RGB led strip? :slight_smile:
adding 20 , creates me a light, but i dont have any color palette and brightness values like the tuya cloud

You should use 20 as ID and follow the example values from the comment above for the rest (brightness=22, color mode=21, etc).

1 Like

ok, seems i dont need the color_temp, that one was bugging me

@postlund, got it all working , thnx for all the help…!!
About those local keys, once I have them, they never change anymore? I can remove them from smart life app? I can even remove the project on tuya? (If I buy no more tuya devices)

The local key change whenever you re-provision the plugs to a new wireless network (so they are not static).

1 Like

I should wait to update? I have an update notification to upgrade to 3.0 3 in hacs… I have selected master there

today, i rebooted my accesspoint, so the wifi was lost for a few mins
the rgb strip reconnected, i was able to ping it
but the HA didnt reconnect to it? i saw in log, that every 5 min, there was a message that the led was disconnected

i had to restart HA again to make it work
is that normal behaviour?

FWIW, after I had my tuya plugs working, I deleted them from the smart life app and they stopped working.
So I had to add them to app again, find the local keys (they changed), and then add the plugs again to HA
Now I’m just going to leave them in smart life app, but I use tuya local so no cloud is used.

1 Like

What a nice component, and what a thread :smiley:
I have some questions on the yaml config for power plugs. Perhaps these are stupid questions, but I’m kind of a newbie here :wink: If I have to post this somewhere else, just tell me.

I used the config as mentioned in the readme (https://github.com/rospogrigio/localtuya/blob/master/README.md#1-yaml-config-files)? This was repeated 4 times, as I have 4 plugs. Only sensor, binary_sensor and switch entitites were added because of the device type (power plugs with power measurements)

  • First question, can I add a “name” instead of (or in addition to) “friendly name”? It would be nice to have some control on the assigned entity ID. At this moment I have binary_sensor.plug_status_1, 2, 3 and 4 (numbers were automatically assigned)
  • Second (related) question: if I want to display power consumption with templates (https://github.com/rospogrigio/localtuya/blob/master/README.md#energy-monitoring-values). This example uses like “states.switch.sw01.attributes.current”. I assume “switch.sw01” is the entity ID (hence my first question). Adding extra entities for the different measurements might be an alternative, as that seems to work.
  • And the last one, where in the config should I add this template code? Is it like an entity?

Thank you very much for helping me out

Hi.
@rospogrigio and @postlund and @all Thanks a lot for your component.

I have manually installed version 3.0.3 (not master). The component appeared in Integrations and I was able to add simple devices such as: 1-channel Switches and Relays via the web interface (not via the .yaml file). But I cannot add 2 and 3 channel Switches.

I need help from those who have already figured out the settings for 2 and 3 and 4 channel switches. They have respectively:

for 2-channel Switch: ID1 and ID2;
for 3-channel Switch: ID1 and ID2 and ID3;
etc. for 4-channel.

How do I add them via the web interface? Thanks.

P.S. In my old custom integration it looked like this (in the .yaml file):

in .yaml file
##################### Tuya 1,2,3 Gang Switch #####################
#  - platform: localtuya
#    host: 192.168.1.101
#    local_key: xxxxx
#    device_id: xxxxx
#    protocol_version: 3.3
#    name: 1 Gang switch
#    id: 1
#  - platform: localtuya
#    host: 192.168.1.102
#    local_key: xxxxx
#    device_id: xxxxx
#    protocol_version: 3.3
#    name: 2 Gang switch 1
#    id: 1
#  - platform: localtuya
#    host: 192.168.1.102
#    local_key: xxxxx
#    device_id: xxxxx
#    protocol_version: 3.3
#    name: 2 Gang switch 2
#    id: 2
#  - platform: localtuya
#    host: 192.168.1.103
#    local_key: xxxxx
#    device_id: xxxxx
#    protocol_version: 3.3
#    name: 3 Gang switch 1
#    id: 1
#  - platform: localtuya
#    host: 192.168.1.103
#    local_key: xxxxx
#    device_id: xxxxx
#    protocol_version: 3.3
#    name: 3 Gang switch 2
#    id: 2
#  - platform: localtuya
#    host: 192.168.1.103
#    local_key: xxxxx
#    device_id: xxxxx
#    protocol_version: 3.3
#    name: 3 Gang switch 3
#    id: 3
############################################################

P.P.S. OK. I figured it out. Everything works, except for one Smart Plug with RGB LED backlight (led ring). I can’t figure out which DPs are responsible for RGB LED backlight.

it is DPs parameters for led ring in Smart Plug, what show in UI:

Video of work a RGB Power Plug with LED Backlight:

We have not added a name field as you can change the entity id via the user interface, it will be persistent. You can avoid having to deal with templates if you just add a sensor entity when setting up the device (pick for instance DP 19, which is usually power). If you need consumed kWh, you can then achieve that with integration.

1 Like

DP 3 is usually brightness, 4 color temp and 5 color. You will not be able to configure all of them unless you go to master though.

Now installed version 3.0.3. Those. do i need to install from master.zip? Right?

Just upload a folder from master.zip? Or will all devices need to be re-configured?

DP2 - is a choice of mode: color (color wheel) or scenes (several preset scenes);
DP3 - this is possible brightness (I tried to substitute it in the settings - it does not work correctly);
DP4 - this is possibly the color temperature (I tried to substitute it in the settings - it does not work correctly);
DP5 - I don’t know what.

Hello guys, I have a bunch of ‘dumb’ RF+WIFI Tuya curtain switches (vendor Loratap) that are not aware about their/motors positions (neither by using fake time position…) so I’m seeking another way that allow me to simulate the positions by using operation time (of the curtain motor/switch) … I integrated them by using Local Tuya and they works with both rf remote and ‘arrows’ on HA but I really wold need the position feature (either the fake one would be good for me). Thanks

Hi Sir, newbie here

how to find local key

@ThePirat the fake positioning should work also for your devices, you just have to measure the full opening time and set it in the configuration.