Page 3 of 3

Re: Marstek OpenAPI

Posted: Wednesday 25 February 2026 12:56
by tonbor
Use the new plugin Marstek open API. Working ok. But have a problem with the Energy Dashboard. Added Marstek battery. But the flow is the wrong way. Negative mains flow to battery. Besides the flow is from sun panels and not from house to marstek battery

Re: Marstek OpenAPI

Posted: Wednesday 25 February 2026 15:57
by willemd
Yes, that was noticed by another user as well. The energy dashboard expects the sign to be different and as far as I know that is not configurable in the energy dashboard.

Marstek uses negative power numbers of charging and positive for discharging in the Open API.

But it can easily be adapted in the plugin. You have two options:
1) adapt the python line where the value for that device type is processed and add a multiplication by -1. But then it will apply to all devices and values of that device type.
2) in the device dictionary at the beginning of the plugin code, modify the multiplier of that device from 1 to -1. Then it can be configured per device.

I have uploaded a new version to github a minute ago that now handles the multiplier correctly also for kWh and counter devices (for those devices the previous version did not look at the multiplier, which was wrong of course). I have not yet changed the multiplier in the dictionary. It also corrects the pv1_power value that is reported incorrectly by the Open API. (release notes in the code)

Also note that there is another illogical thing in the dashboard in the sense that charging from the net to the battery is shown with a negative number, while usage from the net to the house is shown as a positive number, even though both flows are away from the net.