In the previous article I have shown the basics of getting the Bluetooth running on the Advantech 4G router ICR-3232W running. Let's expand on this and build simple dashboard with SMS alarm, when temperature is higher then threshold.
In the previous article I have shown the basics of getting the Bluetooth running on the Advantech 4G router ICR-3232W running. Let's expand on this and build a simple dashboard with an SMS alarm, when the temperature is higher than threshold.
We will end up with Node-Red flow similar to this one:
To make a simple user interface, we will use built- in Dashboard nodes. To send an alarm SMS router SMS Sender node is used. HW Monitor node is used to get the router temperature as a secondary temperature, which is sent via Alarm SMS.
Here is a quick description of how it all works together.
Every minute, we scan for incoming Bluetooth sensor beacon messages. These are filtered out and we pick only relevant sensor. The data are processed and passed to the Dashboard Graph nodes.
Filter beacons node or completely omit it to get your readings. This might be reason, why do you not see any Bluetooth sensor advertisements arriving.
This is a node in question.
At the same time the data is passed to the
Evaluate alarm node.
This node is dynamically configured based on user input via User Interface. Which does use Form and Toggle button nodes to collect Alarm Temperature, Mobile phone number to send alarm to and enable/disable sending Alarm SMS.
I have used default Node-Red nodes to make it easy and intuitive. For better UI experience using the Template node is usually better. Similar with graphs.
After importing the Node-Red Flow, you should see on your
router_ip:1880/ui` something similar to this:
As you can see, it is very simple and provides relevant information and configuration fields. Please examine the flow nodes, especially the function nodes, where I made comments in the code to explain a few decisions taken. Especially, when the alarm SMS is sent as I am rounding the temperature reading and checking for previously sent temperature.
I am using the same Bluetooth sensor beacon as previously the Ruuvi Tag. There are no limitations to this and you can use your preferred unit. Only, what you need to do is to modify the parsing and scanning to suit your hardware.
Note: If you would like us to do it, please let me know.
Little explanation on the values. These values are from the real sensor. The low humidity readings are the result of unit being placed on a garden bed in full sun for a few days.
- Hosted on my Gitlab as a snippet - here
Installing all necessary components is described in the previous article here.