On my third day I am making new discoveries. Previously I used polling to get events such as pushing a button. This is too slow, wasteful of computer resources and might even miss the event if I am not polling fast enough. Another method is to use interrupts or ‘events’ using websockets.
Its all interrupt processing with non block programming using callbacks and events. It is more efficient and works on every event. You can set all of this up within 1 minute! The diagrams below show the node-red flow and dialogs for the websocket nodes.For the hardware of this flow I am using a Grove PIR module that captures every IR event.
I still have to add the processing for the alerts tones to the speakers but that is easy and I have tested the speaker interface separately. Don’t expect music - potential transmitted frequencies are minimal (only 4 are support on a single musically scale (A to G).
If you want any of the flows give me feedback and I will add them. Then you can paste them into your own node-red canvas.
Post-edit: take care when posting like this so as not to include either your or in the diagrams. I have since removed these. Read your posting carefully. Also this method is not secure as the payload includes the Access Token. As a suggestion, the team at Seeedo Studio could remove the access token from the return payload. It is not need then. In the future secure protocols should be used for real projects.
Ref: Example 3.7 Using Websockets with Node-RED on Node-RED: Lecture 3 – Basic nodes and flows at University of Waterloo (http://noderedguide.com/index.php/2015/10/28/node-red-lecture-3-basic-nodes-and-flows/ ). You can host your node-red either there or on a Raspberry Pi, Beaglebone Black, Green computer or even a Mac or Windows PC.