background preloader

Node-RED

Node-RED

The ThingBox Project What is the Thingbox The ThingBox allows anyone to graphically create new unlimited applications interacting with connected objects from a simple web-browser. Dedicated to For non-technical people, this site provides in a single easy step a graphical interface to take fully advantage the Internet of Things. For technical people, the ThingBox is a ready to use device released under the WTFPL licence (the WTFPL is a very permissive license for software and other scientific or artistic works that offers a huge degree of freedom). What the Thingbox is NOT The ThingBox is not a (yet another) new home automation box. How to get a Thingbox Just download and install the ThingBox image file to a Raspberry-Pi, a tiny 35$ computer that you can buy in many shops. Why the Raspberry Pi? You need a full time running computer.

node-red/node-red-nodes tuanpmt/esp_mqtt Home Automation with Node Red, JeeNodes and Open Energy Monitor (Dom Bramley's Blog of Maximo and the 'Internet of Things') Jeenodes I discovered JeeNodes whilst searching for an easy and low cost way to implement a wireless arduino sensor network. The JeeNode is an open source arduino with a built-in 433 RFM12B radio. The radio is both cheaper than a Wifi shield, easier on batttery life and there are numerous of coding examples from Jeelabs and others to make them work. The RFM12B radio is relatively sophisticated with CRC checking, and acknowledgement mechanism and the ability to give Node's their own ID The JeeNode's default sketch is a test utility for the wireless radio - which allows commands to be sent via serial port and It is this mechanism I have used for the Node Red base station. The Open Energy Monitor project also uses the Jee Node libraries as the foundation - so their sensors will also connect to the network straight out the box. Building the network My home network is comprised of the following; Base Station Hardware: Raspberry PI JeeLink Base Station Software Sensors - N.B.

Websockets & Sockets.io Today’s web is more on the lines of demand and supply. A user request a page & the server dispatches it. After that the server is not aware who the client is (unless we maintain a session). For every other request from the same client to the same server, a new connection needs to be opened, every single time. Below is screenshot of page loading time of my blog’s home page using this tool This is a call stack for the first request that was fired from one of the pingdom servers/browsers to my blog. I am still spending ~.4 of a second to do same steps again. Contents Excerpt from wikipedia WebSocket is a protocol providing full-duplex communications channels over a single TCP connection. The only difference between websockets and the traditional model of communication is that, websockets keeps connection alive with all its clients till they disconnect. Browser Support There are 2 parts to the WebSockets. Sockets.IO Node – Sockets Server So, lets set up a socket server via Node & have some fun.

Node-RED : Creating your second flow This example is slightly more complex and starts to bring in data from external sources to do something useful locally. It will go out to an external web site grab some information read and convert that into a useful form output that in two formats, one as a JSON object for further use, and one as a boolean to switch things on and off 1. In the previous example, the Inject node was used to trigger the flow when its button was clicked. Drag an Inject node onto the workspace from the palette. Double click the node to bring up the edit dialog. Click Ok to close the dialog. 2. The HttpRequest node can be used to retrieve a web-page when triggered. After adding one to the workspace, edit it to set the URL property to: You can optionally add a friendly name. 3. Add a Function node with the following code: Set the number of outputs for the function node to 2. 4. Add two Debug nodes. 5. 6. Click the Deploy button. (boolean) true 7. Source

Node-RED Light switch off timer, reset with PIR, on and manually override So the shed lights are always being left on. You can't just add a timer, sometimes you are not in the shed for more than 5 minutes, the next you want to be there for 7 hours. Using a Trigger Node you can input your ON button and a PIR. Either an ON or a PIR will reset the trigger (extend the timer if retriggered; output one set to nothing). And the timer will always turn off your lights. Small side effect is that an off will be sent for any PIR trigger timeout - which doesn't hurt, you might have missed the original ON. Unfortunately there are times when we want the power on 24/7 - how to enable/disable the PIR. In real life the inputs/outputs of this flow are 433Mhz OOK cheap buttons and power points.

websockets/ws

Related: