Nicedevil's Starting Questions

Have you set After a number of message parts to 4 and selected and every subsequent message? Otherwise you will not get all four in one message.

Nope I did it with every 1 message because I want to track the actual consumption.

If this is working I could than start with delays to only measure once every 10 seconds f.e.

but I guess I know what you want me to teach. If only 1 payload is sent to the function it couldn't sum up, because it don't have the other payloads right? In this case, the join node doesn't make sense

ok did it with the 4 now and it is working as you thought before but I had to learn :slight_smile:

As long as you have the subsequent message flag set then you will get a message out for every one in (after the first four). Try it as I have suggested and you will see what I mean. The function you posted won't work otherwise, as it will only have one value at a time.

anyway it won't work with the function and the way I did it. The numbers in the long topic after msg.payload isn't accepted by this :frowning:

Ok I think I fixed the function that way, that there are no more red crosses.
But the function trys to send a string instead of a value. It doesn't matter if I put "" around sum?

var pc1 = 0
var pc2 = 0
var pc3 = 0
var pc4 = 0
var sum = 0

pc1 = msg.payload["shellies/shellyplug-s-7A123A/relay/0/power"];
pc2 = msg.payload["shellies/shellyplug-s-7AE5F5/relay/0/power"];
pc3 = msg.payload["shellies/shellyplug-s-79B4E2/relay/0/power"];
pc4 = msg.payload["shellies/shellyplug-s-041A1D/relay/0/power"];
sum = pc1 + pc2 + pc3 + pc4
return sum;

msg.payload = sum
return msg

Could that be simplyfied to;

var pc1 = msg.payload["shellies/shellyplug-s-7A123A/relay/0/power"];
var pc2 = msg.payload["shellies/shellyplug-s-7AE5F5/relay/0/power"];
var pc3 = msg.payload["shellies/shellyplug-s-79B4E2/relay/0/power"];
var pc4 = msg.payload["shellies/shellyplug-s-041A1D/relay/0/power"];
msg.payload = (pc1 + pc2 + pc3 + pc4);
return msg
1 Like

it could :smiley: but now I get something like this


2.97 | 138.51 | 106.60 | 0.00 in one line because it is a string.

So I have to convert those strings into values first...

Here we go :slight_smile:

var pc1 = parseFloat(msg.payload["shellies/shellyplug-s-7A123A/relay/0/power"]);
var pc2 = parseFloat(msg.payload["shellies/shellyplug-s-7AE5F5/relay/0/power"]);
var pc3 = parseFloat(msg.payload["shellies/shellyplug-s-79B4E2/relay/0/power"]);
var pc4 = parseFloat(msg.payload["shellies/shellyplug-s-041A1D/relay/0/power"]);
msg.payload = (pc1 + pc2 + pc3 + pc4);
return msg

results into this:



@Colin you got any recipe for making scheduling possible for these power switches via dashboard?

If you search for "schedule" on you will find many hits. Which one is best for you depends on what you want to do.
In general if you have a new question it is better to start a new thread on the forum so those who may have an interest in the subject will see it. Have a look at the flows first though.

1 Like

Thank you so much :slight_smile:

Mhhh I notice a huge lag after deploying my flow/flows. The Dashboard is sometimes not loading and I can see the refreshbutton is fast switching with the abort button in firefox.

Does this behaviour belongs to wrong programmed flows or maybe just too low CPU/RAM power in the machine?

Also I found some timer nodes but no flow how to get a good looking dashboard to programm them.
One of all is Bigtimer but I can't tell me girlfriend that she has to go inside the backend of nodered to programm the times there instead of just clicking on the dashboard.

I just want to make it simple as this one here from the original gui of my shelly plug s:

You may have already considered this...
but, what sort of deploy are you doing; Full, Modified Flows, or Modified Nodes?
You really only to deploy Modified Nodes or even Modified Flows.
Doing a full deploy takes time as it deploys everything in your flows and not just the items added or changed.


This shouldn't really cause the refresh button to flicker, but to check what's going on why not use the browser's development console (F12) and have a look at 'Network' tab. There you should be able to see what, if any, issues are causing the delay.

I've just had a quick look at node-red-contrib-eztimer which allows you to pass in time settings via msg inputs.
So you could possibly create a nice graphical interface in the dashboard, and feed that into the timer node.
I haven't used the node - it's just a suggestion.

1 Like

Shameless plug...

Scroll down that thread to near the end where latest features are listed.

You can feed multiple Cron and date lists into this node. It is 100% flexible. You even get human friendly times like "in 2 hours, 4 minutes and 27 seconds".

It is perfectly possible to create individual and repeating schedules dynamically, via a dashboard.

Hope it helps.

Ps, the built in help has full instructions and the node had built in example flows (import menu)


Hey Paul,

mhhh maybe I described my problem a little bit wrong.

After the deployment is done (it is not that much) I get nothing on my dashboard.

Like this... just nothing except the tab name.
Then I wait and wait and wait... also after an hour or so I can take a new look at the Dashboard and same here... sometimes the refresh button starts to flicker and sometimes it brings up the dashboard at any certain time

The network tab doesn't show anything that is not working for my opinion.
What I found is:

You are using the ngTouch module. 
AngularJS Material already has mobile click, tap, and swipe support... 
ngTouch is not supported with AngularJS Material! app.min.js:148:303
Rendered successfully. app.min.js:532:12831
CSS for generated in 174ms app.min.js:532:12831
Less has finished. CSS generated in 174ms app.min.js:532:12831
Rendered successfully. app.min.js:532:12831
CSS for generated in 42ms app.min.js:532:12831
Less has finished. CSS generated in 42ms app.min.js:532:12831
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to for more info.
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: , _f: false, _strict: undefined, _locale: [object Object]
Source-Map-Fehler: request failed with status 404

That is on the console tab of firefox.

thank you for that :slight_smile: will take a further look.

As you might read, I'm realy new to node-red and I'm happy with my first understandings in how a function node works and how to code them (realy similar to arduino IDE so far) right.

Dashboard itself is a thing I only know how to use with prebuilt nodes for now. If I have to code something by myself it starts a realy huge new topic to me :smiley: Dunno where to start f.e.

But I will try <3 tomorrow 2 more Shellys will arrive!

I see you are getting a 404 error - Source-Map-Error?

I saw that as well but again... dunno how to debug this :smiley:

source map 404s are not breaking usually. They are there to ease debugging most of all, as they allow to puzzle the source back to un-minified code. The lack of presence does not break the page itself, as it won't rely on the source maps. When a source map is referenced through a comment in the minified file, the browser will try to load it to allow debugging capabilities in the developer tab, but it missing won't cause the dashboard page itself to stop working. So for debugging what caused this problem, you can skip diving into the source map debacle.