tuya-local
tuya-local copied to clipboard
Import keys automatically from iot.tuya.com
Is there a way to import the tuya keys after extracting from iot.tuya.com?
Not in the libraries currently available for python, which Home Assistant integrations use. Currently only the nodejs library and tuyacli app connect to iot.tuya.com
There does appear to be provision for this in tinytuya, but currently it is implemented as a command-line wizard, and I think will require refactoring of the library itself to make work entirely within HA.
localtuya manages to do this, somehow?
localtuya maintains its own fork of pytuya. I don't have the bandwidth to do that, so I rely on tinytuya, which is the most maintained fork of pytuya. tinytuya does support discovery now, but as they do not support asyncio, it is a bit more complex to integrate than I would like, probably it is below #682 on the priority list for major changes.
Also, if this integration does discovery, it will make it mutually exclusive with localtuya - currently it is possible to use some devices with this, and some with localtuya, provided you do not try to use auto IP address detection. For standard discovery protocols, Home Assistant works around this mutual exclusivity by making the discovery an HA provided service, but since tuya does not use standard protocols, we have to implement it at the integration level which will block all other integrations trying to use the same discovery ports.
Also, if this integration does discovery, it will make it mutually exclusive with localtuya - currently it is possible to use some devices with this, and some with localtuya, provided you do not try to use auto IP address detection. For standard discovery protocols, Home Assistant works around this mutual exclusivity by making the discovery an HA provided service, but since tuya does not use standard protocols, we have to implement it at the integration level which will block all other integrations trying to use the same discovery ports.
Isn't more simple to bind MAC address of devices from ARP table. Each device have unique MAC address in difference of IP. If router restart start to give random IP's if not set to bind them to specific one.