The documentation for Z-Way development, on page 11, refers to accessing the JS API on the server side:
"3. zway.devices[3].*: Server Side access using the JS and the public zway object"
How can I access the JS API server-side? Is there a JS file that I can include that defines the zway object and gives me access to the API? I am writing my own automation code and web server using nodejs and would much rather import a JS API than write code to make HTTP calls to 127.0.0.1:8083.
Access server-side API
Re: Access server-side API
I just know that this works if you are creating a JS device on the UI, so ZWay server itself is using it. But I don't know how to use it for your project?! But it could also helpful for me, so every idea is welcome.
Re: Access server-side API
Once logged in as admin, you can use ip:8083/JS/Run/zway.devices[3]..... URLs to access low level API
Re: Access server-side API
I'd like to actually load the JS API so that I can interact with it as an object, instead of making HTTP requests to a URL.
Instead of my code looking like this:
I'd like it to look like this:
Instead of my code looking like this:
Code: Select all
$.get('localhost:8083/JS/Run/zway.devices[3].instances[0].turnOn())
Code: Select all
zway.devices[3].instances[0].turnOn()
Re: Access server-side API
You will need to make a big API for this... Not so easy... May be it is worth to make such a wrapper. We will think of it