Hi,
I’m trying to understand how Local Tuya still works for me, even after my devices changed their IP, and why do we need to configure a host attribute at all.
I have configured my devices (lights and plug) manually with Local Tuya and provided each device’s IP in the host attribute.
After a power failure in my apartment, my devices reconnected to the router and got a different IP than they had. Still, HA showed the devices and I was able to control them.
Looking at the logs, I saw that LocalTuya uses UDP broadcast to identify devices, and I assumed it was able to match the reported device ID with the the device ID I provided in the configuration. I was also able to get the devices to respond after changing the host attribute of each device to a non-valid IP (for example - “…”).
- Is LocalTuya indeed able to reconnect to devices even after they change their IP?
- Is (1) is true, then why do we need to provide a host attribute?
- Given that I provide device_id and device_key for all my devices, is it ok to set an invalid IP in the host attribute and let LocalTuya discover their IP?