Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Batrium Watchmon4 in Node Red
#11
For anyone using the ISO made by @daromer and wanting to try this you have to disable the Batrium service first because it uses the same listening port.
To do this go to webmin: https://127.0.0.1:10000/ then System and Bootup and Shutdown and make sure the Batrium service is turned off.

Then turn off node-red: with node-red-stop

Then edit the following file so it looks like this: /root/.node-red/settings.js
...
functionGlobalContext: {

  binary_parser:require('binary-parser').Parser
...


EDIT: Then we have to install the module like this:

pi@grafpi /energy-logger/solar-sis/example/PCM60x $ sudo su

root@grafpi:/energy-logger/solar-sis/example/PCM60x# cd /root/.node-red
root@grafpi:~/.node-red/node_modules# npm i binary-parser

Then start up node-red again with: node-red-start

I'm having the same problem as @mbrunton though, i can display all the info except for the bar chart. I'll report back if i can get it working.
Reply
#12
(01-31-2020, 09:21 PM)Bloater Wrote: Anyway - happy to answer questions if I can
Cheers all
Tim

(06-12-2020, 03:09 PM)Cell-King Wrote: I'm having the same problem as @mbrunton though, i can display all the info except for the bar chart. I'll report back if i can get it working.

Great stuff Tim and Cell-King.

Got it working with Cell-Kings info on the settings.js edit.
Changed the color and all is good.



Wolf
For Info Google Drive

Great ABB shunt breaker seller River City Industrial
Great prices and superb service.
 [Image: em2566%20(1)__19172.1521541365.jpg?c=2]

Not your average Wolf       
            Cool
Reply
#13
Hi Wolf, Could you explain how you got the bar chart working in a little bit more detail please? I have seven cells in my pack, I can display the cell voltages but I can't display them on the graph, I'm sending the chart_ui the following array:

msg.payload : array[1]

array[1]
0: object
labels: array[7]
0: "1"
1: "2"
2: "3"
3: "4"
4: "5"
5: "6"
6: "7"
data: array[7]
0: 3.88
1: 3.87
2: 3.88
3: 3.89
4: 3.88
5: 3.88
6: 3.88
series: array[1]
0: "Cells"
Reply
#14
(06-16-2020, 06:19 PM)Cell-King Wrote: Hi Wolf, Could you explain how you got the bar chart working in a little bit more detail please? I have seven cells in my pack, I can display the cell voltages but I can't display them on the graph, I'm sending the chart_ui the following............
Make sure you have the y-axis min and max settings.


If you have the min max settings and it still doesn't work I can send you the flow as I just created the barchart in seconds and it works just fine.

Wolf
For Info Google Drive

Great ABB shunt breaker seller River City Industrial
Great prices and superb service.
 [Image: em2566%20(1)__19172.1521541365.jpg?c=2]

Not your average Wolf       
            Cool
Reply
#15
Thanks for that, yes I have the min and max set as you describe but I still can't get it to work. Does your "Get the set of saved global variables" look like the following?

var ONE = Number(global.get('ONE')) || 0;
var TWO = Number(global.get('TWO')) || 0;
var THREE = Number(global.get('THREE')) || 0;
var FOUR = Number(global.get('FOUR')) || 0;
var FIVE = Number(global.get('FIVE')) || 0;
var SIX = Number(global.get('SIX')) || 0;
var SEVEN = Number(global.get('SEVEN')) || 0;

var m = {};
m.series = ["A", "B", "C"];
m.data = [ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN];
m.labels = [""];
return {payload:[m],topic:msg.topic};

I've been playing around with it so yours might look slightly different. Yes, if you could paste your flow somewhere that would be great.
Reply
#16
Yea mine looks a bit different.
M.label and m.series are not right in yours I believe.

Here you go.

Code:
var ONE = global.get('ONE') || 0;
var TWO = global.get('TWO') || 0;
var THREE = global.get('THREE') || 0;
var FOUR = global.get('FOUR') || 0;
var FIVE = global.get('FIVE') || 0;
var SIX = global.get('SIX') || 0;
var SEVEN = global.get('SEVEN') || 0;




var m = {};
m.labels = ['1', '2', '3', '4', '5', '6', '7'];
m.data = [[ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN]];
m.series = ['Cell'];
return {payload:[m],topic:msg.topic};



Here is the flow

Code:
[{"id":"e7cd0e18.4f55b","type":"function","z":"a60793ee.ec643","name":"7Cell","func":"\nvar ONE = global.get('ONE') || 0;\nvar TWO = global.get('TWO') || 0;\nvar THREE = global.get('THREE') || 0;\nvar FOUR = global.get('FOUR') || 0;\nvar FIVE = global.get('FIVE') || 0;\nvar SIX = global.get('SIX') || 0;\nvar SEVEN = global.get('SEVEN') || 0;\n\n\n\n\nvar m = {};\nm.labels = ['1', '2', '3', '4', '5', '6', '7'];\nm.data = [[ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN]];\nm.series = ['Cell'];\nreturn {payload:[m],topic:msg.topic};","outputs":1,"noerr":0,"x":1180,"y":120,"wires":[["bbffd6bc.05b508"]]}]

Wolf
For Info Google Drive

Great ABB shunt breaker seller River City Industrial
Great prices and superb service.
 [Image: em2566%20(1)__19172.1521541365.jpg?c=2]

Not your average Wolf       
            Cool
Reply
#17
Thanks for that, still no luck. I even copied your function over to my existing flow to see if it was a bug with the existing one. I wonder if it's to do with dependencies somewhere else.
Reply
#18
(06-16-2020, 07:11 PM)Cell-King Wrote: Thanks for that, still no luck. I even copied your function over to my existing flow to see if it was a bug with the existing one. I wonder if it's to do with dependencies somewhere else.
Whats your debug msg.payload look like?




Wolf
For Info Google Drive

Great ABB shunt breaker seller River City Industrial
Great prices and superb service.
 [Image: em2566%20(1)__19172.1521541365.jpg?c=2]

Not your average Wolf       
            Cool
Reply
#19
It seems exactly the same!
Reply
#20
Hmmm.

The only thing I can think of is that there is a conflict with one of the palettes.

Do you have more than one ui_chart installed?


Wolf
For Info Google Drive

Great ABB shunt breaker seller River City Industrial
Great prices and superb service.
 [Image: em2566%20(1)__19172.1521541365.jpg?c=2]

Not your average Wolf       
            Cool
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)