-
Notifications
You must be signed in to change notification settings - Fork 792
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 Curtain Data is not decoded #1412
Comments
Hi @sebbo2002, SwitchBot Curtains should be supported, but we could not verify it with all models/versions of the the Curtains releases. Could you let us know which version/model you have, and also if you use prebuilt binaries/web upload or make you own builds with Platformio, so we can supply an updated test version for you. For your above undecoded message would this be correct for the then Curtains state?
|
Fantastic news 🥳
My SwitchBot Curtains are on Firmware Version 6.0. I only used prebuild binaries (tried both ttgo-t-beam-firmware.bin and esp32dev-ble-firmware.bin) and uploaded them via web and espool (I wanted to try both to rule out an error here). I use an Heltec WiFi/Lora Board with Display, but I only need BLE for my needs. I was a bit unsure about the build selection, so I tried a bit. LoRa / display sure would be a plus, but I assume that's not possible in parallel, right?
Unsure about the model id, but at least for position, calibrated, lightlevel and battery I can say that's correct. |
SwitchBot Curtain fix for 1technophile/OpenMQTTGateway#1412 (comment)
Thanks for the info and confirmation about the decoded details. A test build is currently running, will give you the link to download binaries for final testing on your side. An actual display for decoded BLE device status on your Heltec board is also in the works by @NorthernMan54, similar to the already implemented rtl_433 information, so with a future update you will be able to see your SB Curtains and other devices info on it. |
Thank you for the quick reply and solution. I'll wait for the link then.
Oh wow, very cool. I'm definitely looking forward to it, thanks for the info. |
While the status decoding test build is still running you might also want to try the control of the SwitchBot Curtains with the OpenMQTTGateway WRITE command, as we don't actually have any confirmation about its correct working yet, but the commands should be as follows: Open : 570F450105FF00 With For example for closing
|
To be honest, I don't know if I'm doing it correctly right now, so I'll go into a little more detail: I sent this payload via MQTT (topic {
"ble_write_address":"EC:B9:3A:06:BF:96",
"ble_write_service":"cba20d00-224d-11e6-9fb8-0002a5d5c51b",
"ble_write_char":"cba20002-224d-11e6-9fb8-0002a5d5c51b",
"ble_write_value":"570F450105FF64",
"value_type":"HEX",
"ttl":4,
"immediate":true } Is this correct? If so, it unfortunately fails. Extract from the Serial Log:
|
Looks fine, but with "mac_type":1 this also needs to be added to the WRITE command, as the default is "mac_type":0 |
Closing works like a charm (😍), give me a minute to check open/position/stop as well… Update: Works perfectly great, I am thrilled.
|
Thanks a lot for the actual confirmation, what so far has only been theoretical :) |
Could you tell us which controller you are using with the OpenMQTTGateway output- Home Assistant, OpenHAB … some other? |
I use FHEM. I have too much stuff in there and don't dare migrate to something else 😂 |
No worries, that wasn't the intention, but with your above confirmation of the control commands we are now planning on including these in OpenMQTTGateway with auto-discovery of them and direct inclusion in the UI of compatible controllers. With FHEM you will still be able to send the commands as above :) |
The test build has finished and you can download your relevant binary at https://github.com/1technophile/OpenMQTTGateway/tree/gh-pages/dev/firmware_build or through the test web upload https://docs.openmqttgateway.com/dev/upload/web-install.html |
Oh, no, unfortunately I don't have anything from that. But I can manage very well with the Write command. 👍🏼 |
It just works like a dream. Thank you very much, that really helped me a lot. The ticket ca be closed, if there's not anything still open so that the changes end up in the next release. |
Thanks a lot for you collaboration and confirmation! I'll merge the fix into Decoder and it will be included in a future update of OpenMQTTGateway. |
SwitchBot Curtain fix for https: //github.com/1technophile/OpenMQTTGateway/issues/1412#issuecomment-1399518643 Co-Authored-By: Sebastian <812398+sebbo2002@users.noreply.github.com>
SwitchBot Curtain fix for https: //github.com/1technophile/OpenMQTTGateway/issues/1412#issuecomment-1399518643 Co-Authored-By: Sebastian <812398+sebbo2002@users.noreply.github.com> Co-authored-by: Sebastian <812398+sebbo2002@users.noreply.github.com>
If you don't mind and if you get a few minutes, would you mind confirming if the SwitchBot Curtains require active scanning, which is the current default, or if their advertising data would still be received and decoded with passive scanning. https://docs.openmqttgateway.com/use/ble.html#setting-if-the-gateway-use-active-or-passive-scanning Many thanks |
Good morning, without having tested it: the SwitchBot curtains always send out their Bluetooth advertisements, even without active scanning. I know this because my previous solution doesn't support active scanning at all. But I can also try it again tonight with OpenMQTTGateway, just to be 100% sure. |
Okay, so I still get events without active scanning, but the payload doesn’t seem to be parsed correctly anymore. Then I only get messages like this: |
This means that with passive scanning there is no servicedata being broadcast/received, so nothing which can be used for decoding. Could you just try the following command to make sure all data publishing is ON But it's very likely that the SwitchBot Curtains needs active scanning, as all the other SwitchBot devices seem to behave that way. |
Before: {"id":"FA:83:ED:1F:81:8D","rssi":-74,"brand":"SwitchBot","model":"Curtain","model_id":"W070160X","motion":false,"position":0,"calibrated":true,"lightlevel":1,"batt":95} After {"id":"FA:83:ED:1F:81:8D","mac_type":1,"adv_type":0,"manufacturerdata":"6909fa83ed1f818d110f001104","rssi":-72} |
Thank you for the confirmation. So the SB Curtains do require active scanning, like the other SwitchBot devices. If you leave |
https://docs.openmqttgateway.com/upload/troubleshoot.html
Describe the bug
OpenMQTTGateway caught my eye because, according to its website, it supports SwitchBot Curtains and thus could replace the hub I currently use. On compatible.openmqttgateway.com SwitchBot Curtains is not listed, so I don't know which data source is correct and if the product is really supported. Here it's listed again as a new and supported product, so I assume it's a bug.
In any case, it can be stated that SwitchBot curtain advertisements are currently not parsed correctly for me and only the raw data ends up in MQTT / Serial Log. Is this correct? Which of the two websites represents the correct implementation status?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect the values contained in the advertisement (motion state/position/light level/battery/calibration state) to be included in the JSON. Instead, only the raw data is included. Other bluetooth devices like the
LYWSDCGQ
I have here are correctly parsed.Screenshots
If applicable, add screenshots to help explain your problem.Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: