OpenWonderLabs / SwitchBotAPI

SwitchBot Open API Documents
895 stars 73 forks source link

batteries status always 100% #304

Open LivingMachine00 opened 6 months ago

LivingMachine00 commented 6 months ago

Analysis

While other parameter values are correct (direction, slideposition) the battery value of this blind tilt device is always 100%: I used samples found here, this is the json answer: {'statusCode': 100, 'body': {'deviceId': 'xxxxxxxxxxx', 'deviceType': 'Blind Tilt', 'hubDeviceId': 'xxxxxxxxxxx', 'version': 20, 'calibrate': True, 'battery': 100, 'direction': 'Down', 'slidePosition': 50}, 'message': 'success'}

Expected Behavior

battery value updated

Steps To Reproduce

using a sample py script calling the endpoint: 'https://api.switch-bot.com/v1.1/devices/' + DEVICE_ID + '/status'

Logs

answ = 200
{'statusCode': 100, 'body': {'deviceId': 'xxxxxxxxxxx', 'deviceType': 'Blind Tilt', 'hubDeviceId': 'xxxxxxxxxxx', 'version': 20, 'calibrate': True, 'battery': 100, 'direction': 'Down', 'slidePosition': 50}, 'message': 'success'}

Configuration

- OS: windows 11
- Software: running py script with vs code

Environment

Additional Context

No response

kaboemm commented 4 months ago

Please fix this. This has been a bug for so long now. I still cant use battery icons on my homeassistant because they're not working.

kaboemm commented 3 months ago

I know its not the HomeAssistant plugin. The problem is with the SwitchBot API just not returning the correct values. I talk directly to the API with Python without any form of HA plugin and I get the wrong numbers. Seems like its a forgiven case as this issues has been around forever. Too bad

clearbrian commented 2 months ago

for outdoor meter pro im seeing battery as 50 in the api. but in the app is always shown as 100%. I just started buying switchbot meters so will update when batteries start to drop.
https://api.switch-bot.com/v1.1/devices/C76A01862466/status {"statusCode":100,"body":{"deviceId":"C76A01862466","deviceType":"WoIOSensor","humidity":66,"temperature":23.4,"version":"V0.5","battery":50},"message":"success"} "battery":50 - in official switchbot app its 100%

cricou76 commented 1 month ago

still same issue ...

Titou84240 commented 4 days ago

Hi All , Any update on this topic please ?