Platform information:
- Hardware: RaspberryPi 3
- OS: Raspbian (Jessie)
- Java Runtime Environment: openjdk version “1.8.0_152”
- openHAB version: 2.3.0
- Persistence: MySQL/ MariaDB on Synology NAS, also MapDB for restoreOnStartup, also tested InfluxDB (and removed it)
I had openHAB running since nearly a year without a hickup. I used it only to show values from the Luxtronik heatpump binding.
Then I added a rule and now openHAB stops working after a few hours. The current values show still in the classic UI, but it seems that persistence and the rule engine stopped working.
The rule is intended to calculat a (rolling) daily energy consumption from a cummulative value I get from the heatpump. e.g. the value steadily increases, but is only a total value, not broken down into hours or days or months.
I defined an item without binding:
Number HeatPump_KWH_total_hourly "Daily KWH total" <energy> (gHistory,gChart)
and used a rule to calculate the current daily energy consumption and bind it to the item above:
rule "KWH"
when
Item HeatPump_Thermalenergy_Total changed
then
// get current total value
var currentTotalKWH = HeatPump_Thermalenergy_Total.state
logInfo("heatpump.rules", "Current KWH total:" + currentTotalKWH)
// calculate difference to begin of day
var Number totalDailyRolling = HeatPump_Thermalenergy_Total.deltaSince(now.withTimeAtStartOfDay)
logInfo("heatpump.rules", "Rolling KWH hourly total:" + totalDailyRolling)
// update proxy item
HeatPump_KWH_total_hourly.postUpdate(totalDailyRolling)
end
When I have this rule in the system, persistence and rules stop working. When I remove this rule, everything works fine.
Do I have a problem in my rule? Logging does not show anything on INFO, I also activated DEBUG … but nothing.
Thank you and Best Regards,
Armin