Modifying gui-v2

Hi all,

with 3.50, gui-v2 seems to be the new direction. I’ve seen the old discussions about how to modify the GUI, but it’s not conclusive what in the end the chosen solution really is and how to make it happen.
Specifically, this is about GitHub - kcbam/dbus-huaweisun2000-pvinverter: dbus driver for victron cerbo gx / venus os for huawei sun 2000 inverter - we’re adding menus to configure the PV inverter for gathering the data. I’d like to replicate this into gui-v2, but I’m lacking a starting point on how to do it the right way.

Thanks a lot, Klaus

1 Like

i think more ways will come with time.

I’d be happy with one documented way… :sweat_smile:

As far as I can tell, there is no change to how you do this in gui-v2 from the original gui, since you don’t need to change the GUI to provide menus for user settings. This is all part of the dbus api. If you define attributes as settings when you register the device on the dbus they will appear as user settable attributes on the device’s setup menu.

If don’t have an example to hand but this is the setup menu on a temperature sensor.

and

This is unfortunately not the case. Your example is based upon the file /opt/victronenergy/gui/qml/PageTemperatureSensor.qml in the V1 GUI and works for the temperature devices. Any other special devices that are not already covered by the GUI need to adapt the GUI, see the install.sh script in the github repo linked above for an example. The question is basically: what is the correct way to do this in the GUI-V2. There was a discussion about it in the old community and I’d love to continue this discussion, but that’s not possible: Venus OS: modifying gui-v2 - VictronEnergy

Hey all, yes, we’re also keen to restart that discussion; and get to work on it.

In brief:

gui-v2 is 100% open source, which btw is a good step forward compared to gui-v1. Modding it is possible, but then to see your changes also via VRM you need to build your modded version from source; including the wasm version, and install that onto your GX. There is working infrastructure in place to then upload/access that over VRM. For details see here: GitHub - victronenergy/gui-v2.

However, even though possible, modifying gui-v2 is not easy. And for sure more complex than how to do it with gui-v1.

6 Likes

Thanks @mpvader for coming back on this topic!

I understand that GUIv2 can be built, and doing so is probably not the biggest problem. The problems I see with this approach are

a) If more than one external developer wants to modify the WASM build, only one can win. E.g. it’s not possible to add config menus for a battery driver (dbus-serialbattery for example) and add config menus for a PV inverter (dbus-huaweisun2000 for example) because each would overwrite the other’s WASM file during installation
b) Users need to trust that the shipped WASM file is not compromised. There’s no way of easily telling what’s in the WASM and malicious developers can hide code.

I agree it’s a great step forward that GUIv2 is open source btw. I would see two ways forward:

a) Victron implements a robust and easy way to modify GUIv2 though e.g. config files, like YAML or JSON or similar
b) Victron would accept community contributed code into the GUIv2 code (aka Pull Requests) that then is shipped with the next release of VenusOS. This is a slower process though as it needs to rely on Victron issuing new VenusOS releases in order to fix even minor problems.

Would be interested in hearing your thoughts!
Thanks, Klaus

3 Likes

Hi, I wanted to ask if there’s any update on this overall topic. Thanks, Klaus

We’re also interested in any update on this. Regards, Espen

Hey all,

An update on this topic! We’re now starting to work on this - finally.

The first thing happening the coming time is doing some proof of concepts. Whereafter we’ll see how to go about this.

These are the two proof of concepts being worked on:

Proof of concept 1: Load custom QML

Be able to store QML files on the data partition, which will then be loaded in to gui-v2; both on screen as well as in the WASM version, ie the gui-v2 that you and use in a web browser on VRM as well as just locally via LAN / WiFi.

This will allow to add a new page; but also to add a submenu into the settings, with (for example) configuration parameters for your mod.

Proof of concept 2: Load a web page / Node-RED dashboard

The QML option explained above will be the most powerful option - ie the one that gives the most freedom, and be most feasible from GX CPU point of view.

But it does require development of QML pages, which does has a certain entry level barrier. No drag and drop.

And that is where this second proof of concept comes in: being able to embed a webpage / webbrowser in gui-v2. Which can server as a means to show Node-RED developed dashboards inside your GX; and then the end goal is achieved: it is then possible to make a custom dashboard without having to do real software development.

One of the limiting factors will be CPU power of the GX device, but when looking at the Ekrano GX, which is quite powerful, as well as more future versions of the Cerbo GX, showing a web page is totally possible.


There is a lot more that could be said about this, but for now this is it.

Thoughts welcome! they’ll help.

7 Likes

Great news!
This is going to be very useful for us, and we are interested in both options.
We aim to use the GX in hundreds of installations across Africa, and the opportunity to expand with more info will be very important for our local operators that interact with the systems daily

I have a Node-RED dashboard running on my Cerbo GX now, but displayed on an external browser. Would the embedded webpage concept tax a current Cerbo into uncertainty, or would you expect it to be something that might work?

I love the GUI-v2 look, but it’s definitely missing some pieces for my multiple battery RV use case.

I’d expect that the Cerbo Gx is not capable of displaying a web page. At least not the type of web page that all of us consider normal today (full of javascript, responsive css rendering and other cpu intensive things)

Thanks, a Node red dashboard is what I had in mind. I have 3rd party I/O used to interface Victron equipment into my coach.

I plan to use the new app on a tablet. I haven’t played with it yet, is there a way to leave the GX view to a browser?

1 Like

I’m find some infos how to upload a new custom gui-v2 on cerbo Gx MK2 running 3.70 firmware. All infos about “compile and upload gui-v2” on github are out of date. Can anyone explain me how to upload and test the modified gui-v2 on a cerbo with 3.70 firmware ? Does anyone work on it ?

Why is it outdated? Can you exactly explain what is outdated in your opinion? Have you checked How to build venus gui v2 · victronenergy/gui-v2 Wiki · GitHub and How to create GUIv2 UI Plugins · victronenergy/gui-v2 Wiki · GitHub ?

I follow the Wiki on github but on 3.70 version firmware I did not find any/opt/victronenergy/gui-v2/ folder and also the svc -d /service/start-gui does not work.. there is no more any start-gui script. So I think the wiki is out of date. The 3.70 firmware is probably newer.

What for a GX device do you have? Maybe a Raspberry Pi?

You got it !!! Sorry… I have on board a Cerbo GX MK2 and a RPI 4. I’m using the Raspberry connection and not the Cerbo Connection. All now is well !!! Thank you very much !!!