Tuya LOCAL with energy monitoring and without tuya-convert

Can confirm 3.0.3 fixes the issue of needing to reload devices

Can anyone shed more light on how to disconnect these devices from the cloud? In particular the DNS steps? I have my TuyaLocal working so this is the next step.

I personally just removed the official Tuya integration from HA to stop them being used in HA. Left them accessible through the Tuyasmart app as I thought it would be a good backup :slight_smile:

Hello everybody,
I need help, I have the energy meter ZMAi-90 device bought on aliexpress I canā€™t find the voltage and current ID, do you know something more?

I ended up swiping some code from someone else and cobbling together an automation to loop through and reload the unavailable ones after a restart. Good enough for now :+1:

I am looking to get some Tuya light switches with built in dimmers. Does Localtuya support these devices? I have regular Tuya light switches which I set up as switches and they didnā€™t have any brightness options obviously.

Should I have set these up as lights instead?

Ignore, have set up as lights instead and all working!

What a great project! I finally managed to connect all my tuya devices to hassio :slight_smile:
Although some newer tuya based smart plug on non ESP chips seems only provides kwh reading and voltage, not watts or ampere.

However, since most tuya based smart meter/plugs does feeds kwh readings , can we put this for statistics data? for example during last 24h we use 10kwh or so, during month of January we use 1000kwh or so.

The kwh reading feeds by the smart meter is like odometer of a car, or like the power meter by the electricity company, always counts up, never reset. Possible to store and analyze this value in hassio?

Hi @sKooTr

Did you ever get any further with this? Iā€™ve got exactly the same unit and would also love to be able to integrate the other controls.

Does anyone know how we can add calibration code to sensors of power readings like calibrate_linear etc. in ESPHome and/or give an example?

Hi Brad,
No I did not get any further, sorry.

I have a problem. I want to configure a Switch (with the main socket and a usb). How can I configure in configuration.yaml? I want the V, mA and Watts.

localtuya:
  - host: 192.168.1.HOST
    device_id: MYDEVICEID
    local_key: MYLOCALKEY
    friendly_name: H1 Switch Device
    protocol_version: "3.3"
    entities:
      - platform: binary_sensor
        friendly_name: Plug H1A Status
        id: 1
        device_class: power
        state_on: "true" # Optional
        state_off: "false" # Optional

      - platform: sensor
        friendly_name: Plug Voltage
        id: 20
        scaling: 0.1 # Optional
        device_class: voltage # Optional
        unit_of_measurement: "V" # Optional

      - platform: switch
        friendly_name: Plug
        id: 1
        current: 18 # Optional
        current_consumption: 19 # Optional
        voltage: 20 # Optional

Hi Scott

OK thanks, Iā€™ll keep playing around and will let you know if I have any luck.

Hi All,

I need some help with some RGBW light strips. I canā€™t get them to turn off. They turn on fine, can change the color without an issue and selecting the center for white gives me white. The problem is when I turn it off, HA things itā€™s off but the strip just turns to white.

I hadnā€™t found this thread previously so I created another here that shows the DPSā€™s I have selected. Just clicking the image links shows the settings.

Mind sharing the code? I have 2 lights that randomly become unavailable and if I toggle them in the tuya smart up they appear available again. Would love to be able to check what devices are unavailable and reboot them.

Hi,
fairly new to home Assistant just started playing this weekend.
Thought iā€™d start with the tuya globes Iā€™ve got.
went through the process and got the keys from tuya, setup the Tuya Local integration on Home Assistant, and tried to configure a couple of the globes.
Iā€™ve tried to configure through the UI, and set all the recommended setting on the UI - didnā€™t quite match up to what the documentation was expecting but most of them did - I couldnā€™t turn the globe off though HA, the swtich would switch for a second and then revert back to the off position.

I decided to attempt to configure the setting through yaml, with this attempt the light is now saying itā€™s unavailable.

I suspect there are some really easy things that iā€™ve got wrong in this attempt.
Also the sewing light that i configured through the UI, is still displaying as existing, but I canā€™t see the yaml thatā€™s creating it in the configuration.yaml.

a couple of questions, where should I start adjusting this yaml to try and make the lights contactable.

localtuya:
  host: 192.168.10.101
  device_id: xxxx
  local_key: xxxx
  friendly_name: lounge_light
  protocol_version: "3.3"
  entities:
    - platform: light
      friendly_name: lounge_Light
      id: 1
      brightness: 1
      brightness_lower: 25
      brightness_upper: 255

iā€™ve tried with both 3.1 and 3.3 of the protocal versions,
should the device_id and local_key values be in quotes - currently they are not.

iā€™ve assigned the lights static Ips on the router, and I can ping them, is there something else I should do to ensure they are available on the network.

if I connect the network to the internet I can toggle the lights on and off with the tuya smart app.

thank you for any assistance.

all good,
Iā€™ve figured it out, appears that I just had to activate the device, a little confusing because from the UI it looked activated and unavailable - but all sorted.

Would like to thank you and all your contributors for the work that has gone into building this integration - really appreciate it.

Liam

1 Like

How do I get the local key?

Linking a Tuya device with Smart Link

I know this is a noob question, but I have TuyaSmart already installed and both switches installed there. Can I get local_key and device_id from there?

It seems getting them via the Tuya IoT platform is no longer possible.