[{"element_type":"markdown","content":"\u003ch2\u003eIntroduction\u003c/h2\u003e\n\n\u003cp\u003eWhen we moved into our new home I started planning how I wanted to handle sensors and LED lighting projects. I needed a place where I could manage motion, window and door sensors, Raspberry Pi cameras and doorbells, and LED lighting projects.\u003c/p\u003e\n\n\u003ch2\u003eDesign\u003c/h2\u003e\n\n\u003cp\u003eFirst step, identify a way to see all the data once I started collecting it. I began by using Adafruit IO. However, as I thought more about what data I was going to be sending and how I wanted to access to that information and dashboard for others, I didn't want it to be public in any way. So I chose, instead, to built a Raspberry Pi 4 based Mosquito MQTT server.\u003c/p\u003e\n\n\u003cp\u003eBeside sensor and camera data, I wanted a way to control any LED projects, and I wanted a hub feel where data including date, time, shared calendar events, and weather data can be easily viewed.\u003c/p\u003e\n\n\u003cp\u003eAfter fumbling around a few different options for viewing MQTT data; I landed on Node-Red.\u003c/p\u003e\n\n\u003cp\u003eHere's a \u003ca href=\"https://cdn-learn.adafruit.com/user_assets/assets/000/002/157/large1024/node-red-dashboard.png?1767748711\"\u003escreenshot\u003c/a\u003e of what it looks like.\u003c/p\u003e\n\n\u003ch3\u003eWhat is Node-Red\u003c/h3\u003e\n\n\u003cp\u003eFrom their \u003ca href=\"https://nodered.org/\"\u003ewebsite\u003c/a\u003e, Node-Red is:\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003eLow-code programming for event-driven applications\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI'm definitely not a Node-Red expert, however, what I've learned and implemented so far has yielded results more than I expected. I quickly found modules for communicating with my MQTT server and my WLED LED nets/Sparkle Motion board.\u003c/p\u003e\n\n\u003cp\u003eI have Node-Red running on the same Raspberry Pi as the Mosquito MQTT server. Set up was well documented and went smoothly. Right now the service is not exposed outside of my home network so I haven't implemented HTTPS and other security features. It's on the to-do list.\u003c/p\u003e\n\n\u003cp\u003eI'm not going to get into the how-to portion of Node-Red, but I will be showing some of the flows I have and providing detail on how I implemented things. Where I provide more detail I will try to include examples from the configuration of buttons, button groups, and functions. In my search for information as I learn, I'm finding a lot of pictures of flows without understanding what's actually happening under the hood.\u003c/p\u003e\n\n\u003cp\u003eOnce configured, Node-Red runs a \u003ca href=\"https://cdn-learn.adafruit.com/user_assets/assets/000/002/157/large1024/node-red-dashboard.png?1767748711\"\u003ewebserver\u003c/a\u003e and any device can connect from their browser of choice. Node-Red also handles different display sizes so it works on your phone or tablet out of the box.\u003c/p\u003e\n\n\u003ch4\u003eThings to know before reviewing associated projects that display in Node-Red\u003c/h4\u003e\n\n\u003cp\u003e\u003ca href=\"https://flows.nodered.org/node/@flowfuse/node-red-dashboard\"\u003e@flowfuse Node-Red-Dashboard-2\u003c/a\u003e provides the UI elements needed to monitor and interact with devices in your IOT set up. \u003c/p\u003e\n\n\u003cp\u003eWhile Node-Red-Dashboard-2 provides most of the UI elements you will need, for an LED indicator I chose to install the \u003ca href=\"https://flows.nodered.org/node/@flowfuse/node-red-dashboard-2-ui-led\"\u003enode-red-dashboard-2-ui-led node\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eThe flow also needs MQTT communications. These are in the node-red package and do not need to be installed separately.\u003c/p\u003e\n\n\u003cp\u003eBecause I wanted email notifications, in the event the garage door is still up under certain circumstances, I had to install the \u003ca href=\"https://flows.nodered.org/node/node-red-node-email\"\u003enode-red-node-email node\u003c/a\u003e.\u003c/p\u003e\n","metadata":{"markdown":"## Introduction\nWhen we moved into our new home I started planning how I wanted to handle sensors and LED lighting projects. I needed a place where I could manage motion, window and door sensors, Raspberry Pi cameras and doorbells, and LED lighting projects.\n\n## Design\nFirst step, identify a way to see all the data once I started collecting it. I began by using Adafruit IO. However, as I thought more about what data I was going to be sending and how I wanted to access to that information and dashboard for others, I didn't want it to be public in any way. So I chose, instead, to built a Raspberry Pi 4 based Mosquito MQTT server.\n\nBeside sensor and camera data, I wanted a way to control any LED projects, and I wanted a hub feel where data including date, time, shared calendar events, and weather data can be easily viewed.\n\nAfter fumbling around a few different options for viewing MQTT data; I landed on Node-Red.\n\nHere's a [screenshot](https://cdn-learn.adafruit.com/user_assets/assets/000/002/157/large1024/node-red-dashboard.png?1767748711) of what it looks like.\n\n### What is Node-Red\nFrom their [website](https://nodered.org/), Node-Red is:\n\u0026gt;\nLow-code programming for event-driven applications\n\u0026gt;\n\nI'm definitely not a Node-Red expert, however, what I've learned and implemented so far has yielded results more than I expected. I quickly found modules for communicating with my MQTT server and my WLED LED nets/Sparkle Motion board.\n\nI have Node-Red running on the same Raspberry Pi as the Mosquito MQTT server. Set up was well documented and went smoothly. Right now the service is not exposed outside of my home network so I haven't implemented HTTPS and other security features. It's on the to-do list.\n\nI'm not going to get into the how-to portion of Node-Red, but I will be showing some of the flows I have and providing detail on how I implemented things. Where I provide more detail I will try to include examples from the configuration of buttons, button groups, and functions. In my search for information as I learn, I'm finding a lot of pictures of flows without understanding what's actually happening under the hood.\n\nOnce configured, Node-Red runs a [webserver](https://cdn-learn.adafruit.com/user_assets/assets/000/002/157/large1024/node-red-dashboard.png?1767748711) and any device can connect from their browser of choice. Node-Red also handles different display sizes so it works on your phone or tablet out of the box.\n\n#### Things to know before reviewing associated projects that display in Node-Red\n[@flowfuse Node-Red-Dashboard-2](https://flows.nodered.org/node/@flowfuse/node-red-dashboard) provides the UI elements needed to monitor and interact with devices in your IOT set up. \n\nWhile Node-Red-Dashboard-2 provides most of the UI elements you will need, for an LED indicator I chose to install the [node-red-dashboard-2-ui-led node](https://flows.nodered.org/node/@flowfuse/node-red-dashboard-2-ui-led).\n\nThe flow also needs MQTT communications. These are in the node-red package and do not need to be installed separately.\n\nBecause I wanted email notifications, in the event the garage door is still up under certain circumstances, I had to install the [node-red-node-email node](https://flows.nodered.org/node/node-red-node-email)."}},{"element_type":"markdown","content":"\u003ch2\u003eProjects\u003c/h2\u003e\n\n\u003cp\u003eAll projects fall under one of three categories at this point:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eSensors\u003c/li\u003e\n\u003cli\u003eCameras\u003c/li\u003e\n\u003cli\u003eLEDs\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003eIn Progress\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003eLEDs: Trellis/Entryway net project\u003c/li\u003e\n\u003cli\u003eCameras: \u003ca href=\"https://adafruit-playground.com/u/ntynen/pages/home-hub-camera\"\u003eDriveway\u003c/a\u003e\n\u003c/li\u003e\n\u003cli\u003eSensors: \u003ca href=\"https://adafruit-playground.com/u/ntynen/pages/home-hub-motion-detector\"\u003eMotion detector\u003c/a\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003eComplete\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003eHome hub\u003c/li\u003e\n\u003cli\u003eSensors: \u003ca href=\"https://adafruit-playground.com/u/ntynen/pages/home-hub-door-and-window-sensors\"\u003eGarage door sensor\u003c/a\u003e\n\u003c/li\u003e\n\u003cli\u003eLEDs: \u003ca href=\"https://adafruit-playground.com/u/ntynen/pages/christmas-tree-star-lights-with-node-red\"\u003eChristmas tree and star lights\u003c/a\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n","metadata":{"markdown":"## Projects\nAll projects fall under one of three categories at this point:\n\n* Sensors\n* Cameras\n* LEDs\n\n### In Progress\n* LEDs: Trellis/Entryway net project\n* Cameras: [Driveway](https://adafruit-playground.com/u/ntynen/pages/home-hub-camera)\n* Sensors: [Motion detector](https://adafruit-playground.com/u/ntynen/pages/home-hub-motion-detector)\n\n### Complete\n* Home hub\n* Sensors: [Garage door sensor](https://adafruit-playground.com/u/ntynen/pages/home-hub-door-and-window-sensors)\n* LEDs: [Christmas tree and star lights](https://adafruit-playground.com/u/ntynen/pages/christmas-tree-star-lights-with-node-red)"}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/157/original/node-red-dashboard.png?1767748711","metadata":{}}]