Danielhiversen / pySwitchmate

Library to control Switchmate
MIT License
4 stars 6 forks source link

Switchmate RSW doesn't update status #9

Open kzaoaai opened 4 years ago

kzaoaai commented 4 years ago

Hello,

I just moved to this component since I switched from Hassbian to Hassos. Before, I was using switch_template that polls the status of my switch and keeps it reflected correctly in HA. Since I cannot figure out how to use the python script in Hassos, I gave your component a try. The switchmate is detected and is triggered but if I toggle it manually, HA doesn't detect the change. This results in false state, turning on or off will just toggle to the opposite state. I am not sure if this is the intended end result or am I missing something?

firstweprogram commented 4 years ago

I have also had the same problem. I'm not sure if the version of the device matters or the firmware. After looking at it for a bit, it appears that the switchmate stores two separate states, one for manual and one for bluetooth. I've manually tested a fix for it but haven't been able to verify in home-assistant yet.

kzaoaai commented 4 years ago

I'd be willing to test.

firstweprogram commented 4 years ago

I was finally able to test it, made some tweaks and it appears to be working. Alright, I made a fork. Unfortunately I made a branch then forgot to switch to it. Oops. So, the change is in master. Pull the whole thing and install it via pip. Version needs to stay the same since that's what home assistant is expecting (Use this one instead of mine, https://github.com/valkjsaaa/pySwitchmate)

kzaoaai commented 4 years ago

sorry I totally missed this. How can I install via pip if I'm running HA container (not Hassbian)?

firstweprogram commented 4 years ago

First thing first, https://github.com/valkjsaaa/pySwitchmate fixed it correctly (mine not as good) so go with that. Second you'll probably have to be inside of the HA container to use pip to install.

vanstinator commented 3 years ago

This is an old issue but this should be resolvable today if you set the default timeout to a lower value. The next version of the home assistant integration will lower the scan delay by default