Dashboard add external png graph

realtime_txt_emonpi.txt (967 Bytes)

Hi John.
Please find attached txt file containing the node-red flow. Open in up, copy the entire contents and import it into node-red (hamburger top right > Import > Clipboard).
Ignore any error messages as it is not yet configured for you system.
To configure it, edit the ‘Settings and construct’ function node by changing the emonURL for the url of your system, and also add your read-write api key.

If you then look at the emoncms inputs page, you should see a new node added ‘weatherstation’, and expanding it should reveal the various inputs, updated every 10 seconds.
I had hoped to use the actual names, such as “today_evapotranspiration” instead of w3, w4 etc, but I wasn’t aware that you were importing so many data feeds (with long names!), and it would substantially increase the size of the JSON string. But no worries, you can add their proper names in emoncms.

Because I don’t have access to your data feed, I’ve added an inject node, which is injecting sample data in the same format as you described above, every 10 seconds. This can be deleted, and replaced with a node to get your actual weatherstation data, such as a websocket node?

Paul

flow.txt (4.0 KB)

Paul,

This is great. Thanks.
I assume the address http://192.168.1.121/emoncms is acceptible?
I change the user name and password also. Is that right?

I suppose the silliest question is how do I get it to start?

John

Paul,

Great I have now deployed the script and see a weatherstation NODE. Will play around with this and then, if you could assist with the live data feed can get this show on the road. The live data live on http://solarschols.com/realtime.txt I assume i need to add this somewhere.

John

Yes, delete the inject node which is posting the dummy data, and inject your live feed in it’s place.
How are you grabbing the data feed to post to Wunderground?

My feed to the weatherunderground is handled automatically (hardcoded) by the Cumulus software.

John

Ah OK, well just add something like the attached flow in place of the inject node, and scrape the data from http://solarschols.com/realtime.txt ;

[
    {
        "id": "fec519c7.eb7368",
        "type": "inject",
        "z": "f82b93ba.98aad",
        "name": "",
        "topic": "",
        "payload": "heartbeat",
        "payloadType": "str",
        "repeat": "300",
        "crontab": "",
        "once": true,
        "onceDelay": "5",
        "x": 174,
        "y": 270,
        "wires": [
            [
                "2897c76c.9ccbb8"
            ]
        ]
    },
    {
        "id": "2897c76c.9ccbb8",
        "type": "http request",
        "z": "f82b93ba.98aad",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "url": "http://solarschols.com/realtime.txt",
        "tls": "",
        "x": 352,
        "y": 270,
        "wires": [
            [
                "25279bce.87bc34"
            ]
        ]
    }
]

So it looks like;
heartbeat

Just import the flow (as you did the last one) and connect the heartbeat & http request nodes to the CSV node. It works OK here!
It’s currently set to update every 5 minutes, but that can be easily changed in the ‘heartbeat’ node.

Paul,

Got that, again thanks very much.

And again sorry to be a pain, I really must learn more about NODERED, I’ve deleted the test feed but deleting the input test does not work. How do I stop NODERED feeding the test data?

John

By ‘test feed’ I assume that you mean the ‘Data Simulation’ inject node.
Nothing changes in node-red until you hit the deploy button - top right.
If the inject node is deleted, and then deployed, then no more data will be transferred to emoncms, as it’s the data injection which triggers the flow.
The inputs will stay in emoncms until they are either updated (by adding the 2 new nodes to node-red) or manually deleted - that’s how emoncms works.

Paul

Are you up and running John?

Paul

Thanks,
nearly yes. have all the inputs updating, have created feeds now try to add a Publish to MQTT to send to Emoncms.org. (I assume that’s what start feed??)

John

will show you an updated Dashboard when I have a couple of hours of data. Well thats the plan and I’ll keep fingers crossed.

John

That’s good to hear, now node-red is sorted and you have your inputs & feeds in place & updating, I’m going to leave it there (busy today), but hopefully other members can pick this up and address any specific issues that you have with emoncms.org

Paul

Paul,

Thank you very much for the time you have spent helping. Very appreciated.

John

A post was split to a new topic: Forward data from emonpi to emoncms.org

Paul,

Have started getting the following error in Debug
“/8/2018, 1:21:42 PMemonpi
msg.payload : string [90]
{“success”: false, “message”: “Error decoding JSON string (invalid or too deeply nested)”}”

Does this indicate that the data from realtime has too many elements. If I reduce the number of data item do you think this may fix it.

John

I have reduced the number of data items all okay now.

No. It means that it’s not able to parse the feed data, not the length of the JSON.
Have you altered the flow in any way?
If not, I suspect that your data feed may have changed format, such as a value missing, throwing the string out of sync.
If you can’t see a problem, let me have a copy of your realtime.txt (as you did before) and I’ll take a look tonight.

Paul

Paul,

Yes I have made the changes by reducing the number of data items. I was silly in that I was bringing over almost all the weather station data when I reality I was only ever going to use about 6 for display on the dashboard.

The realtime.txt file changes every 10 seconds. I assume I have deleted the particular data item that must have occasionally been causing the trouble. I’ll keep an eye on it. Thanks for offer to review data.

Thanks John

In fact I’ve got the URL of your feed, so I’ll take a look this evening.

If you have the time take a look at the dashboard I’ve got sofar