alextud / ha-switchbot-curtain

Controls switchbot curtain using Home Assistant
MIT License
55 stars 16 forks source link

Battery percentage readings feature request #8

Closed TL-HA closed 3 years ago

TL-HA commented 3 years ago

Hi this is working great so thank you. It would be really usefully to be able to see the battery % in Home Assistant of Switchbot curtains. Is there any way to add this?

nmajin commented 3 years ago

This is definitely possible, looks like the nodejs example here can pull that data:

https://github.com/OpenWonderLabs/node-switchbot#curtain-wocurtain

I tested this out and I was able to get the battery (accurately) via a test node app. However, the custom component is in python and it looks like some of the scanning code might be able to provide the battery from here, but I could not get this working (python2) or the python3 version:

https://github.com/OpenWonderLabs/python-host/blob/master/switchbot.py