8000 Add support for Victron bluetooth low energy devices by rajlaud · Pull Request #148043 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Add support for Victron bluetooth low energy devices #148043

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

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

rajlaud
Copy link
< 8000 /span>
Contributor
@rajlaud rajlaud commented Jul 3, 2025

Proposed change

This adds a new integration, victron_ble, which allows for monitoring information from a wide range of Victron Energy devices that broadcast "instant readout data" using the bluetooth low energy protocol.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

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

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

rajlaud added 7 commits July 2, 2025 12:40
victron_ble remove unnecessary strings.json

victron_ble tests refactor and additions

Test and typing improvements

Test and typing improvements

Additional tests

Additional tests

Handle malformed advertisement victron_ble

Bluetooth discovery for victron_ble

do not cache victron_ble parser

config flow improvements

Add strings for config flow

Add strings for config flow

Improved config flow strings

Improved config flow strings

More config flow improvements

More config flow improvements

Fix description placeholders

Fix description placeholders

Enable rediscovery of removed devices

Filter out non-instant read advertisements

Logging improvements

Use custom sensor-state-data rather than modifying upstream dependency

Bump victron-ble dependency to 0.6.0

Bump victron-ble dependency to 0.6.0

Revert new device class

Properly handle no current_flow in HA device classes

Implement suggestions from code review

Implement suggestions from code review

Move VictronBluetoothDeviceData to separate library

Fix stale reference to victron-ble

Fix stale reference to victron-ble

Rerun CI with dependency available

Fix name of discovered victron_ble device

Bump victron-ble-ha-parser version

Bump victron-ble-ha-parser version

Fix name of title variable for victron-ble config flow

Bump victron-ble-ha-parser for bug fix

Bump victron-ble-ha-parser for bug fix

Complete DC-DC converter support for victron-ble

Add sensor descriptions for smart battery protect

Add sensor descriptions for individual cells

Fix sensor descriptions for individual cells

Retrieve cell key properly

Types

Types
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new victron_ble integration that discovers Victron Energy BLE devices, validates an access token, and exposes their data as Home Assistant sensor entities.

  • Introduce BLE config flow to discover devices and prompt for encryption token
  • Implement passive BLE sensor platform mapping Victron data keys to HA sensor entities
  • Add pytest fixtures and tests for config flow and sensor updates

Reviewed Changes

Copilot reviewed 10 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
homeassistant/components/victron_ble/init.py Integration setup/unload and coordinator registration
homeassistant/components/victron_ble/config_flow.py Bluetooth discovery and access‐token config flow
homeassistant/components/victron_ble/const.py Define domain and manufacturer identifier constant
homeassistant/components/victron_ble/sensor.py Map parser keys to SensorEntityDescription and entities
homeassistant/components/victron_ble/quality_scale.yaml Integration quality metadata
tests/components/victron_ble/conftest.py Override async_setup_entry fixture
tests/components/victron_ble/fixtures.py BLE service info and expected‐value fixtures
tests/components/victron_ble/test_config_flow.py Unit tests for the config flow
tests/components/victron_ble/test_sensors.py Unit tests for sensor entity updates
Files not reviewed (5)
  • CODEOWNERS: Language not supported
  • homeassistant/components/victron_ble/manifest.json: Language not supported
  • homeassistant/components/victron_ble/strings.json: Language not supported
  • requirements_all.txt: Language not supported
  • requirements_test_all.txt: Language not supported
Comments suppressed due to low confidence (2)

tests/components/victron_ble/fixtures.py:45

  • The VICTRON_DC_DC_CONVERTER_SERVICE_INFO fixture is defined but never used in tests; either add a corresponding test case (and expected sensors) or remove this unused fixture.
VICTRON_DC_DC_CONVERTER_SERVICE_INFO = BluetoothServiceInfo(

tests/components/victron_ble/test_sensors.py:30

  • The parametrized tests cover battery, DC energy meter, solar charger, and VE.Bus but skip the DC/DC converter; add it to ensure full test coverage of all supported device types.
@pytest.mark.parametrize(

rajlaud and others added 2 commits July 3, 2025 13:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

1 participant
0