Page 1 of 1

Generate Event Example?

Posted: 31 Dec 2015 01:08
by markolbert
Can someone point me to, or provide, code that raises an event from within the z-way server so that it notifies a standalone nodejs app running on the same Raspberry Pi?

I want to be able to sense when lights are turned on or off, and adjust my nodejs script accordingly.

Re: Generate Event Example?

Posted: 07 Jan 2016 04:38
by PoltoS
Depends on how do you want to notify nodejs app - by HTTP - use http.request, by TCP/DUP - use sockets.tcp/udp, by polling - use HTTP API, by running shell - use system call

Re: Generate Event Example?

Posted: 07 Jan 2016 04:54
by markolbert
Hi PoltoS,

Per our conversations on other threads, the main issue I'm running into seems not to be "how to communicate with another app" but rather "how to detect when a switch changes level". Particularly when the switch doesn't support instant status notifications.