Marstek OpenAPI

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

eddieb
Posts: 428
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Marstek OpenAPI

Post by eddieb »

I've been running this test version vor a couple of days now and it really looks promising.
It would be nice if there could be some more testers with different types of Marstek Venus batteries.
Please take a look at the github pages and comment on the issue over there and help willem and others with debugging the last issues ...
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC MQTTmapper / SolarEdge SE3500H modbus_tcp / Marstek Venus / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
willemd
Posts: 787
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Marstek OpenAPI

Post by willemd »

eddieb wrote: Sunday 29 March 2026 12:23 I've been running this test version vor a couple of days now and it really looks promising.
It would be nice if there could be some more testers with different types of Marstek Venus batteries.
Please take a look at the github pages and comment on the issue over there and help willem and others with debugging the last issues ...
Thanks for this. It would be great to receive more feedback.
Just to add, currently there are two versions:
1) https://github.com/WillemD61/Marstek-Venus-plugin
This is a synchronous version that works fine with Marstek Venus A and E3 and is using the api from https://github.com/IvanKablar/marstek-v ... /tree/main
But since it was not working at all for the E2 I also made a plugin
2) https://github.com/WillemD61/Marstek-Venus-E-plugin
which uses the asyncio libraries and is based on the api from https://github.com/jaapp/ha-marstek-local-api
This second one also works for E2 although still not very reliable. It also works for Venus A and others.

More detail info is needed is why and where it exactly fails. So far, it just seems a limitation of the Marstek hardware which causes messages to be lost/corrupted.

With both version I am experiencing occasional hardware resets which might be caused by the use of the Open API.

Any advice from real networking/UDP communication experts would also be appreciated.
Snakfy
Posts: 13
Joined: Wednesday 29 November 2017 8:58
Target OS: Linux
Domoticz version:
Contact:

Re: Marstek OpenAPI

Post by Snakfy »

Thanks allot for this plugin.
Currently i'm also using it on my Domoticz.
I have two Marstek E V3 and most of the time things are working fine.
There both connected of a fixed lan cable, no wifi.

The only problem I have and I'm not sure if tis related to this plugin or Open API of the Marstek.
But it looses it's "settings" every ~12 hours, not exact sometimes longer, somtimes shorter.
I get a result in the domoticz log that the device is not responding.
I then look with the application of Marstek and see it lost it power setting (800w instead of set 2500w) and even more importantly the setting "0 on the P1 meter" has changed to manual, making the Marstek not regulate.
Also the "open api" setting is set to off

I did see a mention of somebody else that this can be due to the polling rate of the device, which was at first set to "every minute"
I have changed this to "every 5 minutes" and it has improved a bit but it's not gone.
I really don't want to use this thread about the Plugin for this problem but it seems is heavily related to communicating over the Open Api.

Thanks WillemD61 for the plugin, highly appreciated. Hartelijk dank!

Does anyone have any pointers on how to handle this "fall back" behaviour?
manuloup
Posts: 51
Joined: Sunday 23 November 2014 16:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Marstek OpenAPI

Post by manuloup »

Hi Snakfy,

Yes we all have. It is a bug that the latest firmware still did not fix.

At the moment, the API can not be used, sadly.

I am still waiting for a solution.
Rapberry PI B+ (RaspBian), RFXtrx433E USB 433.92MHz Transceiver, AEON LABS Controler Z-Wave, Aeon Labs Z-Stick S2, Everspring ST814 Temperature Sensor, Everspring SF812 Smoke Detector, 2x Fibaro Wallplug, Aeon Zwave Miniremote , Xbee Teleinfo USB
Snakfy
Posts: 13
Joined: Wednesday 29 November 2017 8:58
Target OS: Linux
Domoticz version:
Contact:

Re: Marstek OpenAPI

Post by Snakfy »

"good" to know I'm not alone.
So this also confirms that if i disable the Open API interface it will not reset the "0 op de meter" setting.
Which is really important for me (obviously).

I also found information on using Modbus over TCP (here https://github.com/evcc-io/evcc/issues/25373 ).
Perhaps I'll dig into that for the time being.
Hopefully a firmware update fixes the issue with the Open api

Thanks for the quick reply!
tonbor
Posts: 162
Joined: Monday 17 February 2014 9:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Marstek OpenAPI

Post by tonbor »

Same here :oops:
Snakfy
Posts: 13
Joined: Wednesday 29 November 2017 8:58
Target OS: Linux
Domoticz version:
Contact:

Re: Marstek OpenAPI

Post by Snakfy »

Firmware update!
naar 148.119.113

Hopelijk wordt het beter, Ik heb open api weer ingeschakeld en report back hier hoe het gaat
Firmware update2.png
Firmware update2.png (35.44 KiB) Viewed 230227 times
Snakfy
Posts: 13
Joined: Wednesday 29 November 2017 8:58
Target OS: Linux
Domoticz version:
Contact:

Re: Marstek OpenAPI

Post by Snakfy »

Unfortunately, the battery just jumped back to

- Manual
- 800 Watt
- Open Api off

So the problem has not been resolved for me.

Incidentally, I can now recognize in the Domoticz logs when this happens (see below).
When I subsequently look in the app, it has reset the setting.
Marstek Fail.png
Marstek Fail.png (65.56 KiB) Viewed 230222 times
Last edited by Snakfy on Tuesday 14 April 2026 20:54, edited 1 time in total.
User avatar
waltervl
Posts: 7002
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Marstek OpenAPI

Post by waltervl »

Snakfy wrote: Monday 13 April 2026 20:45 Helaas zojuist springt de batterij weer terug naar
WARNING: This is an English written forum, so please reply in English so other users also can understand what you are writing!
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
manuloup
Posts: 51
Joined: Sunday 23 November 2014 16:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Marstek OpenAPI

Post by manuloup »

Hi,

Yes please, because I did not get everything you said.

I also installed this new firmware version 148.119.113 and activated the API again yesterday evening.

No crash of the battery software at the moment, finger crossed!
Rapberry PI B+ (RaspBian), RFXtrx433E USB 433.92MHz Transceiver, AEON LABS Controler Z-Wave, Aeon Labs Z-Stick S2, Everspring ST814 Temperature Sensor, Everspring SF812 Smoke Detector, 2x Fibaro Wallplug, Aeon Zwave Miniremote , Xbee Teleinfo USB
willemd
Posts: 787
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Marstek OpenAPI

Post by willemd »

Unfortunately the use of local Open Api on Marstek Venus still causes full resets. Whether I use the synchronous version plugin I developed initially for the Venus A or the asynchronous version for Venus E users,does not make a difference for me. (See github repositories)

In the meantime I developed a optimisation program which uses day ahead info to maximise financial gain. This runs now each hour and sets the optimum mode for the next hour taking into account day ahead. This can use the plugin setup but can also use mqtt via hame-relay and that is what I have been using now for the past two weeks and that is working well.
https://github.com/WillemD61/battery-planning

My work on the plugins will continue later when multiple people confirm that Open API is becoming stable.
manuloup
Posts: 51
Joined: Sunday 23 November 2014 16:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Marstek OpenAPI

Post by manuloup »

Yes, same here and it proposes me to upgrade the same firmware again, I don't know why (148.119.112 -> 148.119.113)

Trying to reset it all and we will see....
Rapberry PI B+ (RaspBian), RFXtrx433E USB 433.92MHz Transceiver, AEON LABS Controler Z-Wave, Aeon Labs Z-Stick S2, Everspring ST814 Temperature Sensor, Everspring SF812 Smoke Detector, 2x Fibaro Wallplug, Aeon Zwave Miniremote , Xbee Teleinfo USB
willemd
Posts: 787
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Marstek OpenAPI

Post by willemd »

Snakfy wrote: Monday 13 April 2026 20:45 Helaas zojuist springt de batterij weer terug naar
- Manual
- 800 Watt
- Open Api off

Dus probleem is voor mij niet verholpen

OVerigens kan ik inmiddels in de Domoticz logs herkennen wanneer dit gebeurd (zie hieronder).
Als ik vervolgens in de app kijk heeft hij de setting ge-reset

Marstek Fail.png
If you configured email in domoticz, the plugin can send you an alert when the Marstek resets and closes the API. Configurable in the plugin screen whether you want this.
tonbor
Posts: 162
Joined: Monday 17 February 2014 9:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Marstek OpenAPI

Post by tonbor »

willemd wrote: Tuesday 14 April 2026 14:39 Unfortunately the use of local Open Api on Marstek Venus still causes full resets. Whether I use the synchronous version plugin I developed initially for the Venus A or the asynchronous version for Venus E users,does not make a difference for me. (See github repositories)

In the meantime I developed a optimisation program which uses day ahead info to maximise financial gain. This runs now each hour and sets the optimum mode for the next hour taking into account day ahead. This can use the plugin setup but can also use mqtt via hame-relay and that is what I have been using now for the past two weeks and that is working well.
https://github.com/WillemD61/battery-planning

My work on the plugins will continue later when multiple people confirm that Open API is becoming stable.
This is what I want too. But Marstek Api is not working with firmware 148. Entsoe is out of office to often. So I use Nord pool, no trouble with Nord pool and waiting Marstek to fix the unstable api
Snakfy
Posts: 13
Joined: Wednesday 29 November 2017 8:58
Target OS: Linux
Domoticz version:
Contact:

Re: Marstek OpenAPI

Post by Snakfy »

willemd wrote: Tuesday 14 April 2026 18:06
Snakfy wrote: Monday 13 April 2026 20:45 Helaas zojuist springt de batterij weer terug naar
- Manual
- 800 Watt
- Open Api off

Dus probleem is voor mij niet verholpen

OVerigens kan ik inmiddels in de Domoticz logs herkennen wanneer dit gebeurd (zie hieronder).
Als ik vervolgens in de app kijk heeft hij de setting ge-reset

Marstek Fail.png
If you configured email in domoticz, the plugin can send you an alert when the Marstek resets and closes the API. Configurable in the plugin screen whether you want this.
Thanks allot for that tip :-).
Sorry for speaking dutch , I corrected my original post
Snakfy
Posts: 13
Joined: Wednesday 29 November 2017 8:58
Target OS: Linux
Domoticz version:
Contact:

Re: Marstek OpenAPI

Post by Snakfy »

I have ordered some parts to connect to the Modbus over rs485 connector that is on my Marstek E V3.
Trying to make it work using this plugin, not sure if it will work for the V3

https://github.com/RneeJ/Domoticz-Marstek

I also don't know if I can controll the battery over this link, but first thing i want to get working is the readout of the battery state.
I'll post experience and progress here.
Part will be delivered in few weeks..........
willemd
Posts: 787
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Marstek OpenAPI

Post by willemd »

Snakfy wrote: Tuesday 14 April 2026 21:02 I have ordered some parts to connect to the Modbus over rs485 connector that is on my Marstek E V3.
Trying to make it work using this plugin, not sure if it will work for the V3

https://github.com/RneeJ/Domoticz-Marstek

I also don't know if I can controll the battery over this link, but first thing i want to get working is the readout of the battery state.
I'll post experience and progress here.
Part will be delivered in few weeks..........
Might be better to create a separate thread for modbus Marstek communications since it is not linked to OpenAPI at all, which is the subject of this thread.
manuloup
Posts: 51
Joined: Sunday 23 November 2014 16:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Marstek OpenAPI

Post by manuloup »

willemd wrote: Tuesday 14 April 2026 14:39 Unfortunately the use of local Open Api on Marstek Venus still causes full resets. Whether I use the synchronous version plugin I developed initially for the Venus A or the asynchronous version for Venus E users,does not make a difference for me. (See github repositories)

In the meantime I developed a optimisation program which uses day ahead info to maximise financial gain. This runs now each hour and sets the optimum mode for the next hour taking into account day ahead. This can use the plugin setup but can also use mqtt via hame-relay and that is what I have been using now for the past two weeks and that is working well.
https://github.com/WillemD61/battery-planning

My work on the plugins will continue later when multiple people confirm that Open API is becoming stable.
I finally installed hame-relay and hm2mqtt. As mentionned previously, I get a loooot of devices with mqtt in my domoticz now.

Here are the ones I selected to appear on my domoticz dashboard :
domoticz marstek venus E3 hame.jpg
domoticz marstek venus E3 hame.jpg (93.67 KiB) Viewed 230109 times
Here is the result on my dashboard's mobile with HomeHabit :
1000050997 - 1K JPEG.jpg
1000050997 - 1K JPEG.jpg (111.54 KiB) Viewed 230109 times
Sadly, there is no way I can change with domoticz the working mode. On that selector, nothing's happen.
venus working mode 2026-04-15 141303.jpg
venus working mode 2026-04-15 141303.jpg (21 KiB) Viewed 230109 times
willemd, are you able to ?
Rapberry PI B+ (RaspBian), RFXtrx433E USB 433.92MHz Transceiver, AEON LABS Controler Z-Wave, Aeon Labs Z-Stick S2, Everspring ST814 Temperature Sensor, Everspring SF812 Smoke Detector, 2x Fibaro Wallplug, Aeon Zwave Miniremote , Xbee Teleinfo USB
Snakfy
Posts: 13
Joined: Wednesday 29 November 2017 8:58
Target OS: Linux
Domoticz version:
Contact:

Re: Marstek OpenAPI

Post by Snakfy »

willemd wrote: Tuesday 14 April 2026 22:23
Snakfy wrote: Tuesday 14 April 2026 21:02 I have ordered some parts to connect to the Modbus over rs485 connector that is on my Marstek E V3.
Trying to make it work using this plugin, not sure if it will work for the V3

https://github.com/RneeJ/Domoticz-Marstek

I also don't know if I can controll the battery over this link, but first thing i want to get working is the readout of the battery state.
I'll post experience and progress here.
Part will be delivered in few weeks..........
Might be better to create a separate thread for modbus Marstek communications since it is not linked to OpenAPI at all, which is the subject of this thread.
Yes I will do that by then, it's not my intent to hijack this thread and still highly appreciate the effort
eddieb
Posts: 428
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Marstek OpenAPI

Post by eddieb »

this morning I received new firmware for my Venus E v2
IMG_0393.jpeg
IMG_0393.jpeg (46.72 KiB) Viewed 229695 times
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC MQTTmapper / SolarEdge SE3500H modbus_tcp / Marstek Venus / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
Post Reply