This guide will walk you through the configuration options available for this service. The configuration file, typically named config.yaml
, should be properly set up before deploying the service.
To connect to your MQTT broker, you can optionally specify a username and password.
If- your MQTT broker requires authentication, you will be required to provide a username and password.
Mqtt:
Credentials:
Username: "user" # Replace with your MQTT username
Password: "password" # Replace with your MQTT password
This defines the parent topic under which all MQTT keys will be published.
Mqtt:
ParentTopic: "rpdu2mqtt" # Customize this to your desired parent topic
This sets the client ID that the service will use when connecting to the MQTT broker.
Mqtt:
ClientID: "rpdu2mqtt" # Customize as needed
This defines the keep-alive interval (in seconds) for the MQTT connection.
Mqtt:
KeepAlive: 60 # Adjust as necessary
Configure the connection to your MQTT broker:
Mqtt:
Connection:
Host: "localhost" # Replace with your MQTT broker's IP or hostname
Port: 1883 # Replace with the MQTT broker's port number
Timeout: 15 # Connection timeout in seconds
ValidateCertificate: true # Set to false if you're using self-signed certificates
Set up the connection details to your Power Distribution Unit (PDU).
Pdu:
Connection:
Scheme: http # http or https, based on your PDU's configuration
Host: "localhost" # Replace with your PDU's IP or hostname
Port: 80 # Replace with your PDU's port number
Timeout: 15 # Request timeout in seconds
ValidateCertificate: true # Set to false if using self-signed certificates
Provide credentials if required to connect to the PDU.
Pdu:
Credentials:
Username: "actionsUser" # Replace with your PDU username
Password: "actionsPass" # Replace with your PDU password
Set how often the PDU sensors should be polled and published to MQTT (in seconds).
Pdu:
PollInterval: 5 # Adjust the polling interval as needed
Enable or disable the ability to perform write-actions on the PDU (e.g., toggling switches).
Pdu:
ActionsEnabled: true # Set to false to disable any changes on the PDU
This section allows you to override generated entity_id
, names, and enabled/disabled states for various objects.
For all override sections, Name can be updated at anytime. Home assistant will reflect the updated names after the next discovery job runs.
ID fields, are only used when the device/entity is initially created. Changing this after the entity has been created will have no effect.
All fields, are optional.
Override details about the PDU itself.
Overrides:
PDU:
ID: null # Leave as null unless you have a specific ID
Name: "Your-PDU" # Customize the PDU name
Override details regarding devices exposed by the PDU using their serial numbers.
Each PDU can expose multiple devices. The outlets, sensors, etc will belong to one of these devices within Home Assistant.
Overrides:
Devices:
A0AE260C851900C3: # Replace this with the serial number from your device. You can get this from the info tab.
ID: null # Leave as null unless you have a specific ID
Name: "Device Name" # Customize the device name
Enabled: true # Set to false to disable this device.
Customize individual outlets by their number.
Overrides:
Outlets:
1:
ID: kube02 # Customize the outlet ID
Name: "Proxmox: Kube02" # Customize the outlet name
Enabled: true # Set to false to disable this outlet
Customize how metrics are sent to services. The entity ID used for metrics is [DEVICE_ID]_[METRIC_TYPE]
.
Example, say, you have a device named kube02
. The measurements will be named kube02_power
Overrides:
Measurements:
apparentPower:
ID: null # Leave as null unless you have a specific ID
Name: "Apparent Power" # Human-readable name for this metric
Enabled: true # Set to false to disable this metric
realPower:
ID: power # Customize the ID if needed
Name: "Power" # Human-readable name for this metric
Enabled: true # Set to false to disable this metric
Enable automatic discovery of the PDU and its entities in Home Assistant.
HomeAssistant:
DiscoveryEnabled: true # Set to false if you do not want Home Assistant discovery
DiscoveryTopic: "homeassistant/discovery" # Customize the discovery topic
DiscoveryInterval: 300 # Interval (in seconds) between discovery messages
SensorExpireAfterSeconds: 300 # Time after which sensors are marked as unavailable
Use these settings when debugging or requiring additional data.
You- typically should never need to touch, or change any settings here.
Debug:
PrintDiscovery: false # Set to true to print discovery messages to the console
PublishMessages: true # Set to false to test the program without sending messages
Customize how messages are logged to the console (stdout).
Logging:
Console:
Enabled: true # Set to false to disable console logging
Severity: Information # Minimum severity of messages to log
Format: "[{Timestamp:HH:mm:ss} {Level}] {Message:lj}{NewLine}{Exception}" # Customize the log format
Configure logging to a file.
Logging:
File:
Enabled: false # Set to true to enable file logging
Severity: Debug # Minimum severity of messages to log
Format: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}" # Customize the log format
Path: null # Specify the log file path
FileRollover: Day # Set the frequency of log file rollover (e.g., Day, Month)
FileRetention: 30 # Number of rolled over logs to retain
Here- are a few example configuration files.
This, represents the absolute minimum amount of configuration needed for functionality.
This configuration changes the names, and default IDs for a few measurements.
This file, represents all of the currently documented configuration settings which can be changed.