Hi,
I'm new to node red but have found it fantastic in showing Temperature and Humidity readings with a DHT22 sensor and a raspberry pi 3B
I have incorporated this in a 3.5" screen on an incubator and would really like to be able to run a counter on the dashboard so I know how many days remaining or have passed. Ideally with a reset button to initiate the timer/counter.
Although I have seen an image of the dashboard with a basic counter I can't seem to see any code for it and am not proficient enough to do it myself.
Does anybody have any example flows of this type of dashboard?
Thanks
What I would do is start with an inject
node - set to run once a day
connect the inject
node to a counter
node
connect the counter
node to a ui_text
node
Now you have your counter set up now to add the reset.
add a ui_button
node that will do the reset. But the ui_button
node outputs sends msg.payload and if you look at the counter
node, you will see you have to send msg.reset.
At this point I'll leave you to puzzle out how you could change the msg coming from the ui_button
node so that it contains msg.reset in addition to msg.payload.
Let me know how you are making out.
Thanks. I'll sit down and work on this on the weekend. I'll let you know how I go.
i found a flow with a counter that I was able to modify to do what I need. It isn't pretty but it counts SS:MM::HH::DD which is what I want.
It turns out the graph side of things on a raspberry pi is great for a short term but i don't think my Pi can compute the data over a day without crashing. I'll remove the graph from the project and keep the counter, temp & humidity dashboard.
I was using the dashboard to monitor temp and humidity rises and falls over a period of time but I now think I would be better off to have an email alert if the temp and humidity is too high or low.
This will eliminate the need for the graph.
How often are you adding points to the chart and over what time range is the chart set to display? Work out how many points that is on the chart, multiply that by the number of lines on the chart and that will tell you how many points the device has to shift across the chart each time you add a new point.
Are you running the browser on the pi or on a separate PC? If it is on the Pi then almost certainly it is the browser hanging trying to do all that work. To improve matters send data to the chart less often. You can do that by putting it through a Delay node set to Rate Limit to 1 per minute (for example) and to Drop Intermediate Messages.
Thanks Colin (Genius!),
You are correct in your train of thought. I have the chart reading data every second where really every 5 minutes would be sufficient. I am browsing the dashboard from the Pi which is mounted in my incubator door.
I'll insert the delay node and am sure this will solve my issue.
Thank you.