CustomUserCodeLoader

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
dschonac
Posts: 12
Joined: 05 Feb 2015 17:32

CustomUserCodeLoader

Post 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?
dschonac
Posts: 12
Joined: 05 Feb 2015 17:32

Re: CustomUserCodeLoader

Post 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?
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: CustomUserCodeLoader

Post 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)
Since 29-12-2016 I am no longer a moderator for this forum
Post Reply