Java Runtime Environment: openjdk version “1.8.0_242”
OpenJDK Runtime Environment (Zulu 8.44.0.11-CA-linux64) (build 1.8.0_242-b20)
OpenJDK 64-Bit Server VM (Zulu 8.44.0.11-CA-linux64) (build 25.242-b20, mixed mode)
openHAB version: 2.5.1-2 (with MQTT1.0 Binding)
Issue of the topic: I created a new rule for my garage opener, but it is not working. I only see an error message. Any idea? Thanks for your support!
mqtt.items
String Button_Tradfri_1 { mqtt="<[mosquitto:zigbee2mqtt/0xccccccfffee267bf:state:default]" }
Status can be “on” or “off”
Number Tasmota_Garage_Distance “Entfernung [%.0f cm]” { mqtt="<[mosquitto:tele/sonoff_sensor_1/SENSOR:state:JSONPATH($.SR04.Distance)]" }
garage.rules
Line1: rule “Garage Schalter Wohnung Tradfri”
Line2: when
Line3: Item Button_Tradfri_1 changed
Line4: then
Line5:
Line6: if (Button_Tradfri_1.state == “on” && Tasmota_Garage_Distance.state > 250) {Sonoff_Basic_GA.sendCommand(ON)}
Line7: if (Button_Tradfri_1.state == “off” && Tasmota_Garage_Distance.state < 251) {Sonoff_Basic_GA.sendCommand(OFF)}
Line8: end
ERROR MESSAGE IN LOGFILE
2020-02-09 13:17:08.403 [ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment ‘|::0.2.0.2.0.0.0.6.6.6::0::/1’ failed.
java.lang.NullPointerException: null
2020-02-09 13:17:08.408 [ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment ‘|::0.2.0.2.0.0.0.6.6.6::0::/1’ failed.
java.lang.NullPointerException: null
2020-02-09 13:17:08.412 [ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment ‘|::0.2.0.2.0.0.0.6.6.6::0::/1’ failed.
java.lang.NullPointerException: null
2020-02-09 13:17:08.413 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Garage Schalter Wohnung Tradfri’: The name ‘Button_Tradfri_1’ cannot be resolved to an item or type; line 6, column 13, length 16
No, the items are in the mqtt.items file and the rules are defined in garage.rules
There are a lot more items in the mqtt.items file, but I think this is not needed, nor?
I was curious about anything above this rule in the .rules file. The last error says line 6, but I don’t see Button_Tradfri_1 in line 6, so I assume something else is in the file. The other errors usually mean there is something in the file that is not an import, a global variable, or a rule.
Do you have Button_Tradfri_1 in a sitemap, and if so, does it work properly? Is the Thing online? Make a change to your Items file (or touch it) and watch the openhab.log for errors.
So, it’s not used in a sitemap. I added it and the value is correct (“on”/“off”).
I use MQTT1.0 Binding, therefore there is no THING for that, right? If you mean the MQTT Broker, it’s online, yes.
Items File can be changed without any error.
Very strange… after restart, same issue - clearing the cache, restarting again solved the issue.
All other rules worked fine and could be changed without any issue… Nevertheless now it’s working.
Thanks for your support.
i think ive got the same/similar issue but clearing cache and restart didnt help yet.
With every new rule or new rule content i get resolution of uriFragment - NullPointerException
If i delete new rules or new rule content, everything is fine again - even the old rules
I had to make a clean install - now it works again