Generate Event Example?

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
markolbert
Posts: 64
Joined: 16 Oct 2014 06:09

Generate Event Example?

Post 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.
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Generate Event Example?

Post 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
markolbert
Posts: 64
Joined: 16 Oct 2014 06:09

Re: Generate Event Example?

Post 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.
Post Reply