System stuck from time to time

Hi all,

I don’t know if this is the right subforum but I’ll try though.

I have an issue i saw yesterday for the first time. A few minutes ago, it was Happening again:

I am using Openhabian 2 (latest Version) on an RPI2. In both cases, I was working on some rules, items and sitemaps. Then suddenly, Items added to the sitemap dont Show up on the sitemap and also simple rules aren’t working any more for example, the (normally working) rule

rule "Verbrauch aktuell by delta redbar"
when Item PowerMeterDeltaT changed
    PowerMeterCurrent_kW.postUpdate(1920/(PowerMeterDeltaT.state as Number))

doesn’t update the PowerMeterCurrent_kW when receiving a new value (iam monitoring this with log/tail)

Visual Studio Code doesn’t show any problems in my rules.
Yesterday, It suddenly worked again on some time, and now, it is Happening again…

Do you have any ideas on this?

How do you send values to this item?
If it is a rule that makes


you should trigger

when Item PowerMeterDeltaT received update

PowerMeterDeltaT gets its updates via a MQTT channel.

I now got some more insight to reproduce the problem:

First, my item and rule file (not all is relevant but i still post it completely:


Number PowerMeterBatterylevel "Powermeter Batterylevel" <batterylevel> {channel="mqtt:topic:4239b1d7:batterylevel"}
Number PowerMeterDeltaT "Powermeter eDeltaT" <time> {channel="mqtt:topic:4239b1d7:eDeltaT"}
Number PowerMeterCurrent_kW "Powermeter eDeltaTInv" <time> {channel="mqtt:topic:4239b1d7:Current_kW"}
Number PowerMeterCounter "Powermeter eCounter" <energy> {channel="mqtt:topic:4239b1d7:eCounter"}
Number PowerMeterTotalKWh "Powermeter kWh total" <energy> {channel="mqtt:topic:4239b1d7:total_kWh"}
Number PowerMeterCurrent_kW2 "Powermeter Current kWh by deltaCounter" <time>
Number PowerMeterCounterLast "Powermeter eCounter last" <energy>
Number PowerMeterDailyKWh "Powermeter kWh daily" <energy>


var long LastChange = now.millis

rule "Verbrauch aktuell by delta redbar"
when Item PowerMeterDeltaT changed
    PowerMeterCurrent_kW.postUpdate(1920/(PowerMeterDeltaT.state as Number))

rule "Verbrauch gesamt"
when Item PowerMeterCounter changed 
    if (PowerMeterCounter.state as Number > PowerMeterCounterLast.state as Number){
        var Number Delta=(PowerMeterCounter.state as Number)-(PowerMeterCounterLast.state as Number)
        PowerMeterTotalKWh.postUpdate((PowerMeterTotalKWh.state as Number)+(Delta*0.0133))
    else {
        var Number Delta=(75-PowerMeterCounterLast.state as Number)+PowerMeterCounter.state as Number
        PowerMeterTotalKWh.postUpdate((PowerMeterTotalKWh.state as Number)+(Delta*0.0133)+0.0025)
    PowerMeterCounterLast.postUpdate(PowerMeterCounter.state as Number)
    LastChange = now.millis

Below, you get an insight into my log:

Okay. As you can see, i have a counter item which is raising (PowerMeterCounter). It raises by steps of 1. Some times, it may skip one or more steps, as the MQTT item is Bound to a 433 MHz Receiver and some Messages get lost. To compensate, I need the Delta to the last update. To get this, I set an Item “PowerMeterCounterLast” which is then set to the actual value of “PowerMeterCounter” at the end of the second rule. This is working Pretty well - until I Change my item file and save it again. This has happened in the upper line of the attached Picture (Refreshing model ‘powermeter.items’
) As you can see, the PowerMeterCounterLast isn’t updating anymore. Also the other items Arent updating.Then suddenly it is working again when PowerMeterCounter switches from 20 to 21. From this Point, all other info within the other items (also PowerMeterCounterLast) is updated furtheron.

Just why???
Are all items getting initialized when saving the items file? how may I fix this? And why doesn’t the log show any more when i am saving files (like rules).