Using oh 3 and I’m trying to change all rules from DSL to Javascript. Seems to be the next great thing. First problem: How do I get the binding actions in the javascript rules?
2021-04-27 21:01:27.747 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'cc11248494' failed: TypeError: null has no such function "phonebookLookup" in <eval> at line number 9
The call is correct. So the problem is likely either the name of the binding is wrong, the ChannelID is wrong, there is a timing issue and the Thing doesn’t exist or isn’t online when the action is called, or you have a typo in the name of the action function itself(e.g. should be phoneBookLookup or something like that).
to 3.) I can’t say much about that. Just that the thing was set up via the GUI and I don’t see any reason why it shouldn’t be there. Do you have any more information for me?
Are all those examples the same language? Different how? Are they different from the example in the addon’s docs?
If that call returns null then that almost certainly is the problem. That or 1 is the problem. You are trying to get the actions for the binding “tr064” and Thing with the ID “tr064:fritzbox:aa8537b549”. If you get back a null it means there is no such action. The only time there would be no such action is, assuming the binding name is correct which appears to be the case, if the Thing by that ID doesn’t exist.
You’ve not shown your Thing definition. You’ve not show the Rule you are trying to use it in. You’ve not mentioned when this rule runs. You’ve not mentioned if the Thing is showing as online.
Dear Rich. Thank you for investing time to help me!
I’ve looked at following places.
TR-064 - Bindings | openHAB
It shows the code for getting the action using DSL rule code. Since there is no indication for which language the code example is, I had to find out first.
Actions — openHAB Helper Libraries documentation
I was excited. However, after many more searches in the forum and the web, it turned out that these Javascript examples belong to one of a self-made solution.