-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #28 - Fix issue where empty config dictionary causes null reference exceptions. (#38) * #2 - Started adding and building documentation. * #4 - Added example docker compose * Added a single line on each script to comment script's purpose. * Updated the readme. * updated readme.
- Loading branch information
1 parent
92e9761
commit f1ef45f
Showing
16 changed files
with
597 additions
and
203 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## This represents the minimum amount of configuration options needed for a working service. | ||
|
||
Mqtt: | ||
Connection: | ||
Host: "your-mqtt-broker-ip-or-hostname" | ||
Port: 1883 | ||
Credentials: | ||
Username: "admin" | ||
Password: "password" | ||
|
||
PDU: | ||
Connection: | ||
Host: your-pdu-ip-or-hostname | ||
Port: 80 | ||
|
||
HomeAssistant: | ||
DiscoveryEnabled: true | ||
DiscoveryTopic: "homeassistant" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Mqtt: | ||
Connection: | ||
Host: "192.168.1.1" # Update to the IP of your MQTT broker. | ||
Port: 1883 | ||
Credentials: | ||
Username: "admin" | ||
Password: "password" | ||
|
||
ParentTopic: "Rack_PDU" | ||
|
||
PDU: | ||
Connection: | ||
Host: 192.168.1.2 # Update to the IP of your PDU. | ||
Port: 80 | ||
|
||
PollInterval: 5 | ||
Overrides: | ||
PDU: | ||
Name: "Your PDU" | ||
|
||
Devices: | ||
YOUR-SERIAL-NUMBER: | ||
ID: your_pdu | ||
Name: MY PDU | ||
Enabled: true | ||
|
||
|
||
Measurements: | ||
# I override the names, to give a more usable display name. | ||
# Also- I change the ID, to be a bit shorter for power. | ||
apparentPower: | ||
Name: Apparent Power | ||
realPower: | ||
ID: power | ||
Name: Power | ||
energy: | ||
Name: Energy | ||
powerFactor: | ||
Name: Power Factor | ||
current: | ||
Name: Current | ||
voltage: | ||
Name: Voltage | ||
# I recommend leaving these disabled, unless you have a use-case for them. | ||
currentCrestFactor: | ||
Enabled: false | ||
balance: | ||
Enabled: false | ||
|
||
HomeAssistant: | ||
DiscoveryEnabled: true | ||
DiscoveryTopic: "homeassistant" | ||
|
||
# Short discovery interval is used for testing. | ||
DiscoveryInterval: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Deploying `rpdu2mqtt` with Docker Compose | ||
|
||
This guide will help you deploy the `rpdu2mqtt` service using Docker Compose. | ||
|
||
## Prerequisites | ||
|
||
Before you begin, ensure you have the following installed on your system: | ||
|
||
- [Docker](https://docs.docker.com/get-docker/) | ||
- [Docker Compose](https://docs.docker.com/compose/install/) | ||
|
||
## Step 1: Prepare the Configuration File | ||
|
||
Create a `config.yaml` file that will be used to configure the `rpdu2mqtt` service. This file should contain your specific configuration settings. | ||
|
||
For help on setting up `config.yaml`, please see [Configuration Documentation](./../../docs/Configuration.md) | ||
|
||
```bash | ||
touch config.yaml | ||
``` | ||
|
||
Populate the `config.yaml` file with your desired configuration settings. | ||
|
||
## Step 2: Create the Docker Compose File | ||
|
||
Create a `docker-compose.yml`. | ||
|
||
See [docker-compose.yaml](./docker-compose.yaml) | ||
|
||
This file defines the Docker service and specifies the necessary security and resource constraints. | ||
|
||
## Step 3: Deploy the Service | ||
|
||
Navigate to the directory containing your `docker-compose.yml` and `config.yaml` files, then deploy the service using Docker Compose: | ||
|
||
```bash | ||
docker-compose up -d | ||
``` | ||
|
||
This command will download the required Docker image and start the `rpdu2mqtt` service in detached mode. | ||
|
||
## Step 4: Verify the Deployment | ||
|
||
To ensure the service is running correctly, use the following command: | ||
|
||
```bash | ||
docker-compose ps | ||
``` | ||
|
||
This will show the status of the `rpdu2mqtt` container. | ||
|
||
You can also view the logs to check for any errors or important information: | ||
|
||
```bash | ||
docker-compose logs -f | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: '3.8' | ||
|
||
services: | ||
rpdu2mqtt: | ||
image: ghcr.io/xtremeownage/rpdu2mqtt:main | ||
container_name: rpdu2mqtt | ||
volumes: | ||
- ./config.yaml:/config/config.yaml:ro | ||
restart: unless-stopped |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# This is just a simple helper script to open a bash-prompt to the container running rpdu2mqtt. | ||
|
||
ns="rpdu2mqtt" | ||
kubectl exec -it -n $ns $(kubectl get pod -n $ns -l role=app -o jsonpath='{.items[0].metadata.name}') -- $1 | ||
|
Oops, something went wrong.