Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pvtom committed Dec 17, 2023
1 parent 7761090 commit 89bbf20
Show file tree
Hide file tree
Showing 9 changed files with 3,628 additions and 192 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: docker

on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to Github Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
32 changes: 32 additions & 0 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Docker

A Docker image is available at https://hub.docker.com/r/pvtom/rscp2mqtt-dashboard

### Start the docker container

```
sudo docker run --rm -e MQTT_BROKER=localhost -e MQTT_PORT=1883 -p:1880:1880 pvtom/rscp2mqtt-dashboard:latest
```

Please adjust the MQTT broker and the port. Parameters can be set with the -e argument.

### Configuration

These parameters are available to configure MQTT settings:

- MQTT_BROKER
- MQTT_PORT
- MQTT_CLIENT_ID
- MQTT_USER
- MQTT_PASSWORD
- TOPIC_PREFIX

Value ranges can be adjusted with the following parameters:

- MAX_SOLAR_POWER
- MAX_HOME_POWER
- MAX_GRID_POWER
- MAX_BATTERY_POWER
- MAX_STRING_POWER
- MAX_PHASE_POWER
- MAX_BATTERY_RESERVE
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM nodered/node-red

RUN npm install node-red-contrib-aggregator node-red-dashboard

COPY prepare.sh .
COPY settings.js /data/settings.js
COPY flows.json.template /data/flows.json

RUN sed -i '/#!\/bin\/bash/a source prepare.sh /data/flows.json' entrypoint.sh
67 changes: 57 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,71 @@
# Dashboard for displaying the values of an E3/DC S10 home power station
# Dashboard for an E3/DC Home Power Station
[![GitHub sourcecode](https://img.shields.io/badge/Source-GitHub-green)](https://github.com/pvtom/rscp2mqtt-dashboard/)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/pvtom/rscp2mqtt-dashboard)](https://github.com/pvtom/rscp2mqtt-dashboard/releases/latest)
[![GitHub last commit](https://img.shields.io/github/last-commit/pvtom/rscp2mqtt-dashboard)](https://github.com/pvtom/rscp2mqtt-dashboard/commits)
[![GitHub issues](https://img.shields.io/github/issues/pvtom/rscp2mqtt-dashboard)](https://github.com/pvtom/rscp2mqtt-dashboard/issues)
[![GitHub pull requests](https://img.shields.io/github/issues-pr/pvtom/rscp2mqtt-dashboard)](https://github.com/pvtom/rscp2mqtt-dashboard/pulls)
[![GitHub](https://img.shields.io/github/license/pvtom/rscp2mqtt-dashboard)](https://github.com/pvtom/rscp2mqtt-dashboard/blob/main/LICENSE)

Based on Node-RED this dashboard was realized. It displays the data of the house power plant that the tool RSCP2MQTT publishes via the MQTT broker.
The dashboard visualizes data from a home power station by subscribing to MQTT topics published by [rscp2mqtt](https://github.com/pvtom/rscp2mqtt).

![Dashboard](dashboard.png)

## Docker

Instead of installing the package, you can simply use an existing [Docker image](DOCKER.md).

## Prerequisites

- a running rscp2mqtt instance (https://github.com/pvtom/rscp2mqtt)
- a running rscp2mqtt instance (https://github.com/pvtom/rscp2mqtt), v3.8 or higher
- an existing MQTT broker
- an installation of Node-RED (https://nodered.org)
including the modules "node-red-dashboard" and "node-red-contrib-aggregator"
including the modules "node-red-dashboard" and "node-red-contrib-aggregator" or
- a Docker environment on your system

## Installation
## Installation of the package

Please follow the installation steps on the Node-RED homepage.

Import the dashboard.flow
## Load the flow

Import the file dashboard_flow.json, adjust the broker settings in one of the mqtt nodes and deploy the changes

or

set the parameters as environment variables and start the prepare script (i.e. with bash):

```
export MQTT_BROKER="localhost"
export TOPIC_PREFIX="e3dc"
cp -a flows.json.template flows.json
./prepare.sh flows.json
```

afterwards import flows.json into NODE-RED.

These parameters are available to configure MQTT settings:

- MQTT_BROKER
- MQTT_PORT
- MQTT_CLIENT_ID
- MQTT_USER
- MQTT_PASSWORD
- TOPIC_PREFIX

Value ranges can be adjusted with the following parameters:

- MAX_SOLAR_POWER
- MAX_HOME_POWER
- MAX_GRID_POWER
- MAX_BATTERY_POWER
- MAX_STRING_POWER
- MAX_PHASE_POWER
- MAX_BATTERY_RESERVE

Adjust the settings in the mqtt in and out nodes.
## Access the dashboard

Deploy the changes and press the inject button of the "init" node to load the data.
The data in the charts will be populated over the next 24 hours.
The dashboard will be accessible at http://<your_node_red_host>:1880/ui

Dashboard URL: http://<your_node_red_host>:1880/ui/
The chart data is collected over the next 24 hours.
Binary file modified dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 89bbf20

Please sign in to comment.