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

Add support for WoSensorTHP (passive THX1(W230150X)) #518

Closed
johannes-z opened this issue Feb 19, 2024 · 7 comments
Closed

Add support for WoSensorTHP (passive THX1(W230150X)) #518

johannes-z opened this issue Feb 19, 2024 · 7 comments

Comments

@johannes-z
Copy link

johannes-z commented Feb 19, 2024

Is your feature request related to a problem? Please describe.
Add support for the device WoSensorTHP. This is the name in the advertisement data when using BLE passive with a THX1(W230150X) device.

Describe the solution you'd like
Add support for the device.

Describe alternatives you've considered

Additional context

DEBUG:BLEGateway:11:22:33:44:55:66:AdvertisementData(local_name='WoSensorTHP', manufacturer_data={2409: b'\xf3\xa5]\x0eW!_\x01\x04\x96)'}, service_uuids=['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', 'cba20d00-224d-11e6-9fb8-0002a5d5c51b'], rssi=-70)
DEBUG:BLEGateway:Sent `{"manufacturerdata": "6909f3a55d0e57215f01049629", "name": "WoSensorTHP", "id": "11:22:33:44:55:66", "rssi": -70, "mfr": "Woan Technology (Shenzhen) Co., Ltd."}` to topic `home/TheengsGateway/BTtoMQTT/112233445566`
@DigiH
Copy link
Member

DigiH commented Feb 20, 2024

Hi @johannes-z

Do you know which firmware version your SwitchBot Meter has?

I'm just wondering if it constantly send its name "name": "WoSensorTHP" when you scan passively, as with the majority of devices the name only gets broadcast during active scanning.

Also other users with the three kind of SwitchBot Meters do not get any name broadcast during passive scanning.

#506

@johannes-z
Copy link
Author

johannes-z commented Feb 20, 2024

@DigiH Thanks for your reply!

I installed the switchbot app; it reports V0.6.

@DigiH
Copy link
Member

DigiH commented Feb 20, 2024

I'm just really curious as to why you are getting "name": "WoSensorTHP" with passive scanning, while others with the same model don't even get a name broadcast during active scanning - so wondering if it might be hardware revision/firmware related.

So I don't think we can just replace the current active scan dependant decoder, but could possibly add one with a passive only, but name related model condition.

Could you have a look with MQTT Explorer to see if the history of your SwitchBot Meter's MQTT messages all have the name included?

@johannes-z
Copy link
Author

Here are the messages sent via MQTT. All of them include the name.

{"manufacturerdata": "6909f3a55d0e57214a0109962f", "name": "WoSensorTHP", "id": "F3:A5:5D:0E:57:21", "rssi": -67, "mfr": "Woan Technology (Shenzhen) Co., Ltd."}
{"manufacturerdata": "6909f3a55d0e57214a0109962f", "name": "WoSensorTHP", "id": "F3:A5:5D:0E:57:21", "rssi": -67, "mfr": "Woan Technology (Shenzhen) Co., Ltd."}
{"manufacturerdata": "6909f3a55d0e5721490100972f", "name": "WoSensorTHP", "id": "F3:A5:5D:0E:57:21", "rssi": -67, "mfr": "Woan Technology (Shenzhen) Co., Ltd."}
{"manufacturerdata": "6909f3a55d0e57214801009732", "name": "WoSensorTHP", "id": "F3:A5:5D:0E:57:21", "rssi": -67, "mfr": "Woan Technology (Shenzhen) Co., Ltd."}
{"manufacturerdata": "6909f3a55d0e57214601009738", "name": "WoSensorTHP", "id": "F3:A5:5D:0E:57:21", "rssi": -67, "mfr": "Woan Technology (Shenzhen) Co., Ltd."}
{"manufacturerdata": "6909f3a55d0e5721410908964e", "name": "WoSensorTHP", "id": "F3:A5:5D:0E:57:21", "rssi": -67, "mfr": "Woan Technology (Shenzhen) Co., Ltd."}
{"manufacturerdata": "6909f3a55d0e57213e0908965b", "name": "WoSensorTHP", "id": "F3:A5:5D:0E:57:21", "rssi": -67, "mfr": "Woan Technology (Shenzhen) Co., Ltd."}
{"manufacturerdata": "6909f3a55d0e57213c0908965b", "name": "WoSensorTHP", "id": "F3:A5:5D:0E:57:21", "rssi": -67, "mfr": "Woan Technology (Shenzhen) Co., Ltd."}
{"manufacturerdata": "6909f3a55d0e57213b0900975b", "name": "WoSensorTHP", "id": "F3:A5:5D:0E:57:21", "rssi": -67, "mfr": "Woan Technology (Shenzhen) Co., Ltd."}
{"manufacturerdata": "6909f3a55d0e5721380105983c", "name": "WoSensorTHP", "id": "F3:A5:5D:0E:57:21", "rssi": -67, "mfr": "Woan Technology (Shenzhen) Co., Ltd."}

@DigiH
Copy link
Member

DigiH commented Feb 20, 2024

I've added a manufacturerdata & name only decoder for the SwitchBot Meter (Plus)

No battery info AFAIK in the manufacturerdata though.

#519

Can you build your own version of Decoder or install the PR test build artifact for verification of the PR?

https://github.com/theengs/decoder/actions/runs/7977440614/artifacts/1260257517

@johannes-z
Copy link
Author

Yay, it works:

{
  "manufacturerdata": "6909f3a55d0e5721670100972d",
  "name": "WoSensorTHP",
  "id": "xxx",
  "rssi": -68,
  "brand": "SwitchBot",
  "model": "Meter (Plus)",
  "model_id": "THX1/W230150X",
  "type": "THB",
  "tempc": 23,
  "tempf": 73.4,
  "hum": 45,
  "mac": "xxx"
}

Sadly, as you said, no battery information. I wonder how Home Assistant does it via the SwitchBot Integration...

@DigiH
Copy link
Member

DigiH commented Feb 20, 2024

Sadly, as you said, no battery information. I wonder how Home Assistant does it via the SwitchBot Integration...

With active scanning or even by connection I would assume ;)

With OpenMQTTGateway you would be able to have different scanning intervals for passive scanning and active scanning, which would allow to egt the battery level only every hour or so.

Closing as I'm merging this additional SwitchBot Meter (Plus) manufacturerdata & name only decoder.

@DigiH DigiH closed this as completed Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants