Page 1 of 1

CustomUserCodeLoader

Posted: 24 Mar 2015 10:44
by dschonac
Hello,

i am having a problem with the CustomUserCodeLoader.

I am using a javescript file to define z-wave binding with power-metering nodes, so that everytime a sensor value changes a script is executed.

It worked once, but now i get the following error

Code: Select all

Can not init module CustomUserCodeLoader: Error: Uncaught ReferenceError: zway is not defined
Looking at the log file, i can see that my script is loaded right BEFORE the z-wave binding module is started, but it needs this module, otherwise it fails.

How can i ensure that z-wave binding is started before the CustomUserCodeLoader?

Re: CustomUserCodeLoader

Posted: 24 Mar 2015 11:27
by dschonac
This seems to be some kind of bug:

If i use

Code: Select all

service z-way-server restart
i get the same message.

However, if i use

Code: Select all

service z-way-server stop
and then

Code: Select all

service z-way-server start
it works.

However, since i have to manually start and stop the service this is not really suited for autostart.

I read somewhere that i can put the path to the javascript file into the main.js in the automation folder, but i can't find it anymore. Maybe this would help? Can someone please tell me the syntax to execute my javascript via the main.js?

Re: CustomUserCodeLoader

Posted: 24 Mar 2015 13:14
by pz1
Since a long time I do experience the same with my UDP send module. Seemed to work better for a while with rc22, but now on rc23 I had to do reboot, start/stop and finally a reboot again before the module started sending messages again. In my case behaviour after restart/reboot is very irregular. Also the logs do not give a hint on what might be wrong (my CustomUserCodeLoader is the very first one loaded in HA)