The world of IoT is a haven for subscription services that charge you monthly to monitor hardware you own. This does not sit right with many people. Long gone are the days of buying and owning a piece of software for life. It should be noted that many Cloud platforms provide invaluable services and great reliability. However for many users that just need to monitor a couple sensors for a small project or for full fledged Corporate roll outs where high monthly subscriptions are not an option things can seem bleak. However this setup allows you to enable push notifications and remote access to Node-Red Dashboard where we can see sensor readings for just $9.50 per year! That’s 78 cents a month! You can also try it out for free for a few days to see if it’s everything you need.
Today we will demonstrate how you can access a nice dashboard with sensor readings on your iPhone or Android device and even get notifications when a temperature sensor exceeds a limit. This is a perfect application solution for freezer monitoring.
The Hardware we used:
Long Range Wireless Temperature/Humidity Sensor:
The Enterprise Gateway which runs the Node-Red application making all of this possible:
The hardware for this application may seem expensive at first, however if you keep in mind the money saved not paying monthly subscriptions and also factor in that you can add several more sensors to your gateway in the future you’ll see this is actually very cost effective.
As a thank you for reading please use this coupon at check out for 10% off your order of $500 or more: tempnotifyarticle10
Quick Disclaimer
Before we begin keep in mind this article will address how to implement remote access to a Sensor readings dashboard and get notifications of alarms right on your phone. However it does not replace reading the Gateway and sensor user guides. Please if you are just starting out go through those documents first to get acquainted with the hardware.
Enterprise Gateway User Guide.
Long Range Wireless Temperature/Humidity Sensor User Guide
Today we will be utilizing a service allowing us to remotely access Node-Red Dashboard and send notifications to your phone. NCD did not develop this library/service and we do not maintain the servers it runs on. That is kindly provided by Remote-Red. You can read more information on their site here: https://www.remote-red.com/en/home-en/
I always recommend validating the hardware is in good working order and everything is functioning as it should. Your Enterprise Gateway comes pre loaded with a flow as shown on the left. The debug panel in Node-Red lets us see data coming in from sensors. Hit the RST button on your sensor and validate we’re getting data from it.
If you are seeing data coming from the Temperature Humidity sensor then go ahead and move on.
Your Enterprise Gateway will come pre loaded with most of the libraries you’ll need, however we do need to install the Remote-Red library. To do this click the menu button in the upper right corner, then click Manage Pallet. In the window make sure the Install Tab is selected, search for node-red-contrib-remote and you should see the Remote Red library. Install that now.
Out of the kindness of my heart I created the Node-Red flow for you so there will be very little you will need to do in setting up the flow. Download the Flow from Github here.
Once downloaded click the menu button in the upper right corner again. This time click Import. When prompted select the Freezer_Monitor.json file you just downloaded.
You should see a new tab added to Node-Red. This is the flow we will edit to your own personal preferences.
Feel free to take a moment to look through the flow before we will dissect it in a minute.
At this point it would be a good idea to go ahead and install the Remote-Red app on your iPhone or Android device. Just search the App Store for Remote-Red and install it.
Back in the Node-Red flow scroll down on the left side list of Nodes until you see the remote-access node. Drag it into an empty space in the flow. Then double click on it. Make sure Add new remote-config… is selected in the drop down box to the right of config, then click the Edit button to the right of config.
Select the Server location that makes sense for your current location.
Feel free to change the Name Field. This will set how it appears in the App. Something Like Freezer Monitor, or Office Gateway.
Click Connect Remote-RED App.
A QR code will appear. Open the Remote-Red App on your phone. At the bottom click Add Node-RED instance. This should prompt the camera on your phone and you can scan the code. After Scanning it should say it’s connected.
In Node Red click the Add button at the top then click Done to complete the setup. Now the Remote Node should have text below it that says Serving and a green square indicating everything is working normally.
Locate the two Send Nodes in the flow. Double click on one of them. Click the Config drop down and select the config node you created in the previous step. Then click done. Do the same for the second Send Node.
Also Note here you can change the title of the Alert sent to the phone. The Body is currently set to the temperature reading so I recommend leaving that as is. You can also change the Alert sound played on the phone if you’d like.
First I recommend hitting the RST button on your sensor real quick just to force it to send a transmission. After that locate and double click the Sensor Node in the flow. Now click the search glass icon to the right of the MAC address field. Locate your sensor by its Serial number in the list and select it. Then click Done.
That’s really it for the setup. Now we can look into how the flow works, how you might customize it for your needs, and how to easily test it.
You’ll find two Nodes labeled High and Normal. These are test inject nodes you can use to test without having to move your sensor around to different temperatures or press the RST button to trigger transmissions.
If you double click those High and Normal Nodes you will see a JSON element, you can click the dots to the right to edit them. Here I have static temperature readings set. These readings are in Celsius. You can edit those values as needed in testing. The High is suppose to trigger a high temperature alarm for a freezer while the Normal notifies the user that the freezer was above the limit but has returned to normal.
Before changing anything try clicking the Blue square to the left of the High node. You should get a notification on your phone. Pretty cool huh. Now click it again. What…. you didn’t get a second notification? Well that’s because we only want to be told one time when the Freezer goes above the limit. Click the Normal inject node now and you’ll get a notification that everything is fine now. But only one. Now if you click High again you get another notification. The flow here resets notification variables so we are not inundated with notifications all the time.
If you click the notification on your phone you will be taken straight to the Remote-Red app. Or you can just manually open it to check in on things. Here you can click the Dash board you created earlier and after a few seconds the dashboard appears. Here you can see the Gauge widget with live readings, text that indicates when the last sensor transmission was received, and a line graph of readings.
Don’t worry, my freezer is ok, I just have the sensor on my desk for testing.
You will see the sensor node is connected to to a function node first. This converts the sensor’s ºC readings to ºF because I’m in America and Don’t like doing math in my head. You can of course remove that function node, just make sure to hook everything back up as it should be.
Next we connect to a change node which is connected to gauge and chart nodes. This sets the payload properly and provides the readings to the dashboard nodes displayed in the app. Pretty simple. You can change labels and things as desired in the gauge and chart node.
Below that there is a long string of switch nodes and, notification nodes, and change nodes. This is where the notification magic happens. This long flow of nodes mainly makes sure we do not get repeated notifications. I recommend setting the high notification switch temperature at least a couple degrees higher than the normal notification temperature limit. This ensures the sensor does not bounce back and forth on the limit causing a bunch of notifications. This is known as a reading buffer zone. Feel free to change the High and Normal temperature limits as you see fit. The rest should really be left as is.
You’ll also see an Initialize Variables function node which sets the High and Normal alert sent variables on boot. This is important and should not be deleted or changed.
Once you have things the way you want I recommend exporting the flow from Node-Red and saving the file. That way if you ever mess something up you can easily recover.
Almost nothing in this world is free. Any time we send notifications or require remote access to a UI we are involving a server. Maintaining and hosting that server is never free. So we should be expected to pay for the service. Even if you spin up your own AWS instance you’re going to have to pay for it. This setup however is ridiculously reasonable. I see no way to get remote access to a dashboard and notifications on your phone cheaper. If I ever find something cheaper or simpler I’ll be sure to share it with all of you.
Thank you for reading! Enjoy this discount code for making it this far:
thanks10