I’ve been following this post and still am unable to see a solution that’s easy for people to implement and test.
I’ll list the two files I use on my Pi. I only have the latest TP Link firmware on my switch so this hasn’t been tested on the older firmware.
I did a dodgy workaround in smartdevice.py where it uses TRYs and EXCEPTIONs in place of the IF THEN statements that are currently used.
I’ve used onlinewarrior40’s solution for tplink.py.
I’ve uploaded smartdevice.py and tplink.py to my Google Drive.
Put tplink.py in the config\custom_components\switch folder on your HA installation.
You’ll need to overwrite the other smartdevice.py file that’s currently in your HA build.
You’ll need to ssh as root, change to the root directory of the installation and run the following command:
find “.” -name “smartdevice.py”
You’ll see a number of results, one will look like this:
/var/lib/docker/aufs/diff/somelargehexnumber/usr/lib/python3.6/site-packages/pyHS100/smartdevice.py
That’s the file you need to replace so copy the smartdevice.py over that one, reboot and it should work.
It will stop working when you update HA next as the smartdevice.py will get overwritten so you will need to repeat the bits from the line break to get it working again.