-
Notifications
You must be signed in to change notification settings - Fork 43
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 Meter models passive broadcast decoding #506
Comments
I see #482 for the Outdoor Meter and am interested in what other devices are picked up on accident with those changes. Based on the comment here: 1technophile/OpenMQTTGateway#1845 (comment) @DigiH which specific ones also send that length of manufacturerdata? |
Unfortunately this is the problem with only looking at the manufacturerdata, as all SwitchBot devices have manufacturerdata which is 26 long, apart from the Outdoor Meter in your case with has one additional octet, making it 28 long. It is only the servicedata however, which includes the uniquely identifying device type octet. So any 26 long manufacturerdata without an additional servicedata with the device type indicator could be from a SwitchBot Curtain, Motion Sensor, Contact Sensor … So your above solution might work for your particular situation, where you only seem to have the Meter and Meter Plus, and the Outdoor Meter with its additional extra octet in its manufacturerdata, but for anyone else with some other SwitchBot devices this would not work and only produce constant mismatched decoder recognitions. |
One thing to look at and where we got a lot of the information from for our decoders is the semi-offical SwitchBot BLE API repo, which unfortunately doesn't seem to be updated with a lot of the recent firmware and new device changes. https://github.com/OpenWonderLabs/SwitchBotAPI-BLE If you find any further useful information there which could improve the decoders please let us know. |
Thank you for the info! I can see how that makes things difficult. Given that is the case, I guess my goal would need to be:
That would need a new function (or new argument to decodeBLEJson, or a dedicated key inside the passed JSON) to specify a device, along with other changes. I would understand if this is beyond the scope of this project, just let me know. |
If you are using your own project with Theengs Decoder you might want to introduce something similar to the white-list OpenMQTTGateway uses with the Decoder library, only allowing white-listed MAC addresses to decoded and published - although you do have both the Meter, Meter Plus AND Tile ;) Is there any particular reason why you are using a custom project which incorporates Theengs Decoder, other than OpenMQTTGateway or Theengs Gateway, with the latter also being available as a HA -Add-on. Obviously once we have the wrongly recognised Tile issue sorted out for either your project or our Theengs ones. |
I am wanting BLE->MQTT, but passive scan only. (which means I need to decode these broadcasts that don't have servicedata) If that can be achieved with either of those that would be amazing. |
Did you get a chance to try out the false positive Tile branch? The Outdoor Meter is already getting the temperature and humidity from the manufacturerdata, while for the Meter and Meter Plus you'd have to create your custom decoders. |
Are you clear on how to go about creating/changing the decoders in your own fork to allow for passive scanning and the decoding of temperature and humidity? The battery status won't work for any of the Meters, as this is only ever broadcast in the servicedata. |
Yes, thank you! |
Closing, as this is only really feasible on an individual basis due to the device ambiguity of only evaluating manufacturerdata for SwitchBot devices. |
Are you getting the same name broadcast with your SwitchBot Meters during passive scanning as this users - possibly with a newer firmware required? |
No new firmware available since I last checked in January. Even after being connected to the app and named there is no name in the broadcasts. Thank you for asking! |
I want to use passive mode to listen for the broadcast messages that get sent from the SwitchBot Meter. They seem to be sent when temperature or humidity changes.
In my testing I am able to see these messages, but since they do not include the service data they are not matched and decoded.
Would it be acceptable to modify the conditions to match the manufacturer data and extract data from there?
The data I am after (temp and humidity) is included in the manufacturer data field. (these broadcast messages do not include the service data field)
In active scan mode, the data is found in both manufacturer data and service data, which get sent in that case.
Active scan has the benefit of seeing the battery level in the service data, but I only want to check that daily. Is it possible to pull the other data from the manufacturer data and just decode the battery level when it is present?
Additional context
I copied output from running https://github.com/theengs/decoder/blob/d3882a16d03a643f311190e2133670acffe5c83e/examples/python/ScanAndDecode.py
with some small modifications to allow passive mode:
In the below outputs, Passive is with these changes while Active is with the original script.
(MAC in outputs redacted, all but first byte replaced with FF)
Switchbot Meter (non-Plus)
Meter Plus:
Outdoor Meter:
The text was updated successfully, but these errors were encountered: