Skip to content

mtheli/philips_shaver

Repository files navigation

Philips Shaver Integration for Home Assistant

HACS Default GitHub Release License: MIT

This is a custom component for Home Assistant to integrate Philips Bluetooth-enabled shavers.

The integration connects to your shaver via Bluetooth Low Energy (BLE) to provide status, usage, and advanced telemetry data. It automatically detects the capabilities of your specific model during setup to only show relevant entities.

Device overview in Home Assistant

Two connection methods are supported:

  1. Direct Bluetooth — connects from the HA host's Bluetooth adapter. Event-driven: detects when the shaver wakes up via BLE advertisements, then establishes a persistent live connection.
  2. ESP32 BLE Bridge — an ESP32 running ESPHome acts as a wireless BLE relay. Ideal when the shaver is out of Bluetooth range of the HA host.

Note

The standard ESPHome bluetooth_proxy is not currently supported — it does not handle the shaver's LE Secure Connections pairing. Use the dedicated ESP32 BLE Bridge component (Option B) instead, which can run a bluetooth_proxy for other BLE devices alongside it.

See Configuration for setup instructions.


Table of Contents


Tested Models

Model Direct BLE ESP32 Bridge Tested by
Shaver Series 7000
S7886 Community (#5)
S7887 Community (forum)
Shaver Series 9000
S9986 Community (#7)
S9987 Community (#9)
Shaver Series 9000 Prestige (i9000)
XP9201 Maintainer
XP9400 Community (#1, #3)
XP9405 Community (forum)
OneBlade 360
QP4530 Maintainer

Other BLE-enabled Philips shavers and groomers using the same GATT services may also work. The integration auto-detects available services and capabilities during setup — entities are only created for features your device supports. If your model works, please let me know so I can add it to the list!


Lovelace Card

A dedicated dashboard card is available: Philips Shaver Card

Philips Shaver Card

The card automatically switches between standby, shaving, charging, and cleaning modes with live pressure gauge, battery status, and session stats.


Community


Features

This integration creates a new device for your shaver and provides the following entities based on your device's hardware:

Main Controls & Status

Entity Type Description
Activity Sensor Current detailed status (Off, Shaving, Charging, Cleaning, Locked).
Shaving Mode Select Change the shaving intensity (e.g., Sensitive, Normal, Intense, Custom, Foam).
Battery Level Sensor The current battery charge level (%).
Travel Lock Binary Sensor Indicates if the travel lock is active.
Charging Binary Sensor Indicates if the shaver is currently charging.
Light Ring Switch Enable or disable the pressure coaching light ring.
Handle Load Type Sensor Detected head attachment (Shaving Heads, Trimmer, Styler, Brush, etc.).
Motion Sensor Live motion feedback (No Motion, Small Circles, Large Strokes).

Pressure, Motor & Coaching (S7000/S9000)

Entity Type Description
Pressure Value Sensor Live pressure data from the sensor.
Pressure State Sensor Categorized feedback (Too Low, Optimal, Too High).
Pressure Light Ring Light Configure the LED ring colors for various pressure states.
Light Ring Brightness Select Adjust the pressure light ring brightness (High, Medium, Low).
Motor Speed Sensor Current motor speed in RPM (e.g., ~2200 RPM).
Motor Current Sensor Current motor power consumption in mA.

Speed Coaching (OneBlade)

Entity Type Description
Speed Sensor Live grooming speed (0–200 raw).
Speed Verdict Sensor Real-time feedback (Optimal, Too Slow, Too Fast). Computed locally from speed and zone thresholds.

Usage & Maintenance

Entity Type Description
Last Session Duration Sensor Duration of the last shaving session in seconds.
Total Operating Time Sensor Lifetime usage of the shaver.
Days Since Last Used Sensor Days elapsed since the last use.
Charge Cycles Sensor Total number of charge cycles.
Remaining Shaves Sensor Estimated number of shaves remaining based on battery level and usage history.
Number of Uses Sensor Total number of operational uses.
Head Remaining Sensor The remaining life of the shaver head (%).
Blade Replacement Button Confirm a blade replacement — resets the head remaining counter to 100%.
Cleaning Progress Sensor Progress of the cleaning cycle in % (if applicable).
Cleaning Cycles Sensor Total number of cleaning cycles.
Cleaning Cartridge Remaining Sensor Estimated remaining cleaning cartridge uses (accounts for fluid evaporation).
Reset Cleaning Cartridge Button Reset the cleaning cartridge counter after inserting a new cartridge.

Diagnostics

Entity Type Description
Last Seen Sensor Time in minutes since the device was last reachable.
Signal Strength Sensor Bluetooth signal strength (dBm, direct BLE only).
Adapter Sensor Bluetooth adapter currently carrying the connection (e.g. hci0, <esp_name>).
Adapter Type Sensor Classification of the active transport: direct_ble / esp_bridge / stock_proxy / unknown.
BLE Status Binary Sensor BLE connection status to the shaver.
Bridge Status Binary Sensor ESP32 bridge online status (ESP bridge only).
Bridge Version Sensor ESP bridge firmware version (ESP bridge only).
Bridge Last Boot Sensor Timestamp of the ESP bridge's last boot — useful to detect ESP reboots (ESP bridge only).
Firmware Sensor Installed firmware version (disabled by default).
Model Number Sensor Device model number (disabled by default).

Prerequisites

  • A compatible Philips Shaver (see Tested Models above).
  • Either a Home Assistant instance with the Bluetooth integration enabled and a working Bluetooth adapter, or an ESP32 running the BLE bridge component.
  • The shaver supports only one active connection at a time — it must be unpaired from your phone, any manufacturer app (GroomTribe / OneBlade), and from the device itself before Home Assistant can connect.

Installation

HACS (Recommended)

This integration is available in the default HACS store — just click the button below, or search HACS for "Philips Shaver".

Open in HACS

Then restart Home Assistant.

Don't have HACS yet? Follow the HACS installation guide first.

Manual installation
  1. Copy the custom_components/philips_shaver directory from this repository into your Home Assistant config/custom_components/ folder.
  2. Restart Home Assistant.

Configuration

The integration supports two connection methods:

Method Best for
Option A Direct Bluetooth HA host is within Bluetooth range of the shaver (typically 5–10 m / 15–30 ft, less through walls)
Option B ESP32 BLE Bridge Shaver is out of range — a small ESP32 device placed near the shaver relays data over WiFi
Stock ESPHome bluetooth_proxy Not currently supported — the standard ESPHome Bluetooth Proxy does not handle the shaver's LE Secure Connections pairing. Use Option B (the dedicated bridge component) instead, which can run a bluetooth_proxy for other BLE devices alongside it.

Important

The shaver must be fully unpaired (from your phone and the device itself) before connecting to Home Assistant. Follow the Unpairing Guide for step-by-step instructions.

Option A: Direct Bluetooth (Pairing)

  1. Ensure the shaver is turned on.
  2. Navigate to Settings > Devices & Services.
  3. The shaver should appear under Discovered — click Configure.
    • If not discovered automatically, click + Add Integration, search for "Philips Shaver", and enter the MAC address manually.
  4. Click Submit. The integration connects and pairs automatically.

Tip

Automatic pairing works out of the box on Home Assistant OS and any Linux system with BlueZ. Pairing, trusting, and stale bond removal are handled automatically via D-Bus — no terminal commands needed.

Manual Pairing (Fallback for Docker, macOS, etc.)

On systems without D-Bus, the integration will show instructions for manual pairing via terminal instead. You have two options:

Automated Pairing Script

bash /config/custom_components/philips_shaver/scripts/pair.sh

The script scans for nearby Philips devices, lets you choose which one to pair, and handles the bluetoothctl agent setup required for LE Secure Connections.

You can also pair a specific device directly:

bash /config/custom_components/philips_shaver/scripts/pair.sh AA:BB:CC:11:22:33

Manual Pairing with bluetoothctl

  1. Start the Bluetooth control tool:

    bluetoothctl
  2. Register the pairing agent (required for LE Secure Connections):

    agent KeyboardDisplay
    default-agent
  3. Start scanning to find your shaver. It will appear as "Philips XP9201" or similar. Note down its MAC Address (e.g., AA:BB:CC:11:22:33).

    scan on
    # ... Wait for the shaver to appear and note the address.
    scan off
  4. Pair and trust the device:

    pair AA:BB:CC:11:22:33
    trust AA:BB:CC:11:22:33
    exit

After manual pairing, return to the integration setup dialog and click Submit to retry.

Option B: ESP32 BLE Bridge

If your Home Assistant host is too far from the shaver for a direct Bluetooth connection, you can use an ESP32 as a wireless BLE bridge. The ESP32 connects to the shaver and relays data to HA over WiFi.

This is not a standard ESPHome Bluetooth Proxy — it is a custom component that handles the shaver's LE Secure Connections pairing and provides full read/write/subscribe access to all GATT characteristics.

A single ESP32 can bridge multiple devices (e.g. a shaver and an OneBlade simultaneously).

Note: This option requires basic ESPHome knowledge (flashing firmware, editing YAML configs). If you're new to ESPHome, check out Getting Started with ESPHome first.

The bridge supports two pairing modes per philips_shaver: entry:

  • Mode A — Fixed MAC (ble_client_id: references a ble_client: block with the shaver's MAC). Pairing happens once, manually via pair.sh from the host. Deterministic slot-to-shaver mapping; ideal when you already know the MAC.
  • Mode B — Auto-Discovery (no ble_client_id:, no mac_address:). The bridge scans for the universal Philips Shaver Platform Service UUID, bonds to the first match via the HA setup dialog's pair-mode flow, and persists the bonded MAC in NVS. No terminal access needed; ideal for Bluetooth-Proxy-only setups or when you want to swap shavers without re-flashing.

For the complete setup guide and Mode A vs Mode B comparison, see ESP Bridge Setup Guide and esphome/README.md.


Example Automations

See AUTOMATIONS.md for ready-to-use automation examples, including low battery alerts, smart plug charging, usage reminders, and maintenance notifications.


Troubleshooting & Caveats

  • Pairing fails: The shaver must be unpaired from both your phone's Bluetooth settings and from the device itself. Unpairing in the app alone is not enough — see the unpairing instructions for your model. This is the most common cause of pairing failures.
  • Connection Conflict: If the integration fails to set up, ensure no smartphone is currently connected to the shaver.
  • ESPHome Bluetooth Proxy: The standard ESPHome Bluetooth Proxy does not work with this shaver because it requires LE Secure Connections pairing. Use the dedicated ESP32 BLE Bridge instead.
  • Stability: Bluetooth signals are weak. Ensure your HA host or ESP32 bridge is placed as close to the shaver's location as possible.

BLE Protocol

The integration communicates directly via BLE — no cloud, no app required. All communication is fully local.

The shaver exposes multiple GATT services with individual characteristics for each data point (battery, motor, pressure, light ring, etc.). Data is read directly from these characteristics and live updates are received via GATT notifications.

For a detailed technical description of the BLE protocol including service UUIDs, characteristic reference, data formats, and capability flags, see BLE_PROTOCOL.md.

For debug service actions (reading arbitrary BLE characteristics via Developer Tools), see ADVANCED.md.

Screenshots

Discovery Capabilities Device Diagnostics Connection
Discovery Capabilities Device Diagnostics Connection

Disclaimer

This is an independent community project and is not affiliated with, endorsed by, or sponsored by Philips. All product names, trademarks, and registered trademarks are property of their respective owners.

License

MIT

About

Home Assistant integration for Philips shavers and OneBlade via Bluetooth Low Energy

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors