Tuya LOCAL with energy monitoring and without tuya-convert

Head into this link to see how to do it;

@rospogrigio Thanks but I already tried the fake setting with no luck.
I don’t know why but my switches don’t follow the fake positioning time.
For example, if I set 10sec and ask the switch to open, the relay doesn’t stop before the default time is past (30sec)


Thanks

UPDATE

I am playing with the fake positioning time and just found that my switches don’t respect this time when using the arrows on Lovelace, but they do when using the position slider.

image

The biggest problem I have right now is not having feedback on the actual state of the switch (and therefore of the shutter) because if I use both the arrows and the slider, the entity does not maintain the state and every time I reopen it on Lovelace I always find the slider set to 50%.

This was the initial behavior I developed for the fake positioning, now it is improved, try to re-download master branch and test it. :wink:

Hello, long thread , i’ve read it but i may be missed this part - with tuyalocal is there a connection to the tuya api and tuya iot website or it is local connection ? What happens if i lose internet connection, or if tuya decides to close or change their api? I have latest tuya smart switches with energy monitoring, and no way to use tuya-convert, i cant open them without braking their shell and i want to keep up with tuyalocal


Hi @rospogrigio, hi @postlund.

In my Hassio I have 15 Tuya devices connected: switches, relays, dimmers; plugs and rgbplugs with Energy Meter. All devices are working fine. Now installed last master branch.

I also have an Energy Meter Switch.

Energy Meter Switch

On AliExpress

It connected fine to Hassio, BUT I see it periodically becomes inactive in Hassio’s interface. At the same time, in the Tuya Smart app, it works fine.

Energy Meter Switch inactive

There are no error entries in Hassio’s logs from this Energy Meter Switch.

Why can he become inactive?

Thanks.

P.S. Also with the last master branch, a lot of entries appeared in the logs.

Entries in the logs
Logger: custom_components.localtuya.light
Source: custom_components/localtuya/pytuya/__init__.py:132
Integration: LocalTuya integration (documentation, issues)
First occurred: 10:25:53 (518 occurrences)
Last logged: 10:33:25

[121...281] Entity light.in_wall_dimmer_2 is requesting unknown DPS index None
[830...dcb] Entity light.on_wall_dimmer is requesting unset index for option color_mode
[830...dcb] Entity light.on_wall_dimmer is requesting unknown DPS index None
[046...60d] Entity light.rgb_power_plug_led is requesting unset index for option color_mode
[046...60d] Entity light.rgb_power_plug_led is requesting unknown DPS index None

But there is no color_temp or color_mode DP in dimmers. Brightness DP only.

OnWall dimmer has:

OnWall Dimmer

onwall dimmer

InWall dimmer has:

InWall Dimmer

inwall dimmer

In InWall Dimmers - DP 101 is a separate setting for the minimum brightness level.

I’ve returned to version 3.0.3 so far.

Why do you think it is called tuyaLOCAL :wink:

Really
 My mistake
 but anyway, everyone can call his integration the way he likes. So, tuyalocal doesn’t have to be local :slight_smile:

I have the same behavior. I did download the latest version but my covers are working as you describe. To be honest I am very happy that now are in the local network so not the position is nice to have.

*** Many thanks to all for the work and support!

isnt it possible to make a new release instead of master? cause everytime something is changed, like everyday in master, HACS gives a message, that there is an update available :slight_smile:

and we need to reinstall master again

We would love to, but we are waiting for the HA guys to approve our PR in order to have localtuya as a default integration, and publishing a new release would restart the checks and process probably
 will try to ask when this will happen. Please hold on, hopefully it won’t be much longer.

3 Likes

This is great news! Where can we track this?

Hi all
I have localtuya and everything is working fine. However I have a tuya dehumidifier that is not integrated yet so is is not available in HA.
However with the original tuya integration I could use it through HA with the scenes of the smartlife app.
Now I am wondering, what if I make a new account for the smartlife app only for the dehumidifier and add it to HA with original tuya integrationn and have both original tuya and localtuya integrations with 2 different accounts. Would that be a problem-conflict or it could work?

I don’t see any problem with that. Should work fine :+1:

1 Like

I confirm that it is working fine. Thanks again.

1 Like

Seems merged with hacs now :slight_smile:
So now we need to wait for 3.0.4 to install to go away from master?


 and here it comes!!
v3.1.0: first release after HACS integration!
First release after having been introduced as an official HACS repository! :slight_smile:
What’s new:

  • improved connection handling, with several bugfixes
  • introduced devices autodetection, with dynamic IP addresses
  • introduced passive devices
  • improved light platform, introducing scenes and HSV handling
  • improved fake positioning for covers, and introduced reversed mode
  • improved fan platform
  • improved logging
  • other that I can’t remember now :smiley:
    Enjoy!

For all of you who have added localtuya as a custom repository, you should remove the custom repository and re-add it from the official one. :slight_smile:
So happy for this achievement, thank you to all contributors!

9 Likes

installed and working

strange that i dont see it as a custom repository anymore , cause i wanted to remove from there
maybe HACS does that automaticly ?

I keep getting the following error.

Invalid config for [localtuya]: [switches] is an invalid option for [localtuya]. Check: localtuya->localtuya->0->switches. (See /config/configuration.yaml, line 19).

following in my configuration.yaml file:

``

#Local Tuya
localtuya:

  • host: 192.168.178.xx
    device_id: 12345
    local_key: 12345
    friendly_name: wifi plug
    protocol_version: “3.3”
    switches:
    sw01:
    name: wifi_plug
    friendly_name: wifi plug switch
    id: 1
    current: 4
    current_consumption: 5
    voltage: 6
    sensor:

  • platform: template
    sensors:
    wifi_plug_voltage:
    friendly_name: “G4 voltage”
    unit_of_measurement: ‘V’
    value_template: “{{ states.switch.wifi_plug.attributes.voltage }}”

    wifi_plug_current:
    friendly_name: “G4 current”
    unit_of_measurement: ‘mA’
    value_template: “{{ states.switch.wifi_plug.attributes.current }}”

    wifi_plug_current_consumption:
    friendly_name: “G4 current consumption”
    unit_of_measurement: ‘W’
    value_template: “{{ states.switch.wifi_plug.attributes.current_consumption }}”``