Provo wrote:You log into your Z-Way web interface. Then you click the cog in the upper right corner, and go to "Apps". Then click the "Online Apps" button. There you have a button which probably says "Featured apps". Click it and change to "Developers Stuff". There you have an app called "Load custom JavaScript file", most likely abbreviated in the overview to "Load custom JavaScript …". Install, add app, and set it up with the path to your file.
Thank you, that was helpful.
However, I now find that I cannot use the javascript/node directive "require" as in
.
I was hoping to use this to read and write files (in particular to write my own log file rather than write to console.log which goes into z-way-server.log.
I also want to require('socket.io') and require('net').
These are all typical server side functions.
Is there any way these can be implemented in z-way?
Also, It seems that JS code added by the "load custom Javascript" process gets executed only at system startup.
Is that correct?
And how/when is the log file emptied? It seem to contain rather a lot for my very simple network.
Thanks