GadgetReactor / pyHS100

Python Library to control TPLink Switch (HS100 / HS110)
Other
409 stars 128 forks source link

LED config not working #186

Closed GeneralErrors closed 4 years ago

GeneralErrors commented 4 years ago

Is the LED configuration still functional as true/false?

Just started using pyHS100 and it discovers my HS200 as expected. Flag for LED is configured to True. Change flag to false and show status on the switch which shows the new configuration correctly. However, the LED on the switch itself is still illuminated. Only difference appears to be that the LED is illuminated regardless of if the switch is turned on or off. Original configuration only illuminated the LED when the switch was off.

rytilahti commented 4 years ago

Did it use to work with HS200? I don't think there has been any changes on that code, so maybe that's how the device handles that action. If you can control the light with the Kasa app, maybe we can adapt our code to allow doing the same.

GeneralErrors commented 4 years ago

Honestly I am not sure - my only guess based off of other posts is I think so.

Home Assistant used to support this configuration but dropped it for configuration simplicity and the option availability in pyhs100. OpenHab appears to have a configuration for it as well, but I don't have an implementation of it to test with / nor am I sure what they are using to communicate with the HS200.

I have confirmed that the configuration works as expected on the HS110. Debug output is the same changing the configuration between the two, so perhaps my expectations are just incorrect?

Turning led to False DEBUG:pyHS100.protocol:> (39) {"system": {"set_led_off": {"off": 1}}} DEBUG:pyHS100.protocol:< (41) {"system":{"set_led_off":{"err_code":0}}}

Switch status shows as ...

== NAME - HS200(US) == OFF Host/IP: X.X.X.X LED state: False On since: 2019-11-15 11:59:55.397207 == Generic information == Time: 2019-11-15 11:59:55 Hardware: 1.0 Software: 1.2.5 Build 171206 Rel.090404 MAC (rssi): XX.XX.XX.XX.XX.XX Location: {'latitude': XX.XXXX, 'longitude': XX.XXXX} == Emeter == Device has no emeter

I don't see anywhere in the app to change the LED configuration, for either the HS110 or 200.

GeneralErrors commented 4 years ago

So this works as I expected for the HS210 (three way switches) … Switch in an off state has the LED off. Switch in an on state has the LED off.

Still experiencing the same issue with the HS200 though. I found a firmware tool that allowed me to rollback the TPLink firmware from build 171206 to build 171016 but I have the same issue after doing so.

Ended up installing OpenHab to test with that and have the same issue. Added the HS200 switch as a 210 to see if maybe it was sending a different syntax or something, but the issue persisted through that as well.

Do you know a specific firmware that was supported?

GeneralErrors commented 4 years ago

A little further troubleshooting and the issue is with the HW version.

Version 2 and 3 work as expected.

Version 1 doesn't implement the LED state correctly. This is going to be a HW limitation and I doubt there's anything that can be done in the code to change this. Not sure if you want to notate any of that in the documentation, but I appreciate your help.