How-to: Batrium (SW2_14) / Node-red / Grafana @RasPi

Announcement - Help us fight the BOTS! Please report all spam including stuff in your inbox!


New member
Aug 20, 2021
Hello community
Cause I've been searching a while for a noob-like-me instruction without success, I wanted to share my steps how to get a working raspi (using a PI3+) from scratch:

I started with this image:
and copied it to a SD card using
after copying don't forget to create a ssh.txt file on the SD-card, so that putty will work :)

use putty and the IP given by your router to log in via ssh

Install grafana:
sudo apt-get install -y apt-transport-https && sudo apt-get install -y software-properties-common wget && wget -q -O - | sudo apt-key add - && echo "deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list && sudo apt-get update && sudo apt-get install grafana-enterprise && sudo service grafana-server start && sudo systemctl start grafana-server && sudo systemctl enable grafana-server && sudo grafana-cli plugins install grafana-clock-panel

Install influx:
sudo apt-get install influxdb && sudo service influxdb start && sudo apt install influxdb-client && sudo systemctl enable --now influxdb
start influx
create database batrium
create user batrium with password 'batrium'
grant all on batrium to batrium

install node-red:
sudo apt install build-essential git curl && bash <(curl -sL --nodered-version="1.3.5" --node14
sudo systemctl enable nodered.service
sudo systemctl enable nodered
sudo systemctl start nodered
cd /home/pi/.node-red
npm install binary-parser
start node-red once
and close it after starting => thats how the settings.js is cretaed intially

edit /home/pi/.node-red/settings.js and add after the following line: "functionGlobalContext:" => binary_parser:require('binary-parser').Parser
sudo nano /home/pi/.node-red/settings.js
so it will look like that
functionGlobalContext: {
// os:require('os'),
// jfive:require("johnny-five"),
// j5board:require("johnny-five").Board({repl:false})
reboot PI and hopefully all services will start
sudo reboot

Go to node-red page => <your.pi.ip:1880>
Add the following nodes via "manage palette"
import the red node flow attached here (unzipped of course). This is modified to fit to newer batrium firmware (2.14) based on UPD-listener source code by daromer.
you can debug some messges while klicking on the outer edge of the green payload nodes
=> now you influxdb should be fed by node red :->

open grafana (1st pw must be changed) => <your.pi.ip:3000>
click on tile "add you 1st data source"
choose influx
Name: Batrium
Database: batrium
user & pw = empty (no need)
save & test => all green => good to go :)

Add the UI:
Dashboard => manage => Import >= upload JSON file => use the file attached here (unzipped of course)
(one open issue is left => status of shunt is not shown, but not that vital 2me:)
OK, guys, thats how I managed to get it running. Hope that helps you as you helped me.
Big thanks to daromer, wolf and this awesome community !


    22 KB · Views: 40
    4.3 KB · Views: 34