Hi guys,
I've been trying to write a javascript automation module that is loaded and initialised when the z-way service starts.
I can see that the module is loaded with a simple console.log inside the index.js but the init method never gets called.
How can I configure the module to be instantiated and initialised when the z-way service starts? Thanks!
Javascript automation module
Re: Javascript automation module
Please register on https://developer.z-wave.me and check for the documentation there. It describes pretty well how to do modules
-
- Posts: 3
- Joined: 04 Oct 2017 10:56
Re: Javascript automation module
Thank you PoltoS.
I have read the documentation and it does not correspond with the actions in the automation controller logic. The documentation states that if the module.json file has a property ''autoload' then the module will automatically be instantiated on z-way service startup. However, I have read the code in the AutomationController.js and it does not instantiate the module, even with 'autoload' set to true.
It will only instantiate the modules that are listed in a config.json file in the instances array. Even if you add your module to the instances array in the config.json inside the folder defaultConfig, it will not instantiate because it does not use this file! it uses another config.json file which is placed somewhere else on the raspberry pi and will only default if an exception occurs upon startup.........
I have read the documentation and it does not correspond with the actions in the automation controller logic. The documentation states that if the module.json file has a property ''autoload' then the module will automatically be instantiated on z-way service startup. However, I have read the code in the AutomationController.js and it does not instantiate the module, even with 'autoload' set to true.
It will only instantiate the modules that are listed in a config.json file in the instances array. Even if you add your module to the instances array in the config.json inside the folder defaultConfig, it will not instantiate because it does not use this file! it uses another config.json file which is placed somewhere else on the raspberry pi and will only default if an exception occurs upon startup.........
Re: Javascript automation module
Not sure about the autoload property - never seen it. Of course you need to add the module to your config. This should be done in Apps->Local menu. This will add it to config.json (the correct one located in storage folder). Those you mention are for factory default reset.