noeau wrote:Same here. I get the "socket not connected" error on 2 of 3 switches. The third one is in the same circuit and location as the other 2. I just updated to the newest plugin and re-added the 3 plugs. They work fine. I just get the error message every second or so.
Please note, the physical electrical circuit to which the TP-Link plug is connected means nothing. All that matters is the quality of the Wi-Fi connection between the TP-Link device and the Wi-Fi network. The error you and @qcvictor are reporting is occurring in the section of the code where the plugin polls the device for its current state. If you are interested, here is the actual code involved.
- Code: Select all
try:
result = tplink_dev_states.send('info')
self.logger.debug("%s connection received (%s)" % (self.name, result))
data = json.loads(result)
except Exception as e:
self.logger.error("%s connection failed with (%s)" % (self.name, str(e)))
The error occurs on the attempt to get the current state (
result). The error reported is caused because no connection to the TP-Link is opened. This may be due to poor connectivity, network congestion or the target device being busy.
If you want to try a small experiment, and are comfortable editing Python code, you could try to increase the socket connection timeout value. The is located in
tplink_smartplug.py on line
36- Code: Select all
s.settimeout(2.0)
You can try increasing the value to 3.0, 3.5 or even 4.0. If that works, please report back here and I can update the plugin.