Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switchbot battery #41

Closed
matt8707 opened this issue Jul 26, 2021 · 2 comments
Closed

Switchbot battery #41

matt8707 opened this issue Jul 26, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@matt8707
Copy link

Hi, is receiving battery info supported?

Currently using https://github.com/OpenWonderLabs/python-host


With pySwitchbot, but that library likes to randomly throw errors

import switchbot
sb = switchbot.Switchbot(mac="aa:bb:cc:dd:ee:ff")
print(sb.get_device_data()["data"].get("battery"))
@fphammerle fphammerle added the enhancement New feature or request label Jul 26, 2021
@fphammerle
Copy link
Owner

Hi, adding support to receive the battery state is currently blocked by the issue described here: #31 (comment)

In summary: get_device_data calls BLEScanner().start(). Unfortunately, scanning for low-energy bluetooth devices requires elevated privilleges (incompatible with typical docker setups)

fphammerle added a commit that referenced this issue Oct 16, 2021
…ew method `_MQTTControlledActor._get_device` (to prepare retrieval of battery state for button automators)

#41
fphammerle added a commit that referenced this issue Oct 16, 2021
…/switchbot/MAC_ADDRESS/battery-percentage` after every command

#41
@fphammerle
Copy link
Owner

new release v2.0.0 reports battery levels on topic homeassistant/cover/switchbot/MAC_ADDRESS/battery-percentage (enable with command-line option --fetch-device-info)

please open a new issue, if that doesn't work for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants