sbm2mqtt
sbm2mqtt copied to clipboard
Doesn't work with firmware 2.7
After updating the firmware of Switchbot Meter from 2.6 to 2.7, Switchbot Meter is no longer detected by sbm2mqtt scan.
I don't know the cause, but I removed "services and services[0] == service_uuid" and it works now.
https://github.com/ronschaeffer/sbm2mqtt/blob/0fd3fa5e6656b76552fea544cf92559b208c7a1f/sbm2mqtt.py#L41
If you have time, please support firmware 2.7.
Thank you.
Thanks for the heads up. I'll take a look.
any update on this? I have just debugged my complete setup (it was offline for a while) only to find that this might be the issue ;)
After updating the firmware of Switchbot Meter from 2.6 to 2.7, Switchbot Meter is no longer detected by sbm2mqtt scan.
I don't know the cause, but I removed "services and services[0] == service_uuid" and it works now.
https://github.com/ronschaeffer/sbm2mqtt/blob/0fd3fa5e6656b76552fea544cf92559b208c7a1f/sbm2mqtt.py#L41
If you have time, please support firmware 2.7.
Thank you.
How did you remove this line? I've just tried (by removing and commenting out) and the script fails to run. I get an error.
After updating the firmware of Switchbot Meter from 2.6 to 2.7, Switchbot Meter is no longer detected by sbm2mqtt scan. I don't know the cause, but I removed "services and services[0] == service_uuid" and it works now. https://github.com/ronschaeffer/sbm2mqtt/blob/0fd3fa5e6656b76552fea544cf92559b208c7a1f/sbm2mqtt.py#L41
If you have time, please support firmware 2.7. Thank you.
How did you remove this line? I've just tried (by removing and commenting out) and the script fails to run. I get an error.
This code works:
if ( service_data and len(service_data) == 8 and service_data[2] == 0x54 ):
Tested with firmware 2.8. I guess this also works with 2.7
So remove line 41 like stated before, and also the "and" before service_data on line 42
Should be working now. Sorry for the slow reply. I'm no longer maintaining this project, because the official Home Assistant Switchbot integration now supports meters, See https://www.home-assistant.io/integrations/switchbot/ if you haven't already.