Marstek Battery plugin Topic is solved

Python and python framework

Moderator: leecollings

Haaibaai
Posts: 2
Joined: Sunday 03 August 2025 14:22
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Marstek Battery plugin

Post by Haaibaai »

Power line. Why didn’t I think of that. Ordering a puser at alie now. Thank you for all the responses.

In other news:
I made a plugin for the ct003 to get the data over to Domoticz without the need for a puser.

You can find it here: https://github.com/Haaibaai/Domoticz-Marstek
eddieb
Posts: 431
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Marstek Battery plugin

Post by eddieb »

I dumped the CT003 for a HomeWizzard P1 ...
The CT003 was way to unstable for me
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC MQTTmapper / SolarEdge SE3500H modbus_tcp / IndeVolt SF3000 / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
RNEE
Posts: 78
Joined: Sunday 05 August 2018 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.1
Location: NL/Eindhoven area
Contact:

Re: Marstek Battery plugin

Post by RNEE »

Haaibaai wrote: Monday 04 August 2025 15:31 Power line. Why didn’t I think of that. Ordering a puser at alie now. Thank you for all the responses.

In other news:
I made a plugin for the ct003 to get the data over to Domoticz without the need for a puser.

You can find it here: https://github.com/Haaibaai/Domoticz-Marstek
Nice!

About using the dr164 with wifi, there are several solutions :
- a separate plugin
- something like mqmgateway, mobugen
- a script using jq

All recquire a lot more skills and time to get and keep it going

For me i take the dr134, no more thoughts about that. Easy to setup and easy to maintain.
Domoticz (since 2016) on Docker on Raspberry PI 5 with 500 Gb NVMe|Milight|KaKu + RFXCOM|Goodwe|Smartstuff P1 meter|Buienradar|Afval kalender|Tuya-wifi|Zigbee + deCONZ Conbee II|Marstek Homebattery 5,12Kwh via Modbus on Pusr-dr134|MQTTMapper|Quatt v2|
Henielma
Posts: 13
Joined: Friday 12 September 2025 12:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Contact:

Re: Marstek Battery plugin

Post by Henielma »

I am using the DR134 to read out data from the Marstek Venus V2 battery as RNEE describes. This works fine with the Light edge mode of this modbus gateway. Also adding aditional register readout like battery voltage and back up relay status is no problem.

My goal is to use the DR134 to change the force charge/discharge/stop register. To start simple I tried to change the back up relay status using the DR134. After a few evenings trying to get this working I think I need some help on this.

Is it possible to send commands to the Marstek battery using the DR134?
Has anybody something like this working?

As test I first would like to send a command to the battery using the DR134 and MQTT Explorer and see that the battery reacts on this.
User avatar
pwassink
Posts: 1
Joined: Monday 05 June 2017 10:17
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Vorden (NLD)
Contact:

Re: Marstek Battery plugin

Post by pwassink »

Domo latest stable version: , on top of a Debian CT running in Proxmox
Version: 2025.1 (build 16782)
Build Hash: 3ed178aa4
Compile Date: 2025-09-12 08:38:25

This plugin was a nice discovery, had some trouble to get python at work on an old beta-version running VM.
Build a seperate new instance, which does work, has python and loads the plugin, , and i see some data from the Marstek CT passing through the logtraces.

As it is a Udp broadcasted datagram which is beeng sent like it seems, is there a possibillity to let it listen to the data fom more than one Marstek-Venus V3 ?

This is the data i see passing when the plugin reads it:
2025-09-26 15:25:54.293 Marstek: Data ontvangen van Marstek:
2025-09-26 15:25:54.293 Marstek: {'meter_dev_type': 'HME-3', 'meter_mac_code': '009b08a5fbb1', 'hhm_dev_type': 'HMG-50', 'hhm_mac_code': '60323b753543', 'A_phase_power': 3, 'B_phase_power': -303, 'C_phase_power': 226, 'A_charge_power': -42, 'B_charge_power': 0, 'C_charge_power': 1, 'total_power': 0, 'A_discharge_power': 0, 'B_discharge_power': -62, 'C_discharge_power': 196, 'Total_charge_power': 0, 'Total_discharge_power': 0, 'A_chrg_nb': -4, 'B_chrg_nb': 0, 'C_chrg_nb': 0, 'ABC_chrg_nb': 0, 'wifi_rssi': 0, 'info_idx': 0, 'x_chrg_power': 0, 'A_chrg_power': 0, 'B_chrg_power': 82498660, 'C_chrg_power': 63676220, 'ABC_chrg_power': 16202890, 'x_dchrg_power': 40356090, 'A_dchrg_power': None, 'B_dchrg_power': None, 'C_dchrg_power': None, 'ABC_dchrg_power': None}
2025-09-26 15:25:54.307 Marstek: ABC Charge: 0 W / 16.203 kWh
2025-09-26 15:25:54.308 Marstek: ABC Discharge: 0 W / 0.000 kWh
2025-09-26 15:25:54.308 Marstek: Data bijgewerkt

Ive seen this data for couple of days now, the ABC values stay the same, seems there is still something wrong.

Any ideas how to get all three batteries working on this plugin inside Domoticz ?
SilentSimon
Posts: 5
Joined: Friday 01 April 2016 18:24
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Marstek Battery plugin

Post by SilentSimon »

I also created a plugin for the Marstek V3 with the modbus connection.

Without the need of openAPI and mqtt.

https://github.com/hopSilentSimon/Domot ... ek_Modbus
eddieb
Posts: 431
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Marstek Battery plugin

Post by eddieb »

SilentSimon wrote: Wednesday 24 June 2026 21:26 I also created a plugin for the Marstek V3 with the modbus connection.

Without the need of openAPI and mqtt.

https://github.com/hopSilentSimon/Domot ... ek_Modbus
NIce !!!
how did you configure your DR134 ? ( can you please add this to the documentation ? )
(I have one connected with some MQTT stuff but it only shows a couple of sensors and it is not easy to configure)
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC MQTTmapper / SolarEdge SE3500H modbus_tcp / IndeVolt SF3000 / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
SilentSimon
Posts: 5
Joined: Friday 01 April 2016 18:24
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Marstek Battery plugin

Post by SilentSimon »

eddieb wrote: Wednesday 24 June 2026 22:48
SilentSimon wrote: Wednesday 24 June 2026 21:26 I also created a plugin for the Marstek V3 with the modbus connection.

Without the need of openAPI and mqtt.

https://github.com/hopSilentSimon/Domot ... ek_Modbus
NIce !!!
how did you configure your DR134 ? ( can you please add this to the documentation ? )
(I have one connected with some MQTT stuff but it only shows a couple of sensors and it is not easy to configure)
I updated the readme of the github
eddieb
Posts: 431
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Marstek Battery plugin

Post by eddieb »

tnx for updating the readme.
currently my DR134 runs in "light edge" mode but I will try to convert it somewhere today and test your new plugin.
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC MQTTmapper / SolarEdge SE3500H modbus_tcp / IndeVolt SF3000 / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
eddieb
Posts: 431
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Marstek Battery plugin

Post by eddieb »

I noticed in your code

Code: Select all

MODE_NAMES = {0:"Manual",1:"Anti-feed",2:"Trade"}
in the "API" mode my Venus E v2 has more modes ...
Screenshot 2026-06-25 at 06.22.14.png
Screenshot 2026-06-25 at 06.22.14.png (48.95 KiB) Viewed 3656 times
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC MQTTmapper / SolarEdge SE3500H modbus_tcp / IndeVolt SF3000 / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
jslegers
Posts: 56
Joined: Tuesday 23 February 2016 9:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Location: NL
Contact:

Re: Marstek Battery plugin

Post by jslegers »

SilentSimon wrote: Wednesday 24 June 2026 21:26 I also created a plugin for the Marstek V3 with the modbus connection.

Without the need of openAPI and mqtt.

https://github.com/hopSilentSimon/Domot ... ek_Modbus
This looks nice. I have ordered last week and Elfin 11EW Wi-Fi to Modbus and it would be nice if this would work.
Great work.
eddieb
Posts: 431
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Marstek Battery plugin

Post by eddieb »

I also have a spare Elfin, might try that first
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC MQTTmapper / SolarEdge SE3500H modbus_tcp / IndeVolt SF3000 / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
jslegers
Posts: 56
Joined: Tuesday 23 February 2016 9:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Location: NL
Contact:

Re: Marstek Battery plugin

Post by jslegers »

eddieb wrote: Thursday 25 June 2026 9:11 I also have a spare Elfin, might try that first
Please share your findings.
User avatar
waltervl
Posts: 7021
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Marstek Battery plugin

Post by waltervl »

Plugins are added to the plugin wiki
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
eddieb
Posts: 431
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Marstek Battery plugin

Post by eddieb »

ew11 connected to my Venus E v2 ...

Code: Select all

~/test/Marstek-Venus-probe $ python3 marstek_venus_v3_probe.py --ip 192.168.0.159 --port 502 --unit 1
Connecting to 192.168.0.159:502 (unit id 1) ...
✅ TCP connection established.

[OK]   device_name                  reg 31000  raw=[16707, 12337, 0, 0, 0, 0, 0, 0, 0, 0] -> AC01
[FAIL] battery_soc                  reg 34002  error: Modbus exception response, function=0x83, code=2
[OK]   battery_voltage              reg 30100  raw=[0] -> 0.0 V
[OK]   battery_current              reg 30101  raw=[0] -> 0.0 A
[OK]   battery_power                reg 30001  raw=[5423, 65535] -> 355467263 W
[OK]   battery_total_energy         reg 32105  raw=[5120] -> 5.12 kWh
[OK]   ac_voltage                   reg 32200  raw=[2391] -> 239.1 V
[OK]   ac_power                     reg 30006  raw=[2388, 1] -> 156499969 W
[OK]   ac_frequency                 reg 32204  raw=[4998] -> 49.98 Hz
[OK]   total_charging_energy        reg 33000  raw=[2, 17660] -> 1487.32 kWh
[OK]   total_discharging_energy     reg 33002  raw=[1, 52599] -> 1181.35 kWh
[OK]   internal_temperature         reg 35000  raw=[427] -> 42.7 °C
[OK]   inverter_state               reg 35100  raw=[1] -> 1
[OK]   wifi_signal_strength         reg 30303  raw=[30] -> -30 dBm
[OK]   modbus_address               reg 41100  raw=[1] -> 1
[OK]   mos1_temperature             reg 35001  raw=[416] -> 41.6 °C
[OK]   mos2_temperature             reg 35002  raw=[414] -> 41.4 °C
[OK]   user_work_mode               reg 43000  raw=[1] -> 1
[OK]   rs485_control_mode           reg 42000  raw=[21947] -> 21947
[FAIL] cycle_count                  reg 34003  error: Modbus exception response, function=0x83, code=2
[OK]   max_cell_voltage             reg 37007  raw=[3405] -> 3.405 V
[OK]   min_cell_voltage             reg 37008  raw=[3333] -> 3.333 V
[OK]   daily_charge_energy          reg 33004  raw=[0, 564] -> 5.64 kWh
[OK]   daily_discharge_energy       reg 33006  raw=[0, 250] -> 2.5 kWh

============================================================
✅ Got at least one valid register back — the Elfin/battery link is alive.
   If some registers FAILed above, that's normal: not every
   register exists on every firmware version, and V3 units on
   Elfin/RS485 gateways sometimes mix v1/v2-style addresses.
============================================================
what about the 2 exceptions ?
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC MQTTmapper / SolarEdge SE3500H modbus_tcp / IndeVolt SF3000 / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
Post Reply