Config vs controller vs app vs other

Hello everyone. After successfully using OpenEMS Edge to read and write the Modbus registers of an inverter, I have a question about best-practices when it comes to giving the user the ability to modify inverter settings.

The example I will use is the Time of Use Selling screen of a hybrid inverter. It allows the user to set some battery charging characteristics using grid vs gen, time of day, power and target capacity percentage (see attached pic).

My first thought was that I could just add these parameters to the inverter device config within the OpenEMS Edge configuration area but it didn’t feel right and added too many fields to the already lengthy configuration.

My next thought was that maybe this is something to do within the eventual Odoo integration with some sort of configuration section for each edge device but I have only just started looking into the Odoo user authentication so I’m not sure if that would feel right.

So, my question is where in the OpenEMS framework would be the appropriate place to build a screen that allows an end-user or installer to modify these settings and submit that changes to the Modbus registers?

Screenshot 2024-02-20 at 12.49.45 PM

Why not use the UI and make a Terminal Screen?

Hello, Sn0w3y. Thanks as always for your input.

I have never heard of a Terminal Screen since I am just now getting to the UI portion of this project.

Can you point me to some documentation, screenshot, or example that I can look at?

https://openems.github.io/openems.io/openems/latest/simulation/gitpod.html

@acabrera

I have looked at that portion of the documentation…

I just want to make sure I am understanding the terminology here…when you say Terminal Screen do you actually mean a Terminal session within VS Code? If so, I’m not quite understanding how that would appear to an end-user.

If you are suggesting that I simply look at how the GitPod demo works to get an idea of how the UI can be modified to give the end-user a way to control their devices, I can look into that. Unfortunately, I am unable to get the GitPod demo to work for some reason but if that is how I get to the solution I need, I’ll just have to figure it out.

If you mean something else, please explain.

Hi @acabrera,

First question: How to store the information:

  1. Use individual configuration settings
  • PRO: settings show up immediately under “Configure Component” in Settings (but generally end-users should not have access to this, so it actually does not solve your problem)

  • CON: as you wrote already, this adds a lot more settings. Technically this is not really a problem, though.

  1. Use a JSON configuration setting

We use this sometimes if we need to store structured values. Example → openems/io.openems.edge.controller.symmetric.balancingschedule/src/io/openems/edge/controller/symmetric/balancingschedule/Config.java at develop · OpenEMS/openems · GitHub

  • PRO: no clutter, only one setting

  • CON: it becomes difficult to configure and you loose any immediate type validation

Second question: How to let the user configure:

  1. Via “Configure Component” (see not above, why this is actually not an option for you)

  2. Via a specific OpenEMS UI widget

This is the most flexible variant, but involves writing Controller/Device specific UI code. See “FEMS App Hochlastzeitfenster” as an example for rather complex configuration:

  1. Via App Center

In the App Center, the UI is defined via the JSON-Formly “UI template language”. This should also work for you. Example → openems/io.openems.edge.core/src/io/openems/edge/app/integratedsystem/FeneconHome.java at develop · OpenEMS/openems · GitHub

Downside of this approach: App Center is usually used for one-time setup configuration and not configurations that change frequently.


In your case I would probably use a JSON property to store the config and write a specific UI widget that reads the input from the user and converts it to a JSON.

Regards,
Stefan

That was extremely helpful, Stefan. I think that I will need to research the OpenEMS UI Widget idea or the App Center JSON-Formly option.

I will review the documentation for the UI Widget option here https://openems.github.io/openems.io/openems/latest/ui/implementing-a-widget/introduction.html.

For the App Center option, is there further documentation on how that fits into the OpenEMS framework?

1 Like