Hi,
I will not deny it but this happened only once- since them I am getting NullPointer Excceptions whitout usefull error messages. I remember from my issues with sitemaps this happened when ther was not the right “item” used. However, I followed the beginners guide and it is pretty much the same…
So I tried again step-by-step. First, edited the items file to make sure it got read correctly:
Contact Door_Contact "Eingangstuer" <switch> { channel = "enocean:mechanicalHandle:FTB3SXG:FEF70304:contact" }
Switch Net_BackupPC "BackupPC" <network> { channel="network:pingdevice:192_168_9_1:online" }
Switch Schalter_EG_Kueche "Küchenlicht" <light> { channel="enocean:measurementSwitch:FTB3SXG:05194E91:generalSwitchA" }
Switch Schalter_EG_Vorratsraum "Vorratsraum" <light> { channel="enocean:measurementSwitch:FTB3SXG:05194E91:generalSwitchB" }
And yes, no errors:
2020-04-25 22:14:23.751 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'manual.items'
2020-04-25 22:14:24.841 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'manual.items'
Then I created my rules file:
rule "Auto-OFF Vorratsraum"
when
Item Schalter_EG_Vorratsraum changed to ON
then
logInfo("KNEBB","Speiseraum ON")
end
Which loaded perfectly fine:
2020-04-25 22:17:57.606 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'speiseraum_timeout.rules'
So I would expect as soon as the state of Schalter_EG_Vorratsraum (for whaever resaon- manual switch or received command) I will see entries in event.log and the configured string in openhab.log.
2020-04-25 22:20:26.271 [ome.event.ItemCommandEvent] - Item 'Schalter_EG_Vorratsraum' received command ON
2020-04-25 22:20:26.316 [nt.ItemStatePredictedEvent] - Schalter_EG_Vorratsraum predicted to become ON
2020-04-25 22:20:26.367 [vent.ItemStateChangedEvent] - Schalter_EG_Vorratsraum changed from OFF to ON
2020-04-25 22:20:27.096 [vent.ItemStateChangedEvent] - enocean_measurementSwitch_FTB3SXG_05194E91_generalSwitchB changed from OFF to ON
Perfect! Events triggered! And I see my log entry:
2020-04-25 22:20:26.567 [INFO ] [eclipse.smarthome.model.script.KNEBB] - Speiseraum ON
Ok, happy! So I assume items and “when” part is absolutely fine. Now trying to change the actions in my rules to send a command to the second channel (on the same thing):
So I change it to the following:
rule "Auto-OFF Vorratsraum"
when
Item Schalter_EG_Vorratsraum changed to ON
then
Schalter_EG_Kueche.sendCommand(ON)
end
And boooom I am getting my Java exceptions I can not cope with…
2020-04-25 22:24:09.865 [ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment '|::0.2.0.2.0.0.7.0::0::/1' failed.
java.lang.NullPointerException: null
at org.eclipse.smarthome.model.script.ScriptServiceUtil.getActionServices(ScriptServiceUtil.java:111) ~[?:?]
at org.eclipse.smarthome.model.script.scoping.ActionClassLoader.loadClass(ActionClassLoader.java:37) ~[?:?]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_212]
So what the heck is wrong here?