Are there any LocalTuya guru’s able to help me with my LocalTuya integration. I have successfully added a switch to my Smart Life (Tuya) app, which I can turn on and off. I’ve followed all the instructions on the wiki on how to obtain the local_key and device_id for my switch. I’m using these values with the LocalTuya integration…
I have the debugging turned on which is outputting the following:
2021-01-30 22:03:17 DEBUG (MainThread) [custom_components.localtuya.discovery] Listening to broadcasts on UDP port 6666 and 6667
2021-01-30 22:03:47 DEBUG (MainThread) [custom_components.localtuya.switch] [bf9...auy] Adding switch.main_light with configuration: OrderedDict([('platform', 'switch'), ('friendly_name', 'Main Switch'), ('id', 1)])
I’m not entirely sure if during the setup, i might be choosing the wrong settings? For ID, I am choosing 1. For Friendly Name, I am typing Main Switch, and I’m leaving the other field blank as I understand these to be optional…
I got it working by uninstalling the integration, then uninstalling it from HACS, and then restarting HA. I then downloaded the localtuya 3.1.0 release and put it in my custom_components folder and restarted HA again. Then I went into the integration via the UI and configured it as normal, and it worked instantly!
I read in the issues section on their wiki that the integration fails to reload once booted up, and a fix was to call the service localtuya.reload from an automation at startup. But I’m happy to use 3.1.0 for now and hopefully they’ll fix 3.2.0 at some point.
@MarkB1
Version 3.2.2 has been released - I’ve read the commit notes for v3.2.2 and the periodic connection retries that the latest version speaks of are explicitly there to fix and address the problems previously reported (that we were experiencing with the dropped devices, and calling the localtuya.reload service being the workaround), so it looks like this is a good version to move to. I’ll probably upgrade LocalTuya and test it out this week.
I’m getting the same problem here, device shows unavailable, check my wifi log and it has been online for over 6 days but suddenly 30 minutes ago it’s unavailable.
If I open the tuya smart app and toggle the devices they immediately return available on home assistant. It’s like they are going into a sleep mode but the timing is random.
I’ve resolved the issue by using automatization on homeassistant - start trigger with action homeassistant.reload_config_entry for a group of Tuya devices.
Or “unavailable” state trigger for Tuya devices can be also used.
Also receiving this issue now after attempting to set up. Thought I’d set the entity up incorrectly, but appears to be something with either Tuya or this integration.
Saddly I have the same problem. PowerStrip and plug become unavailable every time after HA restart. I am quite sure that this is “localTuya” integration problem because powerStrip & plug are working via default app.
Just for info. It works for me now. I redownload master version of tuyaLocal via HACS (did not work). Than I have reinstall latest version 3.2.4 and create startup automation script as mention above.
I have no clue what happened and why it works now. Script didnt’t help before. I will not do anything now, because it works.