Thanks for looking into it, I did try the flux and there is an interesting suspicious difference which I don’t understand (M5 returning two values?!), where the first one seems to be the one M5 is always working with, hence when I am calculating difference, it fails to 0 (which is how I found out something is wrong).
So it seems it is not result of not finding anything in influx and reverting to some other persistence source, but I suspect something may be wrong with the series in my influx. Still don’t understand how this can happen and how to fix (can try dropping that particular value, but would like to keep the history).
Note I needed to modify the stop: by adding 0m as it was throwing error.
Full log:
root@ee5f030e99c2:/# influx query
from(bucket: "openhab/autogen")
|> range(start: -100y, stop: )
|> filter(fn: (r) => r._measurement == "feedin_energy_today")
|> keep(columns: ["_measurement","_time","_value"])
|> last()
Error: failed to execute query: 400 Bad Request: compilation failed: error @2:24-2:28: missing property value
root@ee5f030e99c2:/# influx query
from(bucket: "openhab/autogen")
|> range(start: -100y, stop: 0m)
|> filter(fn: (r) => r._measurement == "feedin_energy_today")
|> keep(columns: ["_measurement","_time","_value"])
|> last()
Result: _result
Table: keys: [_measurement]
_measurement:string _time:time _value:float
---------------------- ------------------------------ ----------------------------
feedin_energy_today 2026-06-03T15:23:00.870000000Z 7.78
root@ee5f030e99c2:/# influx query
from(bucket: "openhab/autogen")
|> range(start: -100y, stop: 0m )
|> filter(fn: (r) => r._measurement == "feedin_energy_today")
|> last()
|> keep(columns: ["_measurement","_time","_value"])
Result: _result
Table: keys: [_measurement]
_measurement:string _time:time _value:float
---------------------- ------------------------------ ----------------------------
feedin_energy_today 2025-06-30T21:32:00.000000000Z 24.67
feedin_energy_today 2026-06-03T15:23:00.870000000Z 7.78
I was trying the timezones before, it is set up through TZ=Europe/Prague for both openhab and influxdb and also Openhab GUI shows it properly.
M2 verbose logging shows
│2026-06-03 17:28:34.274 [INFO ] [openhab.core.model.script.script_dbg] - DEBUG [Saved] Feedin components -> feedinNow: 7.81, feedinPrev: 7.26 │
│2026-06-03 17:28:34.277 [INFO ] [openhab.core.model.script.script_dbg] - Current ZonedDateTime: 2026-06-03T17:28:34.276873580+02:00[Europe/Prague] │
│2026-06-03 17:28:34.285 [INFO ] [openhab.core.model.script.script_dbg] - Formatted Time: 2026-06-154 17:28:34 CEST (GMT+02:00)
I’m not aware of any aliases, this is the item definition in .items
Number feedin_energy_today "Today FeedIn to Grid [%.1f kWh]" <energy> (gSolaxModbus, gSolaxModbusSelection) ["Measurement", "Energy"] {channel="modbus:data:localhostTCP:inputRegisters100:FEEDIN_ENERGY_TODAY:number" }
If you can provide transformation for other functions (maximum, minimum, change, …) I can run them as well, but I think this goes down to some issue in how influx treats the request…