rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.81k stars 542 forks source link

Good way to find host IP addresses or device yaml configuration without "host" entry #375

Open yomotherboard opened 3 years ago

yomotherboard commented 3 years ago

Firstly thank you to everyone involved for your very helpful work! I got a couple lumary recessed lights, saw they used ESP (were even tuya-convertable), so I ordered 60. Opened the new ones up to find that they switched chipsets... Yea I freaked out. Anyway this is saving me from a huge disaster.

Is there a good (scriptable) way to get the host IP address for various devices? I have over 60 identical lights, whose hostname are all showing up as "wlan0" on my router. localtuya seems to find most of the lights (about 80% of them) despite me putting the wrong host IP for all of the entries in their configuration files. However, it does give an error that it cannot connect to the IP address (as expected). If I remove any of the configuration files for a light it shows up as unavailable, so I know they are not being discovered completely by some auto-discovery method.

If there is a way for me to get the IP addresses through an API or cli, or for this to be optional in the configuration, this would allow me (and could help others) to automate the entire process if new devices are added or old ones need to be reconnected. I tried leaving the host field out of my configuration but I got:

Invalid config for [localtuya]: required key not provided @ data['localtuya'][0]['host']. Got None. (See /config/configuration.yaml, line 71). Please check the docs at https://github.com/rospogrigio/localtuya/

I think this problem has to do with my configuration as well; the discovery feature doesn't seem to be working at all.

Here are my logs without debugging enabled. They just loop like this, with whatever I gave as the host ip in the error output:

2021-03-01 15:05:19 ERROR (MainThread) [custom_components.localtuya.common] [eba...mei] Connect to 10.0.0.27 failed
Traceback (most recent call last):
  File "/config/custom_components/localtuya/common.py", line 149, in _make_connection
    status = await self._interface.status()
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 472, in status
    status = await self.exchange(STATUS)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 457, in exchange
    payload = self._decode_payload(msg.payload)
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 559, in _decode_payload
    return json.loads(payload)
  File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Here are my logs with debugging enabled:

2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebd...orh] Closing connection
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...mei] Stopped heartbeat loop
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb4...ioq] Stopped heartbeat loop
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebd...orh] Stopped heartbeat loop
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...act] Connection lost: None
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.common] [eb9...act] Disconnected - waiting for discovery broadcast
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...mei] Connection lost: None
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.common] [eba...mei] Disconnected - waiting for discovery broadcast
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb4...ioq] Connection lost: None
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.common] [eb4...ioq] Disconnected - waiting for discovery broadcast
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebd...orh] Connection lost: None
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.common] [ebd...orh] Disconnected - waiting for discovery broadcast
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.161', 'gwId': 'ebd140053320f8787a6lyn', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya] Device ebd140053320f8787a6lyn found with IP 10.0.0.161
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.4', 'gwId': 'ebb7f076777154659eme2b', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya] Device ebb7f076777154659eme2b found with IP 10.0.0.4
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.121', 'gwId': 'eb96cdb8207887ff19hhwf', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya] Device eb96cdb8207887ff19hhwf found with IP 10.0.0.121
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.130', 'gwId': 'eb90ad5e46632b1918hisa', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya] Device eb90ad5e46632b1918hisa found with IP 10.0.0.130
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.97', 'gwId': 'ebfa922a5824beaa2f3yyy', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya] Device ebfa922a5824beaa2f3yyy found with IP 10.0.0.97
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.87', 'gwId': 'ebb8def019d1042adeddxi', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya] Device ebb8def019d1042adeddxi found with IP 10.0.0.87
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.233', 'gwId': 'ebbd7bc61e998bd56aohsj', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:07:54 DEBUG (MainThread) [custom_components.localtuya] Device ebbd7bc61e998bd56aohsj found with IP 10.0.0.233
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb2...o8f] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb2...o8f] Got heartbeat response
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb2...jj4] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb2...o8f] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...nq7] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...nq7] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...nq7] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...nq7] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...nq7] Got heartbeat response
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...nq7] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebf...peh] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebf...peh] Got heartbeat response
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebd...lyn] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebd...lyn] Got heartbeat response
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebf...peh] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebd...lyn] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...pm8] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...pm8] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...pm8] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...7ov] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...7ov] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...7ov] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...1y1] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...1y1] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...1y1] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...hwf] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...hwf] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...hwf] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...e2b] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...e2b] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...e2b] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...pm8] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...pm8] Got heartbeat response
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...7ov] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...7ov] Got heartbeat response
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb8...pm8] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...7ov] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...1y1] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...1y1] Got heartbeat response
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...1y1] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...e2b] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...e2b] Got heartbeat response
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...e2b] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...hwf] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...hwf] Got heartbeat response
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...hwf] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...isa] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...isa] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...isa] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebf...yyy] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebf...yyy] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebf...yyy] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...isa] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...isa] Got heartbeat response
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebf...yyy] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebf...yyy] Got heartbeat response
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...isa] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebf...yyy] Decrypted payload: {}
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...q1i] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...q1i] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...q1i] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...fni] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...fni] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...fni] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...erg] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...erg] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...erg] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...hsj] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...hsj] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...hsj] Waiting for sequence number -100
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...dxi] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...dxi] Send payload: b'{}'
2021-03-01 15:08:40 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...dxi] Waiting for sequence number -100
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...dxi] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...dxi] Got heartbeat response
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...dxi] Decrypted payload: {}
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...hsj] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...hsj] Got heartbeat response
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [ebb...hsj] Decrypted payload: {}
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...fni] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...fni] Got heartbeat response
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...fni] Decrypted payload: {}
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...erg] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...erg] Got heartbeat response
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb9...erg] Decrypted payload: {}
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb1...ew1] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb1...ew1] Send payload: b'{}'
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb1...ew1] Waiting for sequence number -100
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb1...ew1] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb1...ew1] Got heartbeat response
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb1...ew1] Decrypted payload: {}
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...q1i] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...q1i] Got heartbeat response
2021-03-01 15:08:41 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...q1i] Decrypted payload: {}
2021-03-01 15:08:42 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...qlt] Sending command heartbeat (device type: type_0a)
2021-03-01 15:08:42 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...qlt] Send payload: b'{}'
2021-03-01 15:08:42 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...qlt] Waiting for sequence number -100
2021-03-01 15:08:42 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...qlt] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2021-03-01 15:08:42 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...qlt] Got heartbeat response
2021-03-01 15:08:42 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eb0...qlt] Decrypted payload: {}

It also seems to be in a loop. Here a minute later the fresh debug output look exactly the same as the beginning of the output I posted above.

2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...mei] Closing connection
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...mei] Stopped heartbeat loop
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya.pytuya] [eba...mei] Connection lost: None
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya.common] [eba...mei] Disconnected - waiting for discovery broadcast
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.161', 'gwId': 'ebd140053320f8787a6lyn', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya] Device ebd140053320f8787a6lyn found with IP 10.0.0.161
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.4', 'gwId': 'ebb7f076777154659eme2b', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya] Device ebb7f076777154659eme2b found with IP 10.0.0.4
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.121', 'gwId': 'eb96cdb8207887ff19hhwf', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya] Device eb96cdb8207887ff19hhwf found with IP 10.0.0.121
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.130', 'gwId': 'eb90ad5e46632b1918hisa', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya] Device eb90ad5e46632b1918hisa found with IP 10.0.0.130
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.97', 'gwId': 'ebfa922a5824beaa2f3yyy', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya] Device ebfa922a5824beaa2f3yyy found with IP 10.0.0.97
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.87', 'gwId': 'ebb8def019d1042adeddxi', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya] Device ebb8def019d1042adeddxi found with IP 10.0.0.87
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '10.0.0.233', 'gwId': 'ebbd7bc61e998bd56aohsj', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
2021-03-01 15:10:04 DEBUG (MainThread) [custom_components.localtuya] Device ebbd7bc61e998bd56aohsj found with IP 10.0.0.233

I just copied and pasted this from the supervisor log page but I will get the full output if I can figure out how or if someone can tell me. It seems to be going by too fast to capture everything.

imkebe commented 3 years ago

In general i figured out that key contains last 6 letters of MAC address (which is also present at device hostname ex. ESP-DE4E3F) . So you can find devices by seeking MAC addres in dhcp leases on you router (dhcp sever).