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

tonbor
Posts: 157
Joined: Monday 17 February 2014 9:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Marstek OpenAPI

Post 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
Attachments
Wrong way 2026-02-25 124011.png
Wrong way 2026-02-25 124011.png (164.52 KiB) Viewed 54 times
2026-02-25 125318.png
2026-02-25 125318.png (74.06 KiB) Viewed 54 times
willemd
Posts: 740
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 »

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.
Post Reply

Who is online

Users browsing this forum: JanJaap and 1 guest