Hi I am new here and work with node red the first time.
I am a programmer in vb.net. So some knowledge about programming is there.
I want to display some values with the chart node.
I imported a flow from the www to learn, but I get "no data available" with that.
It contains an inject node, which triggers a function node, that increases a simple value every 3 seconds. thes values i want to display with a bar chart. But the dashboard say "no data available".
Setting msg.payload then returning the msg will simply return 1 msg with the payload set as an array.
Returning an array of messages will cause the function to output multiple messages.
This is easily verified and can be visually understood by putting a debug node on the output of the function. Your original version will send 1 message. Colins code will send 3 messages.
I am reading in a JSON from a power supplier from www with http request, it contains 24 prices and the corresponding time stamps (hour). I am reading in this JSON every 24h.
In my function node I output these 24 values in a chart and also in 24 checkboxes. I filter the lowest 4 prices and check the checkboxes accordingly. When the actual hour corresponds with the hour of one of the 4 prices it activates loading my house battery.
Additionally I could check/uncheck one or some of these 24 checkboxes manually as well.
So far so good.
The problem is, that the function node runs the code just once in 24h. But it shall run at least every hour. So I need a second inject node which is directly connected to the function node. But if I do so I get an error in a debug node, which says "invalid payload format". But why is it invalid suddenly, I just run the code more often!?