Storing data collected from water meter sensor

Hi Sir,
I am using LoRaWAN water meters. I am able to collect data from these sensors into my created node red node. Now I need to store this data somewhere. I transmit four times a day the water meter data. I want to store this data of sensors for 30 days per user (one user is assigned one water meter from where consumption data is sent) so that at the end of 30 days, I would be able to make the billing.

Could you please help me if node red has some mechanism of storing water meter data received from sensors?
Looking forward to your valuable advise

Thanks and Regards,
Sritam Paltasingh.

Well you could store it in a database....

What have you tried so far ?

There are a number of nodes that support database input and output functions - i would concentrate on an easy one such as MySQL or SQLlite as your data requirements appear to be minimal.

Do the water meters send a running tally or will you be required to perform maths to ascertain the actual volume of water useage for the time in question ?

Post up what you have so far (your flow)

Craig

1 Like

Thank you craigcurtin for your valuable advise. I am in office now. After returning home, I will share with you the complete work flow along with screenshots so that you can exactly see what I have done and give me further advise.
Thank you so much for the much needed help :slight_smile:

Thanks and Regards,
Sritam Paltasingh.

Hi Craigcurtin,
Please find attached a snapshot of my node red console. The sensors which I am using are transmitting LoRaWAN data to my lorawan network server(TTN server). The data from my LoRaWAN network server is pushed to the input event node named "rak-811-tracker-event-node" as shown in the red circle in the attached snapshot. Also there is another input data node named "rak-811-tracker-demo-node-red" as shown also in the red circle in the attached snapshot. The sensor data comes to these input nodes(pushed by my LoRaWAN network server). These input nodes push their output to the debug node as shown in the blue circle in the attached snapshot. In the debug window in the right(marked in green) we can see the sensor data.

The help I require:
I want to store these raw data coming from sensors in a database. At the end of 30 days, I retrieve these data(these data are water meter values) and calculate the water bill by performing the required maths on the retrieved data. Also at the end of each day I want to show how much amount of water was consumed by a family.
This is the requirement of the end-to-end application that I want to build with node-red.
Please provide your valuable advise on this.

Looking forward to hear from you.

Thanks and Regards,
Sritam Paltasingh.

OK so a couple of things first

  1. Put a single debug node for each of the incoming data streams and give each debug node a descriptive name so we know which data stream belongs to each one

  2. Post up the code you have in your function node - also place a debug on the output of that

  3. We need to see the full object that you are being delivered so in the debug window (once you have done the other steps above) do the dropdown on the object so we can see what is inside it

  4. Once you have 3) you should be able to list the data pairs that you are receiving - something like (i would imagine) - Date and tme of reading, meter ID, Meter Count or somesuch

  5. If it is as simple as that i would then look at the https://flows.nodered.org/node/node-red-node-sqlite - if you are not running it in a resource constrained environment you could go for a more complex database but probably not required whilst you are doing proof of concept

What environment are you running node-red on ?

Craig

Hi Craig,

I did as instructed by you. There was no necessity of the function node. That was only for experimentation. The main thing is very simple. The output of the sensor node needs to be stored in the data base.
You have already sent me a link on how to do it ( https://flows.nodered.org/node/node-red-node-sqlite )
I will go through this.

As shown in the figure marked in red, the raw data from the sensor looks like that. I want to store these data in the database, I will do as said by you.

The environment I am running node-red is my laptop with windows OS. Everything is now happening in my laptop as I am in the learning phase.

The real life requirement is as follows:

  1. The user/customer wants to see their daily water consumption in a web-based application.
  2. They also want to see their water billing for the current month in the web-based application.
  3. Each user's data should only be visible to that user and not to others.

Can all these above 3 requirements be achieved using Node-RED?
Please provide your valuable comments :slight_smile:

Thanks and Regards,
Sritam Paltasingh.

I would not present the information to the user in Node-Red - it is not a multiuser system.

You could front end it with a reverse proxy such as NGINX to give you login and URL control but i do not think that would be the most efficient way to do it.

I would just rent some web space/virtual machine somewhere and host some static pages with the content from SQL Lite exported into them

Craig

1 Like