Need "Heartbeat" (and diagnostic) node server
Closed this issue · 3 comments
For a running installation, it is important for a user to be able to determine if the Polyglot service is functional -- much like it is important for a user to be able to determine if a battery-powered Insteon device is still functional. A new node server should be bundled with Polyglot that can provide, like a battery-powered device, a periodic heartbeat signal -- thus allowing a program on the ISY to determine when Polyglot is offline and notify someone.
Such a node server would have the additional advantage of being an excellent diagnostic aid. It would be entirely self-contained, and have no dependence upon external devices such as Hue hubs, cameras, thermostats, or media servers (thus making configuration not only simpler, but identical for each and every user and use case). The addition of a small number of "diagnostic aids", such as a "test" button in the UI, and a "test" value in the UI, combined with extensive and detailed logging, would permit testing of basic sending of values to the node server from the ISY, as well as basic updates of the ISY from the node server. To make it actually useful, the "test" value might be the value of time.time() on the Polyglot host, and the "test" button might allow the user to select from several pre-determined update intervals for the heartbeat and the "test" value (e.g. 24 hours, 12 hours, 1 hour, or 15 minutes, as appropriate).
Comments and thoughts on this issue are welcomed. Feedback for features that would have made solving user issues easier or faster are especially needed.
The original code for implementing this feature was built directly on the NodeServer class. A change in direction has been deemed necessary - this diagnostic should use the same class upon which normal node servers should be built (SimpleNodeServer). As a result, much of the diagnostic logging code for the initial NodeServer-based mechanism has been moved into the SimpleNodeServer and Node classes, and as such are now available for all Node Servers based on those.
Further work will be required to move this code to be based on SimpleNodeServer, so this feature will be a little bit delayed.
New "Pulse" node server has been added. As currently implemented, this node server adds two nodes -- a simple node whose status is the current integer value of time() on the Polyglot host system, and which sends a DON command every 60 seconds which can be used as a heartbeat for Polyglot. The second node is a test and statistic-display node, which permits the user to perform a couple of very simple tests for functionality, and display some basic statistics.
The first of the two nodes (the heartbeat node) is considered complete; the second is rudimentary. Nevertheless, the Pulse node server is in a good enough state for initial release.
Excellent idea. Thank you mjwesterhof.
With kind regards,
Michel