Community
OpenEnergyMonitor

Community

Node-red ui for emoncms dashboards?

emoncms
Tags: #<Tag:0x00007f880edda098>
(Paul Reed) #1

Anyone using the node-red ui for their dashboards?

Just tried it, and although it’s not as comprehensive as the emoncms dashboards, it renders well on both laptop and mobile devices, and could be used for basic easy deployment - as the node-red flows can be exported/imported. Also would prevent users having access to feeds, processes etc to protect data integrity.
I’m using the ‘node-red-contrib-ui’ node module for this example, although the node-red team are currently in the early stages of further developing this work under the name node-red-dashboard (it’s not released as a npm package yet).

To access emoncms data, I’m using 3 MQTT feeds from emoncms, and getting the daily data via api calls every 15 minutes.

Paul

9 Likes
Mobile/Tablet Dashboard module
(Paul Reed) #2

To replicate the above;

  1. Add the ui node module to node-red;
npm install node-red-contrib-ui```

2) Import the flow attached to this post into node-red <a class="attachment" href="/uploads/default/original/1X/d89f87dbae26c01841832272b5701ffc0d51f3fd.txt">nodered_flow.txt</a> (8.8 KB)

3) Edit the 3 'Data' MQTT nodes with your MQTT feed names

4) Edit the 'Get emoncms data' inject nodes, and the 'http request' nodes with your emoncms api feed number & URL 

Your node-red dashboard will then be available at a URL similar to http://192.168.1.10:1880/ui

Paul
4 Likes
(Lee) #3

That Sir, is epic. Consider it installed and running!

Keep up the good work!

(bart.ellast) #4

Paul,
Can you explain a bit how the today value’s are calculated?
I see you get the value’s with the http request. What feed type is behind this?

Is this a kwh/d or accumulating kwh feed?

Thank you for sharing!

Calculating Daily Totals
(Trystan Lea) #5

Thats looks really nice!

1 Like
(Paul Reed) #6

Just seen that v0.14.4 of NodeRed has been released, which now allows the ‘official’ version of NodeRed Dashboard to function.

Nick O’Leary has posted that ‘The first release of Node-RED Dashboard, the successor to the contrib-ui module, should follow by the end of next week’

I suspect that once released, further development, new widgets. charts, graphs etc, should follow swiftly.

Paul

1 Like
(Paul Reed) split this topic #7

4 posts were split to a new topic: Updating node-red

(Paul Reed) #8

Just found the below tweet from Lawrence Griffiths who has been developing a node-red ui dashboard for a boiler project.

There’s a lot of potential here…

Paul

4 Likes
(Paul Reed) #9

The official node-red-dashboard was pushed to npm late last night, and is now available to npm install (needs node-red v14.x).
If you have node-red-contrib-ui installed, don’t forget to uninstall it first, before installing node-red-dashboards

Paul

(Jon Murphy) #10

Paul - I haven’t found the node-red v14.x via apt-get. Have you found it?

I may be searching the wrong way:

[email protected]:~ $ apt-cache policy nodered
nodered:
  Installed: 0.13.4-1
  Candidate: 0.13.4-1
  Version table:
 *** 0.13.4-1 0
        500 http://archive.raspberrypi.org/debian/ jessie/main armhf Packages
        100 /var/lib/dpkg/status
[email protected]:~ $ 

PS - I think you are missing the “ui” in node-red-contrib-ui

(Philippe O.) #11

If you weren’t using contrib-ui or you are on a clean install:

Install

Run the following command in your Node-RED user directory (typically ~/.node-red):

npm install node-red-dashboard

Open your Node-RED instance and you should have UI nodes available in the palette and a new dashboard tab in right side panel.
The UI interface is available at http://localhost:1880/ui (if default Node-RED settings are used).

Reference: https://github.com/node-red/node-red-dashboard

1 Like
(Philippe O.) #12

rpi-rw
sudo apt-get update
sudo apt-get upgrade

Did you try this?

(Paul Reed) #13

Well, in short, I got fed up of waiting for the Rasbian team to update their repo, so I installed it via npm which immediately gave me v14. Also, for some reason node.js doesn’t seem to be getting updated either, as the Jessie version is v0.10.x whilst the current version is v4.4.7 so I updated that too.

To check the installed node.js version;
nodejs -v

To update node.js and also switch to the npm installed node-red version on a Pi2 (assuming you’ve already removed node-red-contrib-ui), firstly remove existing versions.

sudo apt-get remove nodejs nodejs-legacy```
NOTE - this doesn't remove your .node-red directory, and all flows, settings etc should remain intact.

Install node.js;
```curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -
sudo apt-get install -y build-essential python-rpi.gpio nodejs```

...and node-red;
```sudo npm cache clean
sudo npm install -g --unsafe-perm  node-red```

Then install node-red-dashboard via the link shared by Philipp above.

Reference - http://nodered.org/docs/hardware/raspberrypi#upgrading

Paul
2 Likes
(Dave) #14

I updated NodeRED on my emonpi by the apt-get update and apt-get upgrade

Regards
Dave

(bart.ellast) #15

It seems the raspbian team have indeed finally updated to 0.14.
Took them quite a while.

(Paul Reed) #16

There are a number of improvements with the new node-red-dashboard over the ‘contrib’ version, including;

  • 2 switcheable themes - light or dark
  • 4 different gauge options - gauge, donut, compass & level
    (The ‘level’ option is an animated display!)
  • Variable width/depth panels
  • Angular filters can be applied to the dashboard nodes
  • More node configuration options

Plus lots more, with promises of more to come.

Here’s a screenshot of the ‘dark theme’ from my ipad.

Paul

5 Likes
(Jon Murphy) #17

@Paul - I finally bit the bullet and did the upgrade. BUT it didn’t go as well as expected. Ugh! Node-RED does not start on a reboot.

I tried:

  • starting node-red via the command prompt and everything seems to be fine with node-red.
  • sudo service nodered restart and I get “Failed to restart nodered.service: Unit nodered.service failed to load: No such file or directory.”
  • sudo systemctl enable nodered.service (the old way) and I get “Failed to execute operation: No such file or directory”

So my questions is - what is it that causes node-red to start? I am guessing it is something service runner based but I cannot locate it!

(Jon Murphy) #18

Found it! The nodered.service file was missing from the /lib/systemd/system directory. I grabbed a copy from a full backup then did:

sudo systemctl enable nodered.service
sudo service nodered start

Now I need to find what sudo systemctl enable … does and why my nodered.service disappeared!

(Paul Reed) #19

Following removal of the apt-get version & installation of the npm version, I just ran it by node-red-start and it it has run fine since, surviving a number of reboots, and I didn’t have to re-enable the service, which surprised me, because I assumed that it would have been disabled automatically after removing the original node-red version.
(sudo systemctl enable nodered.service instructs systemd to enable Node-RED to run automatically at every boot and upon crashes.)

The link which I provided above;

…has a section on ‘autostart’ and provides all of the necessary scripts to re-install the node-red systemd autostart, if needed.

Paul

(Jon Murphy) #20

Paul - I finally got everything updated and running with node-red v0.14.6, npm and node.js! :joy:

And I’ve installed node-red-dashboard. I had not downloaded or used node-red-contrib-ui.

I’ve created lots of simple example flows trying to get an understanding of the node-red dashboard.


 

I downloaded the node-red flow example from the 2nd post (above) and I am having problems getting things to work. It looks like it was written for the node-red-contrib-ui.

Can you post your updated node-red-dashboard flow?

Thank you for your help! Jon