My items are numbers only, there is no one with UoM.
So why do i have to remove it then?
It is working now, thanks a lot.
I added the floatValue to this line, in vscode there is no error, but in the log i get errors:
var count_today = (HeatPump_Stromzaehler.deltaSince(ZonedDateTime.now().with(LocalTime.MIDNIGHT)) as QuantityType<?>).floatValue / 2000
[ERROR] [.handler.AbstractScriptModuleHandler] - Script execution of rule with UID 'strom_heatpump-2' failed: Could not cast 11449.625 to org.openhab.core.library.types.QuantityType; line 42, column 22, length 97 in strom_heatpump
My last problems are only warnings, no errors:
stromzaehler0_hausverbrauch_vor6tagen.postUpdate(stromzaehler0_hausverbrauch_heute.historicState(now.minusDays(5).with(LocalTime.of(0,0,0,0)), "rrd4j").state)
warning:
The method historicState(Item, ZonedDateTime, String) from the type PersistenceExtensions is deprecated
When i change historicState to numericState, i get an error:
The method numericState(ZonedDateTime, String) is undefined for the type NumberItem
What is the right way to solve this? When i don´t change this, will this break my rule in a new openhab version in the future? I think now i can use old and new way and in future versions i have to use the new way only?