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

grafik

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:

grafik

2 Likes

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

If you search for "schedule" on flows.nodered.org 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.

deploy

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)

2 Likes

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 http://10.0.4.4:1880/ui/css/app.min.less successfully. app.min.js:532:12831
CSS for http://10.0.4.4:1880/ui/css/app.min.less generated in 174ms app.min.js:532:12831
Less has finished. CSS generated in 174ms app.min.js:532:12831
Rendered http://10.0.4.4:1880/ui/css/app.min.less successfully. app.min.js:532:12831
CSS for http://10.0.4.4:1880/ui/css/app.min.less 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 http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments: 
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: , _f: false, _strict: undefined, _locale: [object Object]
t/<@http://10.0.4.4:1880/ui/js/app.min.js:538:3368
va@http://10.0.4.4:1880/ui/js/app.min.js:538:21539
Sa@http://10.0.4.4:1880/ui/js/app.min.js:538:22250
Ha@http://10.0.4.4:1880/ui/js/app.min.js:538:22332
l@http://10.0.4.4:1880/ui/js/app.min.js:538:209
parseTime@http://10.0.4.4:1880/ui/js/app.min.js:552:15693
determineDataLimits/<@http://10.0.4.4:1880/ui/js/app.min.js:552:9480
[26]</e.exports/o.each@http://10.0.4.4:1880/ui/js/app.min.js:550:6904
determineDataLimits@http://10.0.4.4:1880/ui/js/app.min.js:552:9435
update@http://10.0.4.4:1880/ui/js/app.min.js:550:31028
n@http://10.0.4.4:1880/ui/js/app.min.js:550:21924
[26]</e.exports/o.each@http://10.0.4.4:1880/ui/js/app.min.js:550:6904
update@http://10.0.4.4:1880/ui/js/app.min.js:550:23200
updateLayout@http://10.0.4.4:1880/ui/js/app.min.js:549:28292
initialize@http://10.0.4.4:1880/ui/js/app.min.js:549:26812
[23]</e.exports/t.Controller@http://10.0.4.4:1880/ui/js/app.min.js:549:26599
t@http://10.0.4.4:1880/ui/js/app.min.js:550:20683
o@http://10.0.4.4:1880/ui/js/app.min.js:562:957
i@http://10.0.4.4:1880/ui/js/app.min.js:562:4317
$digest@http://10.0.4.4:1880/ui/js/app.min.js:172:469
$apply@http://10.0.4.4:1880/ui/js/app.min.js:176:35
f/r<@http://10.0.4.4:1880/ui/js/app.min.js:190:388
Tg/this.completeTask@http://10.0.4.4:1880/ui/js/app.min.js:187:15
Ag/h.defer/d<@http://10.0.4.4:1880/ui/js/app.min.js:73:3
app.min.js:538:2962
Source-Map-Fehler: request failed with status 404
Ressourcen-Adresse: http://10.0.4.4:1880/ui/js/app.min.js
Source-Map-Adresse: angular-chart.min.js.map

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.