Tuya LOCAL with energy monitoring and without tuya-convert

This thread is the very definition of impenetrable! So I apologize if I ask a question that’s been asked, but I only read through 30-40 posts before I gave up.

I got seven of Nedis Smartlife Switches a few days ago on “this is leaving our sortiment sale”, so I figured they were the old firmware, which I was going to do the Tuya flash with. Turned out that they have the new firmware that doesn’t work with that. And I can’t depend on always having the cloud available. So I have started my attemps to get Tuya local working.First, I found this way of getting the info necessary for the switches was the easiest (creating a project on Tuya IoT platform, installing the python scripts on the Pi and running the wizard):

I got the info I needed, and it was also able to check the device locally, so it’s working.

Then I added the integration with “Add integration” in two Pis, and I put my first switch in there. So far it seemed good. Only it doesn’t work as it should. I click the switch, but nothing happens, and the slider on the swith goes back. Turning the switch off and on manually doesn’t make it change in the GUI. So something’s obviously wrong. When adding the device I saw the alternatives ‘1’: True, ‘2’: 0, and I have tried both versions. I actually had to delete the integration, restart Hass and add it all again to do that. Anyway, it didn’t help. :frowning:

Can somebody please put me out of my misery?

You should add a switch as entity and use 1 as the datapoint for ID. That should be it. Check the logs for potential errors.

@rospogrigio Just wanted to thank you for such a great item developed.

Ive been messing around with Tasmota / ESPhome and after seeing a few plugs and switches with Tuya on them in costco I bought them (normally I’m browsing amazon trying to find old versions), got them home hooked them up and then added your Localtuya with the app sync to grab the key via tuyaapi and the setup is 1) much faster to add devices than tasmota 2) much easier to control / build the mapping than either 3) much nicer integrated into HA!

Really great work!

1 Like

There’s clearly something wrong here. I set it up like this:

Then I got this result:

bilde

And I could turn it on. Then off. And then nothing. The slider jumped back to on, while the switch was off, so naturally I could not do anything with it. I am guessing that the log is about that:

Edit: After a few reboots I can see that it works one or two clicks every time, then the same “Heartbeat failed” error comes and it stops working.

Did you access your device on the Tuya app at all?

Yeah, no problem. That’s 100 % reliable, when the broadband is working. Which is is now, but not always. During winter storms the cables can be damaged.

Hi. I currently have the HA version 0.115.6 and I don’t want to update to the latest version at the moment, due to the problems with the python version, it would be possible to use LOCAL yours in my version.

I have tried and the switch does not work for me, it recognizes it, I put all the information on it and it lets me create the entity, but it does not act on it.

Then I have tried to install the custom component from HACS and I have discovered that it requests 0.116 as a minimum version, is it possible to update to this version and not to the last one, and if I do, the phyton version will be fine?

Thanks for the help!! a greeting

You just mentioned that it worked with the app. First of all, make sure you don’t have the regular tuya integration set up. Remove if you do. Also, make sure you kill the app completely and try again. Tuya devices normally only work with one user at the time, so you need to make sure no one else (e.g. an app) is active at the same time as this integration.

I believe 0.115 is fine, but you will have to install it manually. For further problems, open issues at GitHub and include debug logs. We don’t follow up bug reports here as it’s hard to keep track for us.

Same here, after trying what I mentioned. If it doesn’t work, open an issue at GitHub and include debug logs so we keep bug reports away from the forum.

I killed the app and retried, but no change, or worse: After that restart the integration has has the switch listed as Unvavailable, and there’s a bunch of connection failed in the log. That reminded me of something: I did create an account on Tuya’s IoT, can that interfere with this, even when I’m logged out? Should I remove the link from the IoT account to my regular account? Now I’m only doing this to find the problem, I will not be using this in production. I’m going to return these switches and get more of the previous version, I much prefer the Tasmoda way of doing things, by flashing then and connecting them directly to the MQTT server. That way I don’t have to go via Hass at all (I have Hass as a hardware interface, mainly for Z-Wave and as a GUI for phones, the main stuff happens on a VM wih huge scripts on Event Ghost and Girder). But I’ll put in the bug report and keep the switches for a few days in case testing is needed.

Any solution for this yet? From time to time my covers keeps becoming unavailable

I installed it manually and now it is working perfectly for me. Thank you very much for your work and help !!

Cheers

Thank you! I did it thanks to you :grinning:

Had to use following modifications:

  • used apkmirror to install old version of tuya smartlife
  • used blustacks tweakers file manager to extract the key-file

Still , I am not able to add my tuya motion sensors to the integration :frowning_face:, but I suppose those are not supported or possible to add yet?

I don’t have motion sensors. But I’m interested too.

I think rospogrigio and postlund will help you with tuya motion sensors integration.

Yes, tyua motion sensors are cheap and can connect USB-poweradapter, no battery-change needed.
If they can work with this integration, it would be great!

Hi @rospogrigio and @postlund :slight_smile: Do you have any recent information about getting tuya motion sensors to work?

I’ve made some work to support that to some extent, but it’s not finished yet. Everything moves a bit slower now due to life.

3 Likes

loca Tuya lights are super stable…still…no problem at all after months…very good work. I want to buy more tuya to change the stupid zigbee. Thank you again!

The IR devices from tuya work with this addon? Are they assumed as climate?

I am trying to get a 2 Gang WIFI dimmer (MS-105B) working on Tuya local with the HACS integration.

I have two sockets with power monitoring that are working fine but cannot seem to get this integrated.

What I understand so far

CH 1
1 true or False , power ON / OFF
2 0 to 1000 Brightness
6 Unsure

CH2
7 true or False , power ON / OFF
8 0 to 1000 Brightness
12 Unsure

tried various combinations but cannot get it working, any ideas?

Am I better off configuring in YAML or using the Integration setup ?