Add SwitchBot Universal Remote Control battery sensor - #174101
Draft
Onero-testdev wants to merge 4 commits into
Draft
Add SwitchBot Universal Remote Control battery sensor#174101Onero-testdev wants to merge 4 commits into
Onero-testdev wants to merge 4 commits into
Conversation
Add support for the SwitchBot Universal Remote (Remote With Screen) by mapping the WoRemoteWithScreen model to a battery sensor. The device is connectable and exposes its battery level via the SwitchbotRemoteWithScreen device class in pySwitchbot. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Hey there @Danielhiversen, @RenierM26, @murtas, @Eloston, @dsypniewski, @zerzhang, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds support for the SwitchBot "Remote With Screen" (Universal Remote) device as a sensor platform, exposing battery and Bluetooth signal sensors.
Changes:
- Adds the
REMOTE_WITH_SCREENmodel toSupportedModelsenum and maps it to its platform (Platform.SENSOR) and device class (SwitchbotRemoteWithScreen). - Adds a
REMOTE_WITH_SCREEN_SERVICE_INFOBluetooth advertisement fixture for testing. - Adds a test verifying the battery and RSSI sensors for the new device type.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| homeassistant/components/switchbot/const.py | Adds REMOTE_WITH_SCREEN to SupportedModels enum and model type mapping. |
| homeassistant/components/switchbot/init.py | Registers the new model's supported platforms and device class. |
| tests/components/switchbot/init.py | Adds REMOTE_WITH_SCREEN_SERVICE_INFO BLE advertisement test fixture. |
| tests/components/switchbot/test_sensor.py | Adds test for battery and RSSI sensors of the Remote With Screen device. |
Onero-testdev
marked this pull request as ready for review
June 29, 2026 06:51
Align the SwitchBot sensor with the official product name and the renamed pySwitchbot symbols (SwitchbotUniversalRemote / SwitchbotModel.UNIVERSAL_REMOTE). Renames the SupportedModels enum member, service-info fixture, and test accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| SupportedModels.ROLLER_SHADE.value: switchbot.SwitchbotRollerShade, | ||
| SupportedModels.CIRCULATOR_FAN.value: switchbot.SwitchbotFan, | ||
| SupportedModels.STANDING_FAN.value: switchbot.SwitchbotStandingFan, | ||
| SupportedModels.UNIVERSAL_REMOTE.value: switchbot.SwitchbotUniversalRemote, |
# Conflicts: # homeassistant/components/switchbot/__init__.py # homeassistant/components/switchbot/const.py
The pySwitchbot parser reads the battery/charging byte from mfr_data[7]; move 0x50 from index 9 to index 7 in UNIVERSAL_REMOTE_SERVICE_INFO so the battery sensor test reads 80 again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| SwitchbotModel.LOCK_VISION: SupportedModels.LOCK_VISION, | ||
| SwitchbotModel.LOCK_PRO_WIFI: SupportedModels.LOCK_PRO_WIFI, | ||
| SwitchbotModel.STANDING_FAN: SupportedModels.STANDING_FAN, | ||
| SwitchbotModel.UNIVERSAL_REMOTE: SupportedModels.UNIVERSAL_REMOTE, |
joostlek
approved these changes
Jul 10, 2026
joostlek
marked this pull request as draft
July 10, 2026 19:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change
Proposed change
Add support for the SwitchBot Universal Remote (internal name Remote With Screen,
WoRemoteWithScreen) to the SwitchBot integration.The device is registered as a connectable model and exposes a battery sensor (battery level is provided both in the BLE advertisement and via the basic-info command). It reuses the existing generic
batterysensor description, so no new sensor entity description is required.This PR depends on the corresponding
pySwitchbotchange that adds theSwitchbotUniversalRemotedevice class andSwitchbotModel.UNIVERSAL_REMOTE:Note from SwitchBot team
This change is developed by the official SwitchBot team. The implementation has been verified with real hardware testing on physical devices.
If you have any questions or need clarification, please reach out:
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: