Skip to content

Sensor Changes for Marstek Venus E Gen 3.0#193

Open
mgutt wants to merge 29 commits into
ViperRNMC:mainfrom
mgutt:feat/v3-sensors
Open

Sensor Changes for Marstek Venus E Gen 3.0#193
mgutt wants to merge 29 commits into
ViperRNMC:mainfrom
mgutt:feat/v3-sensors

Conversation

@mgutt

@mgutt mgutt commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

This PR adds new sensors for the Venus E v3 that have been validated on real hardware (firmware V148).

New Sensors

Version

  • ems_sub_version (30201) — EMS sub-version (energy logic / charge-discharge algorithms)
  • vns_version (30203) — VNS version (WiFi/BT module); confirmed in app as "VNS:117"

BMS Temperatures

  • bms_temperature_1 (34011)
  • bms_temperature_2 (34012)

Battery Pack Temperatures

  • battery_1_temperature (34013)
  • battery_2_temperature (34014)
  • battery_3_temperature (34015)
  • battery_4_temperature (34016)

Network

  • wifi_ssid (41500) — WiFi SSID (16-char string)

Enhanced Sensors

  • bluetooth_status (30301) — Added state mappings: Disconnected / Connected after reboot / Connected / Active / Locked

@mgutt mgutt force-pushed the feat/v3-sensors branch 2 times, most recently from d6d3feb to 3cbc4d0 Compare April 6, 2026 11:34
@mgutt mgutt marked this pull request as ready for review April 6, 2026 11:43
@ViperRNMC

Copy link
Copy Markdown
Owner

Also include your firmware, because sometimes something changes with the change of firmware

@mgutt mgutt marked this pull request as draft April 7, 2026 09:02
@mgutt

mgutt commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

The sensors are finished:

2026-04-11_13-56 2026-04-11_13-58 2026-04-11_14-02 2026-04-11_14-04 2026-04-11_14-08_1

Now I'm finalizing the new diagnose values...

@mgutt

mgutt commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

New features:

  • Auto Cleanup of replaced / removed sensors
  • Generic DERIVED_SENSOR_DEFINITIONS to return "virtual" sensors based on multiple other sensors

And the diagnostics values now contain several new registers, too (Tested with firmware V147 and V148):

2026-04-12_01-11 2026-04-12_01-11_1 2026-04-12_01-11_2

Changes regarding "VNS" and the new virtual "Firmware-Version" sensor are based on the last firmware update:

image

@mgutt mgutt marked this pull request as ready for review April 11, 2026 23:13
@mgutt

mgutt commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

I made many tests (changing modes, charging, through modbus or android app, etc.), but was finally not able to find the meaning of these registers:

Register Sensor Value
37000 bms_online 1
34004 bms_code 3
30106 bms_status 4
35111 setpoint_a 330
35112 setpoint_b 500
30212 unknown_30212 5
32101 unknown_32101 39321
35110 unknown_35110 576
45603 unknown_45603 9985
45604 unknown_45604 20599
45605 unknown_45605 74
47400 unknown_47400 43707

@mgutt

mgutt commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

Stats:

  • This PR adds 58 sensors:
    • 25 new unique sensors
    • 25 duplicates (alternative register)
    • 4 renames (ac to inverter)
    • 4 derived sensors (firmware version, ac_power, ac_current and ac_offgrid_current)

@mgutt mgutt marked this pull request as draft April 12, 2026 07:29
@mgutt

mgutt commented Apr 12, 2026

Copy link
Copy Markdown
Contributor Author

It seems something is broken after merging the code bases. Will check that...

@mgutt

mgutt commented Apr 12, 2026

Copy link
Copy Markdown
Contributor Author

@ViperRNMC
Should I uncomment all *_alt sensors as they are only duplicates of already existing sensors or should we add them as disabled by default?

@ViperRNMC

Copy link
Copy Markdown
Owner

I would not bring the _alt myself, but I would document it somewhere in case it is needed in the future. I don't have a v3 myself, so I would like someone to check this change.

@mgutt

mgutt commented Apr 12, 2026

Copy link
Copy Markdown
Contributor Author

Ok, all *_alt Sensors are kept as comments but translations have been removed.

@mgutt

mgutt commented Apr 12, 2026

Copy link
Copy Markdown
Contributor Author

I would like someone to check this change.

Do you merge it into a beta branch? I added a release in my fork, but this could be confusing for the user as he would have the integration twice:

image

And as both target the same directory, they delete / overwrite each other.

@mgutt mgutt marked this pull request as ready for review April 12, 2026 19:20
@mgutt mgutt marked this pull request as draft April 12, 2026 19:29
@mgutt

mgutt commented Apr 12, 2026

Copy link
Copy Markdown
Contributor Author

It seems I uncommented too much as I don't have a "normal" battery voltage anymore:

image

And this isn't normal, too, as its naming does not contain inverter, offgrid, etc.:

image

Will re-check those...

@mgutt

mgutt commented Apr 12, 2026

Copy link
Copy Markdown
Contributor Author

It seems I uncommented too much as I don't have a "normal" battery voltage anymore:
And this isn't normal, too, as its naming does not contain inverter, offgrid, etc.:

Ok, both issues fixed and removed some obsolete translations, too.

@mgutt mgutt marked this pull request as ready for review April 12, 2026 20:34
@mgutt mgutt mentioned this pull request Apr 12, 2026
23 tasks
@ViperRNMC

Copy link
Copy Markdown
Owner

@Schrolli91 @sphings79 What device do you have? Can you review this PR?

@Schrolli91

Schrolli91 commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

I do have an E Gen3, but ...

In my opinion this PR mixes up a lot of total independent and different changes, which makes it hard to review. This should be split up.

If I look at the changes, the PR summary seems incomplete too.

@mgutt mgutt marked this pull request as draft April 13, 2026 07:56
@mgutt

mgutt commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

I will split it in multiple PRs

@Schrolli91 Schrolli91 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some first points.
But in general this PR is way to big to make a clean review.

Splitting it up in functional, depending pieces makes more sense in my opinion.

Comment thread custom_components/marstek_modbus/registers/e_v3.yaml Outdated
Comment thread custom_components/marstek_modbus/registers/e_v3.yaml Outdated
Comment thread custom_components/marstek_modbus/registers/e_v3.yaml Outdated
Comment thread custom_components/marstek_modbus/registers/e_v3.yaml Outdated
Comment thread custom_components/marstek_modbus/registers/e_v3.yaml Outdated
Comment thread custom_components/marstek_modbus/registers/e_v3.yaml Outdated
Comment thread custom_components/marstek_modbus/__init__.py Outdated
Comment thread custom_components/marstek_modbus/__init__.py Outdated
Comment thread custom_components/marstek_modbus/sensor.py Outdated
Comment thread custom_components/marstek_modbus/registers/e_v3.yaml Outdated
@Schrolli91

Schrolli91 commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

It also will be better to split up the sensor additions to functional parts (PRs) because there al lot of additions and maybe some of them have to be discussed a little bit more.

@sphings79

Copy link
Copy Markdown
Contributor

@Schrolli91 @sphings79 What device do you have? Can you review this PR?

None at the moment.
I'm awaiting my Venus D the next days.
And I have a friend with a Venus A.

Added confirmed new sensors validated on real hardware:
- ems_sub_version (30201), vns_version (30203)
- BMS temperatures: bms_temperature_1/2 (34011-34012)
- Cell temperatures: cell_temperature_1/2/3/4 (34013-34016)
- Network: wifi_ssid (41500), device_ip (30400), gateway_ip (30402)
- BMS diagnostics: bms_online (37000), bms_code (34004), bms_status (30106)
- Status registers: alarm_status (36000), fault_status (36100)
- bluetooth_status: added state translations

Fixed battery_voltage register mapping:
- Changed from register 30100 to 32100 (matches e_v12.yaml pattern)
- Updated precision from 1 to 2 decimal places
- Verified on real hardware (shows 53.11V vs 52.9V at register 30000)

Updated header to reflect partial hardware validation.
Removed fault_status and alarm_status from MISSING list.

No infrastructure changes - pure sensor additions only.
mgutt added 7 commits April 30, 2026 20:12
…-fixes

battery_voltage precision, wifi_signal_strength device_class and header
comment are now maintained in fix/sensor-register-fixes branch.
bms_online, bms_code, bms_status were self-invented names for unvalidated
registers. MISSING should only list sensors known to exist but not yet mapped.
@mgutt mgutt marked this pull request as ready for review April 30, 2026 19:10
@mgutt

mgutt commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

This PR is still way to big in my opinion, and mixes things together (Fixing Bugs, Adding Things, Changing others ...).

Done
#221
#222
#223
#224

In that case that should be named cell_pack_* or cell_1_to_4_ to clarify this. Because we also have the cell voltage sensors which maps directly to each single cell.

Done

@sphings79

Copy link
Copy Markdown
Contributor

This PR is still way to big in my opinion, and mixes things together (Fixing Bugs, Adding Things, Changing others ...).

Done

#221

#222

#223

#224

In that case that should be named cell_pack_* or cell_1_to_4_ to clarify this. Because we also have the cell voltage sensors which maps directly to each single cell.

Done

Should be renamed to pack_#cell# as Venus D will have 4 temp sensors in each pack

@mgutt

mgutt commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

Should be renamed to pack_#cell# as Venus D will have 4 temp sensors in each pack

I changed it to:

battery_1_temperature

Because existing pack sensors use this naming scheme, too:

      "battery_1_cell_1_voltage": {
        "name": "Battery Pack 1 Cell 1 Voltage"
      },
      "battery_soc_1": {
        "name": "Battery Pack 1 SoC"
      },

@mgutt

mgutt commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

I think, most people are only "users". I'm not sure if it is a good idea to bring some sort of "dev debug features" in the integration.

Maybe it's an option to add a complete new "battery"-type as e_v3_test.yaml or something which can contain all these additional unknown or testing entities. But that's maybe a questen for @ViperRNMC

I think, most people are only "users". I'm not sure if it is a good idea to bring some sort of "dev debug features" in the integration.

Maybe it's an option to add a complete new "battery"-type as e_v3_test.yaml or something which can contain all these additional unknown or testing entities. But that's maybe a questen for @ViperRNMC

This needs an answer. It cost me weeks to analyze the whole range of all registers and it would be sad not to record alternative and unknown sensors and their known values somewhere.

@mgutt

mgutt commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

firmware_version is now part of this PR:
#223

Both of them are ready for review.

@mgutt mgutt marked this pull request as ready for review May 1, 2026 17:11
@mgutt

mgutt commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

I think, most people are only "users". I'm not sure if it is a good idea to bring some sort of "dev debug features" in the integration.
Maybe it's an option to add a complete new "battery"-type as e_v3_test.yaml or something which can contain all these additional unknown or testing entities. But that's maybe a questen for @ViperRNMC

I think, most people are only "users". I'm not sure if it is a good idea to bring some sort of "dev debug features" in the integration.
Maybe it's an option to add a complete new "battery"-type as e_v3_test.yaml or something which can contain all these additional unknown or testing entities. But that's maybe a questen for @ViperRNMC

This needs an answer. It cost me weeks to analyze the whole range of all registers and it would be sad not to record alternative and unknown sensors and their known values somewhere.

I created a README for the research results:
#225

@mgutt mgutt marked this pull request as draft May 1, 2026 17:24
@sphings79

Copy link
Copy Markdown
Contributor

I think, most people are only "users". I'm not sure if it is a good idea to bring some sort of "dev debug features" in the integration.

Maybe it's an option to add a complete new "battery"-type as e_v3_test.yaml or something which can contain all these additional unknown or testing entities. But that's maybe a questen for @ViperRNMC

I think, most people are only "users". I'm not sure if it is a good idea to bring some sort of "dev debug features" in the integration.

Maybe it's an option to add a complete new "battery"-type as e_v3_test.yaml or something which can contain all these additional unknown or testing entities. But that's maybe a questen for @ViperRNMC

This needs an answer. It cost me weeks to analyze the whole range of all registers and it would be sad not to record alternative and unknown sensors and their known values somewhere.

I created a README for the research results:

#225

Perhaps it will be possible to have a dev.yaml wich can be activated through reconfiguration with a slider, which clearly declares, that it is only for developer. Other way would be to install the integration twice. One main branch and analyst branch and use a Modbus proxy for the connection.

@mgutt mgutt marked this pull request as ready for review May 1, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants