项目 / sfstar/hass-victron

sfstar/hass-victron

行业推荐
语言 Python标签 energyhome-assistantmodbus-tcpvictronvictronenergy数据更新 2026-11-13 19:42:00 · 仓库 2026-10-26

一段话介绍

面向 Home Assistant 的 Victron GX 设备集成,通过 Modbus TCP 扫描设备上的可用寄存器,并为这些寄存器创建实体。

本站整理,非 GitHub 官方 description。

官方 description(GitHub API 原样)
Integration for Home Assistant to fetch data from the victron gx device via modbusTCP
323累计星
70Fork
—峰值日增
0上榜次数
总榜
暂未入榜
日榜
暂未入榜
周榜
暂未入榜
月榜
暂未入榜

官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。

行业与场景

按行业选型 →

能耗监测与能效优化

适配系统:能源管理系统、能耗监测平台 · 得分 1.4

面向能耗采集与负荷分析建模,可用于园区/楼宇能效诊断与用能优化建议。

设备物联接入与边缘采集

适配系统:物联网平台、边缘计算网关 · 得分 1.4

实现工业协议解析与设备接入管理,可作为物联网平台的设备接入层与数据采集前置。

更多信息

以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。

我的用法
在已安装 HACS 的 Home Assistant 中,按[仓库 README](https://github.com/sfstar/hass-victron)的说明添加集成,重启后到「设置 → 设备与服务」里搜索 victron 并填写主机等选项。也可按同一说明复制到 custom_components 后手动添加。
特点或设计要点
安装后可配置主机、端口和扫描间隔等选项。源文写明在 GX 固件 v3.10 上编写和测试,并验证自 v2.92 起可用。也可对照 Victron 的 Modbus TCP 说明了解寄存器相关背景。
局限和适用边界
该集成的局限包括:发现扫描时配置较慢,且未在三相系统上测试;其依赖 pymodbus 3.0.2+,与内置 modbus 集成不兼容,会导致后者失效。
星标走势还差一天的数据,明天就能看到曲线
每天 10:30 记一次星标,连续两天后自动生成曲线
首次发现 — · 最近在榜 2026-10-26 · 语言 Python · 贡献者 —
python

GitHub 项目主页介绍

来自 GitHub 仓库 README / 主页介绍正文,原样摘录,共 8,753 字节。

[![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg?style=for-the-badge)](https://github.com/hacs/integration)

# Victron GX modbusTCP integration
This integration scans for all available registers of a provided GX device.
It then uses the defined register ledgers to create entities for each and every register that is provided by the GX device.

# Project release state
Please note that the integration is currently in an acceptance state.
This means that there are no breaking changes planned.
If a breaking change were to be introduced expect the release notes to reflect this.
If you are missing a feature or experience any issues please report them in the issue tracker.

## Limitations
The current state of this integration provides the following limitations regarding its use:
- Configuring the integration will be relatively slow if a discovery scan is required.
- This integration wasn't tested with a three-phase system. Although basic functionality should work minor bugs could have gone unnoticed

## Important Note
This integration was written an tested with the latest victron firmware running.
GX version: v3.10 (support validated from v2.92)
Multiplus version: 492

Victron continuously improves upon the modbus implementation by adding new registers.
Therefore, older firmware versions might not expose all registers this integration expects to be present.
This might (depending on your firmware and connected devices) cause odd behaviour where some but not all devices connected to your GX device will be correctly detected by this integration.

The best solution for this issue is to upgrade to the latest firmware.
You can also open an issue to get your firmware version supported.
This issue should contain the following information:
- Connected devices
- Firmware versions of the connected devices
- Missing device type (grid, vebus, bms can etc.)
- Missing unit id (among other 30, 100, 227, 228)

Please note that it might take some time for older firmware versions to get full support (after a ticket is opened).

## Currently planned improvements
- Fully Switch to async
- Investigate if scan without causing (ignorable) errors at the gx device is possible
- Improve connection loss resilience (mark / unmark availability of entities)
- Revisit datatypes used for storing register info

# Installing the integration
You can install this integration by following the steps for your preferred installation method

## Warning
This integration uses pymodbus 3.0.2 or higher.
As of november 2022 the built-in home assistant modbus integration runs on a version < 3.0.0
If you install this integration the built-in modbus integration will stop to work due to breaking changes between 2.x.x and 3.0.0

## Important announcement:
Starting from home assistant core version 2025.1.x the built-in modbus integration now uses pymodbus version 3.7.4.
Version 0.4.0 (and up) of this integration will also use the 3.7.4 pymodbus version.

Although core version >= 2023.2 and previous versions of this integration should be compatible it is recommended that all users update both core and this integration in the same patch round.
Since having multiple library version requirements might cause the built-in 3.1.1 library to be overwritten by 3.0.2 reference of versions 0.0.6 and earlier.
This could cause issues if you are using specific configuration options of the built-in modbus integration that weren't working with pymodbus 3.0.2 and were fixed in 3.1.1

## Manual
1. Clone the repository to your machine running home assistant: `git clone https://github.com/sfstar/hass-victron.git`
2. Create the custom_components folder in your home assistant home folder if it doesn't exist: `mkdir homeassitant/custom_components`
3. Copy the custom_components/victron folder (from step 1.) into the homeassistant/custom_components folder on your machine: `cp custom_components/victron homeassitant/custom_components`
4. Restart home assistant
5. Goto `Settings -> Devices and Services -> Integration`
6. Click on `Add Integration`
7. Search for `victron`
8. Fill in the correct options and submit

## HACS

### Default
1. Add the integration through this link:
[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=sfstar&repository=hass-victron&category=integration)
3. Restart home assistant
4. Setup integration via the integration page.

# GX device errors
The integration scans for available units and register ranges upon installation and when selected in the options menu.
This will cause "errors" in the GX device under "settings -> services -> modbus TCP" due to not every register set and unit being available (and victron not providing a discover unit / register to query)
These errors can be cleared without any issue and should not be reported unless (after scanning) errors keep getting reported.

# Disclaimer
This integration speaks to the victron GX device.
The GX device is an exposed integration point for a system capable of running on high voltages and currents.
If the system were to become unstable it might lead to damage of equipment, fires and/or electrocution.
Although this integration speaks to the (exposed by victron) modbusTCP server it might cause the system to become unstable in circumstances like (but not limited to):
- High request frequency
- (when implemented) writing to write_registers (for example changing the ess setpoint value)

Therefore the following applies to anyone using this code:
- This code is provided as is.
- The developer does not assume any liability for issues caused by the use of this integration.
- Use at your own risk.

# Options
The integration provides end users with the following configuration options.

## Host
The IP address of the victron GX device running the modbusTCP service.
It's only configurable during setup and it's recommended to make the GX device static in your router

## Port
The port on which victron exposes the modbusTCP service.
Victron exposes the service on port 502, but this configuration option is present to allow for proxy configuration (via nginx etc).
The average user doesn't need to change the port being used

## Interval
interval determines the number of rounded seconds to use between updating the entities provided by this integration.
For slower systems setting the interval to lower than 5 seconds might cause issues.
Setting a interval of 0 will result in an interval of 1 seconds being used.

## Advanced
Ticking the write support option enables an "advanced" users mode.
If write support is disabled the integration is "safer" to use.
Since you can't accidentally change any setting that might cause damage (i.e. to High currents for your cabling).

It is currently unknown and untested if the ModbusTCP server write registers are guard-railed. (Have protections/limits in place that prevent damage)
Therefore, this integration offers users the ability to set "soft" guard rails by requiring current and voltage settings and limits to be specified by the end user.
Although this make the integration safer, one should always double-check if the provided write entities aren't capable of going to high / low for your system.

Currently, the options are tailored to the US / EU base settings and lifepo4 battery voltages.
If you use another grid specification or battery type you can submit an issue to have them included.

### AC Current
The maximum current in Amps that your system is designed to handle.
This doesn't make a difference between the AC OUT and the AC IN side of your setup.
Please keep a small margin below your rated grid connection current (for example if you have 1x40A then set the integration to max 39 AMPS).

This advice does assume that your system is fully setup to handle these currents.

### DC current
The maximum current in Amps that your battery and battery cabling/busbars are rated to handle.

### DC Voltage
The voltage profile to use in order to calculate the voltage boundaries (i.e. 4s, 8s and 16s lifepo4 configurations).

### AC Voltage
The AC voltage for a single phase in your region (currently supported is US: 120v and EU: 230v)
This setting is used in combination with AC current to automatically calculate the max wattage for applicable wattage settings.

# Resources
The following links can be helpful resources:
- [setting up modbusTCP on the gx device](https://www.victronenergy.com/live/ccgx:modbustcp_faq)
- [Great UI card for the gx device data](https://github.com/flyrmyr/system-flow-card)
![image](https://user-images.githubusercontent.com/6717280/236457703-5c9219bd-ad88-487e-80b9-28d51859175e.png)

↑