I’m using OpenEMS Edge and UI in combination with InfluxDB for a few days.
Today I needed to restart the system. After that, the history for the current day wouldn’t load anymore.
The error comes from the assumption, that energy values in OpenEMS are per definition steadily increasing, i.e. Value(t + 1) >= Value(t). This applies e.g. to consumed energy in [Wh_Σ]. To calculate the ‘discrete’ consumed energy in [Wh] for a certain period, the first cumulated value is subtracted from the last cumulated value. If the result is negative - which is not allowed per definition - the warning “Got negative energy value” appears. (see openems/io.openems.common/src/io/openems/common/channel/Unit.java at develop · OpenEMS/openems · GitHub)
To make sure that the value is actually steadily increasing is the task of the OpenEMS Component. For some physical devices these values are available via API (e.g. via Modbus), for others OpenEMS is calculating them manually from Power.
So in order to answer the question, I would need to know which actual Components you have configured.
The implementation works in such a way, that is uses a local timedata service to store the channel values before restarting. I have not tested this with a local InfluxDB, but only with RRD4j, but in principle this should have worked also.
I suggest you try configuring a local RRD4j timedata service. Start OpenEMS Edge with the openems.data.dir parameter, because this is where RRD4j stores its databases:
The fact that after a restart the data from calculated energy values were gone was quite annoying. I have now implemented the getLatestValue method for Influx (InfluxQL and Flux). So far, it can only be found in my fork, but I’ll create a pull request for it in the coming days.