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

Support Curtain 3 #218

Merged
merged 2 commits into from
Sep 16, 2023
Merged

Support Curtain 3 #218

merged 2 commits into from
Sep 16, 2023

Conversation

the-ress
Copy link
Contributor

@the-ress the-ress commented Sep 16, 2023

Adds Curtain 3 support. Fixes home-assistant/core#99105.

It has a new model character ({/[), but otherwise seems to work with the existing code. It also includes battery level in manufacturer data. I'm not sure if that's specific to Curtain 3, or firmware 0.7.

In passive mode, Curtain 3 gets detected as a contact sensor because it has the same manufacturer data length. I couldn't figure out how to distinguish between them (and I don't have any contact sensors to investigate further).

Here are some manufacturer data values I recorded during testing.
byte 0 counter?
byte 1 ?
byte 2 position
byte 3 light level, device chain
byte 4 ?
byte 5 00
byte 6 battery

dc-xx-xx-xx-xx-xx-e5-03-00-11-03-00-56
ed-xx-xx-xx-xx-xx-a6-03-00-11-04-00-4b
d2-xx-xx-xx-xx-xx-cb-03-63-11-04-00-57
ed-xx-xx-xx-xx-xx-c4-03-b0-11-04-00-4b opening
ed-xx-xx-xx-xx-xx-c5-03-ad-11-04-00-4b opening
ed-xx-xx-xx-xx-xx-c6-03-aa-11-04-00-4b opening
ed-xx-xx-xx-xx-xx-c7-03-a8-11-04-00-4b opening
ed-xx-xx-xx-xx-xx-ce-03-19-11-04-00-4b stopped
ed-xx-xx-xx-xx-xx-da-03-00-11-04-00-4b stopped at open
ed-xx-xx-xx-xx-xx-e5-03-00-11-04-00-4b stopped at open
ed-xx-xx-xx-xx-xx-0f-03-64-11-04-00-4b stopped at closed
ed-xx-xx-xx-xx-xx-10-07-e4-11-04-00-4a opening
ed-xx-xx-xx-xx-xx-11-07-e3-11-04-00-4a opening
ed-xx-xx-xx-xx-xx-12-07-e1-11-04-00-4a opening
ed-xx-xx-xx-xx-xx-13-07-de-11-04-00-4a opening
ed-xx-xx-xx-xx-xx-19-07-ce-11-04-00-4a opening then stopped
ed-xx-xx-xx-xx-xx-1a-07-cb-11-04-00-4a opening then stopped
ed-xx-xx-xx-xx-xx-1d-07-48-11-05-00-4a opening then stopped
ed-xx-xx-xx-xx-xx-20-07-cd-11-05-00-4a closing then stopped
ed-xx-xx-xx-xx-xx-21-07-d0-11-05-00-4a closing then stopped
ed-xx-xx-xx-xx-xx-23-07-51-11-05-00-4a stopped
ed-xx-xx-xx-xx-xx-2c-07-64-11-04-00-4a stopped at closed
ed-xx-xx-xx-xx-xx-32-07-d8-11-04-00-4a opening
ed-xx-xx-xx-xx-xx-35-07-d0-11-04-00-4a opening
ed-xx-xx-xx-xx-xx-55-07-00-11-04-00-4a stopped at open
ed-xx-xx-xx-xx-xx-55-07-00-11-04-00-4a stopped at open again

@bdraco
Copy link
Collaborator

bdraco commented Sep 16, 2023

We can remove the passive detection of contact sensors by deleting the line with the 13 length.

@bdraco bdraco merged commit 8c38ab8 into Danielhiversen:master Sep 16, 2023
4 checks passed
@bdraco
Copy link
Collaborator

bdraco commented Sep 16, 2023

Thanks @the-ress

@bdraco
Copy link
Collaborator

bdraco commented Sep 16, 2023

https://github.com/Danielhiversen/pySwitchbot/releases/tag/0.40.0

@the-ress the-ress deleted the curtain3 branch September 16, 2023 15:05
@the-ress
Copy link
Contributor Author

We can remove the passive detection of contact sensors by deleting the line with the 13 length.

Won’t that break pairing for people using contact sensors with passive bluetooth?

@bdraco
Copy link
Collaborator

bdraco commented Sep 16, 2023

We can remove the passive detection of contact sensors by deleting the line with the 13 length.

Won’t that break pairing for people using contact sensors with passive bluetooth?

No, because HA stores the sensor type in the config entry so it already knows what it is, it just means new ones can't be detected with passive only.

Its pretty clear thats unsupported anyways https://github.com/home-assistant/core/blob/8a98a0e830e9381d9959d8b7b7e732b27f6be5ff/homeassistant/components/switchbot/strings.json#L47

No supported SwitchBot devices found in range; If the device is in range, ensure the scanner has active scanning enabled, as SwitchBot devices cannot be discovered with passive scans. Active scans can be disabled once the device is configured. If you need clarification on whether the device is in-range, download the diagnostics for the integration that provides your Bluetooth adapter or proxy and check if the MAC address of the SwitchBot device is present.

@the-ress
Copy link
Contributor Author

That makes sense, thanks.

@the-ress the-ress restored the curtain3 branch September 19, 2023 21:29
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

Successfully merging this pull request may close these issues.

Switchbot Curtain v3 not detected
2 participants