Marstek OpenAPI
Moderators: leecollings, remb0
-
tonbor
- Posts: 157
- Joined: Monday 17 February 2014 9:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Marstek OpenAPI
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 (164.52 KiB) Viewed 32 times
-
- 2026-02-25 125318.png (74.06 KiB) Viewed 32 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
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.
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.
Who is online
Users browsing this forum: No registered users and 1 guest