I’ve updated from 2.5.0-SNAPSHOT, build 1762 to 2.5.2-SNAPSHOT build 32.
I’m on Windows 10, 64 bit.
Now, three of my rules getting errors during system startup. They were running for nearly 3 years now.
.
.
And my logfile get spamed with smarthome.event.ItemStateChangedEvent
// Creates an item that stores the last update time of this item
rule "Records last windows EG update time"
when
Item WindowsEG received update
then
postUpdate(WindowsEG_LastUpdate, new DateTimeType())
end
rule "Records last windows UG update time"
when
Item WindowsUG received update
then
postUpdate(WindowsUG_LastUpdate, new DateTimeType())
end
rule "Records last Motion1 update time"
when
Item Motion1 received update
then
postUpdate(Motion1_LastUpdate, new DateTimeType())
end
// Creates an item that stores the last update time of this item
rule "Records last weather update time"
when
Item Weather_Temperature received update
then
postUpdate(Weather_LastUpdate, new DateTimeType())
end
.
.
ERRORS:
19:48:27.953 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Records last windows EG update time': The name 'WindowsEG_LastUpdate' cannot be resolved to an item or type; line 395, column 14, length 20
19:48:27.955 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Records last windows UG update time': The name 'WindowsUG_LastUpdate' cannot be resolved to an item or type; line 402, column 14, length 20
19:48:18.569 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Records last weather update time': The name 'Weather_LastUpdate' cannot be resolved to an item or type; line 417, column 14, length 18
19:48:28.175 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Records last windows EG update time': The name 'postUpdate' cannot be resolved to an item or type; line 395, column 3, length 52
19:48:28.174 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Records last windows EG update time': The name 'postUpdate' cannot be resolved to an item or type; line 395, column 3, length 52
19:48:28.174 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Records last windows EG update time': The name 'postUpdate' cannot be resolved to an item or type; line 395, column 3, length 52
19:48:28.174 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Records last windows EG update time': The name 'postUpdate' cannot be resolved to an item or type; line 395, column 3, length 52
LOGS:
20:01:22.549 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.527+0100 to 2020-01-28T20:01:22.546+0100
20:01:22.621 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.546+0100 to 2020-01-28T20:01:22.610+0100
20:01:22.651 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.610+0100 to 2020-01-28T20:01:22.616+0100
20:01:22.673 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.616+0100 to 2020-01-28T20:01:22.629+0100
20:01:22.674 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.629+0100 to 2020-01-28T20:01:22.630+0100
20:01:22.678 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.630+0100 to 2020-01-28T20:01:22.637+0100
20:01:22.679 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.637+0100 to 2020-01-28T20:01:22.638+0100
20:01:22.680 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsUG_LastUpdate changed from 2020-01-28T20:01:02.493+0100 to 2020-01-28T20:01:22.647+0100
20:01:22.681 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.638+0100 to 2020-01-28T20:01:22.648+0100
20:01:22.682 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.648+0100 to 2020-01-28T20:01:22.649+0100
20:01:22.683 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsUG_LastUpdate changed from 2020-01-28T20:01:22.647+0100 to 2020-01-28T20:01:22.650+0100
20:01:22.684 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.649+0100 to 2020-01-28T20:01:22.648+0100
20:01:22.686 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.648+0100 to 2020-01-28T20:01:22.649+0100
20:01:22.687 [INFO ] [smarthome.event.ItemStateChangedEvent] - WindowsEG_LastUpdate changed from 2020-01-28T20:01:22.649+0100 to 2020-01-28T20:01:22.650+0100
Did you try clearing the cache or restarting after the update? It looks like your file based Items files may not have been read in properly.
That is assuming there are no errors in the snapshot. Snapshot errors should always be reported as issues on GitHub. That is part of the implicit testing agreement when running snapshots.
This looks a lot like a problem I’ve experienced and @hilbrand has already filed an issue for. There is no fix known yet.
The symptom is after a clear the cache, some to all Items are simply gone as far as OH is concerned. If you open the sitemap you’ll get bombarded with “Item doesn’t exist” errors. Rules that run will bombard you with errors like the above.
The work around is after clearing the cache, let OH fully come up and settle. Then restart OH. Don’t do anything else, just a restart. That seems to clear it. I’ve seen one report that a user needed to restart a couple of times so if it doesn’t work after one restart, try it again.
I want to initialize my *_LastUpdate items (see above) during startup with
something like DateTime = now
rule "Startup"
when
System started
then
if (Weather_LastUpdate.state == NULL || Weather_LastUpdate.state == "") {
Weather_LastUpdate.postUpdate(???)
}
end
rule "Startup"
when
System started
then
if (Weather_LastUpdate.state == NULL || Weather_LastUpdate.state == "") {
Weather_LastUpdate.postUpdate(now.toString)
}
end
Rule gets loaded during reload without any errors.
Still errors during system startup:
19:48:27.953 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Records last windows EG update time': The name 'WindowsEG_LastUpdate' cannot be resolved to an item or type; line 395, column 14, length 20
19:48:27.955 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Records last windows UG update time': The name 'WindowsUG_LastUpdate' cannot be resolved to an item or type; line 402, column 14, length 20
19:48:18.569 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Records last weather update time': The name 'Weather_LastUpdate' cannot be resolved to an item or type; line 417, column 14, length 18
I’m sure you’ve already checked that you have a xxx.items loaded message in your openhab.log at startup.
How long is that before xxx.rules loaded message?
we we’re in contact yesterday - in this topic I was given the advice there to clear the cache, resulting in the very same problems (names can’t be resolved, rules not working).
After restarting twice (as @rlkoshak mentioned here), everything was working fine again.
In addition to that, I’m doing the following for items that aren’t updated by bindings;