Skip to content

Commit

Permalink
V0.2.2 (#39)
Browse files Browse the repository at this point in the history
* #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
XtremeOwnageDotCom authored Sep 2, 2024
1 parent 92e9761 commit f1ef45f
Show file tree
Hide file tree
Showing 16 changed files with 597 additions and 203 deletions.
File renamed without changes.
18 changes: 18 additions & 0 deletions Examples/Configuration/minimum-configuration-example.yaml
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"
55 changes: 55 additions & 0 deletions Examples/Configuration/recommended-configuration.yaml
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
56 changes: 56 additions & 0 deletions Examples/Docker-Compose/README.md
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
```
9 changes: 9 additions & 0 deletions Examples/Docker-Compose/docker-compose.yaml
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
145 changes: 0 additions & 145 deletions Examples/Kubernetes/configuration.yaml

This file was deleted.

49 changes: 0 additions & 49 deletions Examples/Kubernetes/deployment.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions Examples/Kubernetes/exec
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

Loading

0 comments on commit f1ef45f

Please sign in to comment.