Skip to content

Conversation

@lukasmalkmus
Copy link

@lukasmalkmus lukasmalkmus commented Nov 10, 2025

👋 First-time contributor

First contribution to Home Assistant. Created with AI assistance, thoroughly reviewed and tested with actual hardware on HA 2025.11.1. All entities working correctly.

Compact implementation (~93 lines, mostly tests) following recent merged PRs (#155124, #155309). Happy to receive feedback and make adjustments!

Proposed change

Add SwitchBot Presence Sensor support to the switchbot Bluetooth integration.

The device combines mmWave radar, PIR sensor, and light detection. Already supported by PySwitchbot 0.73.0 (PR #410) and the switchbot_cloud integration (#155309), but missing from the Bluetooth integration.

Changes: Add device type to supported models list and configure platforms (binary_sensor + sensor). Pattern matches Motion Sensor.

Entities: Motion + Light (binary_sensor), Battery + Light level + Signal strength (sensor)

Screenshots

Screenshot 2025-11-10 at 23 47 59

Type of change

  • New feature (adds functionality to existing integration)

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass (will pass in GitHub CI - macOS has Bluetooth dependency issues)
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff
  • Tests have been added to verify that the new code works.

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
  • Updated derived files by running python3 -m script.hassfest (will run if requested)
  • No new dependencies added (uses existing PySwitchbot 0.73.0)

Testing

Tested on HA 2025.11.1 with real hardware. Device discovered automatically via Bluetooth, all 5 entities created and reporting correctly.

Test added following climate panel pattern (#155124), verifying entity counts and attributes.

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lukasmalkmus

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant
Copy link

Hey there @Danielhiversen, @RenierM26, @murtas, @Eloston, @dsypniewski, @zerzhang, mind taking a look at this pull request as it has been labeled with an integration (switchbot) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of switchbot can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign switchbot Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@italo-lombardi
Copy link

italo-lombardi commented Nov 11, 2025

Hi @lukasmalkmus, thanks for this PR!

JFYI, the Switchbot Smart Radiator Thermostat support by @zerzhang has just been merged: #155123
It changes the same files as yours, so you may need to rebase, and it can also be useful to validate your code.

Thanks again

Copy link
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a merge conflict

@home-assistant home-assistant bot marked this pull request as draft November 11, 2025 12:55
@borgqueenx
Copy link

This shows "motion" in your screenshot. As its a presence sensor, it would likely be better to show "occupancy" instead, with also the house icon instead of motion icon.

@lukasmalkmus lukasmalkmus force-pushed the add-switchbot-presence-sensor branch from dc8495d to 8561814 Compare November 11, 2025 22:59
@lukasmalkmus
Copy link
Author

Screenshot 2025-11-11 at 23 57 20

Comment on lines +103 to +108
# Presence sensors should use occupancy device class instead of motion
if (
binary_sensor == "motion_detected"
and coordinator.model == SwitchbotModel.PRESENCE_SENSOR
):
self._attr_device_class = BinarySensorDeviceClass.OCCUPANCY
Copy link
Author

@lukasmalkmus lukasmalkmus Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this bit but I didn't want to interfere with existing sensors by changing this, globally.

Copy link

@borgqueenx borgqueenx Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say the light sensor can be called that as well. Unfortunately no lux values so not a lux sensor, but still a light level sensor. Just trying to help out with correct labeling, hope it can be merged soon, bought 7 of these in the hope they were supported, but they were not (yet). Haha.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand, this might not just be the labeling, which is why I was careful.

And yes, same mistake. Bought a bunch just to find out they are not (yet) compatible, lol 🤦

@lukasmalkmus lukasmalkmus marked this pull request as ready for review November 11, 2025 23:01
@borgqueenx
Copy link

@joostlek i see you requested changes but it seems complete now? Is this ready now to review/merge? Or something remaining?

@lukasmalkmus lukasmalkmus force-pushed the add-switchbot-presence-sensor branch from 8561814 to dfada38 Compare November 14, 2025 15:20
@iz8mbw
Copy link

iz8mbw commented Nov 18, 2025

Hello and thanks for this, I purchased mmWave Switchbot Presense Sensor and I would like to see it in Home Assistant (via Bluetooth) like I already do with my others 20+ Switchbot devices.
So, when this PR will merged?
Many Thanks!

@lukasmalkmus lukasmalkmus force-pushed the add-switchbot-presence-sensor branch 2 times, most recently from 0c0dd26 to b11fc5d Compare November 18, 2025 08:55
@borgqueenx
Copy link

Hello and thanks for this, I purchased mmWave Switchbot Presense Sensor and I would like to see it in Home Assistant (via Bluetooth) like I already do with my others 20+ Switchbot devices. So, when this PR will merged? Many Thanks!

We are dependant on the core developers who have write access.
Maybe @zerzhang can help as he made the pyswitchbot update?
Hope it can be merged soon so that we can have the sensor working in next HA-core release.

@lukasmalkmus lukasmalkmus force-pushed the add-switchbot-presence-sensor branch 2 times, most recently from 936f528 to e51c1d0 Compare November 19, 2025 00:43
@iz8mbw
Copy link

iz8mbw commented Nov 19, 2025

Hello @zerzhang can you review and approve this PR?
Thanks.

@iz8mbw
Copy link

iz8mbw commented Nov 19, 2025

For all, I have had a Chat with the SwitchBot Support and this is what they wrote about adding the mmWave Presence Sensor in the HA integration:

November 30th is the launch date for the Presence Sensor, and December 3rd is the release date for the new version.

I think for the HA version 2025.12.0 it will be included.

@borgqueenx
Copy link

For all, I have had a Chat with the SwitchBot Support and this is what they wrote about adding the mmWave Presence Sensor in the HA integration:

November 30th is the launch date for the Presence Sensor, and December 3rd is the release date for the new version.

I think for the HA version 2025.12.0 it will be included.

If this pr is not merged, that wont happen though. Unless i missed a secondary merge request and this one can be closed?
support probably got that date from their developers so i hope they soon can finish this.

@iz8mbw
Copy link

iz8mbw commented Nov 19, 2025

For all, I have had a Chat with the SwitchBot Support and this is what they wrote about adding the mmWave Presence Sensor in the HA integration:
November 30th is the launch date for the Presence Sensor, and December 3rd is the release date for the new version.
I think for the HA version 2025.12.0 it will be included.

If this pr is not merged, that wont happen though. Unless i missed a secondary merge request and this one can be closed? support probably got that date from their developers so i hope they soon can finish this.

May be someone will approve/merge this or create a new one just before the new version of HA?
I don't know.
What I did for now is also send an Email to the SwitchBot Support asking them when the mmWave Presence sensor will be added in the SwitchBot Bluetooth Integration.

@zerzhang
Copy link
Contributor

Hello @zerzhang can you review and approve this PR? Thanks.

I do not have merge permissions

@zerzhang
Copy link
Contributor

@lukasmalkmus You need to approve the following process and get all the inspection items through.
image

@lukasmalkmus lukasmalkmus force-pushed the add-switchbot-presence-sensor branch from e51c1d0 to 3b47826 Compare November 19, 2025 22:09
@lukasmalkmus
Copy link
Author

@lukasmalkmus You need to approve the following process and get all the inspection items through. image

No, unfortunately I'm not a maintainer and can't merge this PR.

@borgqueenx
Copy link

@italo-lombardi changes were made. Unfortunately no response yet from joostlek
Could you or amyone tell how how to proceed if there is anything lacking? It looks good or? A simple change to add device support to the switchbot integration..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

switchbot bluetooth reports "no devices found" for switchbot presence sensor

7 participants