-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.toml.example
More file actions
49 lines (40 loc) · 1.74 KB
/
config.toml.example
File metadata and controls
49 lines (40 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Web3 Pi UPS Service Configuration
# Copy this file to /etc/w3p-ups/config.toml and adjust as needed
[serial]
# Serial port configuration
# Use "auto" to automatically detect Web3_Pi_UPS device (recommended)
# Or specify a path like "/dev/ttyACM0" to use a specific port
port = "auto"
# Baud rate for serial communication
baud_rate = 115200
[battery]
# Battery SOC (State of Charge) percentage below which shutdown is triggered
# Shutdown only occurs when BOTH conditions are met:
# 1. SOC is below this threshold
# 2. Input voltage indicates we're running on battery (vi < min_valid_voltage)
shutdown_threshold = 10
# Minimum input voltage (in mV) to consider grid power as connected
# Values 8000-21000 typically indicate grid power is present
# Below this value, the system is considered to be running on battery
min_valid_voltage = 8000
# Maximum valid input voltage (in mV)
# Above this value, the reading is considered invalid (sensor error)
max_valid_voltage = 26000
# Margin above shutdown_threshold required to cancel a pending shutdown
# Prevents flapping when battery is near threshold
# Default: 5 (shutdown at 10%, cancel at 15%)
shutdown_cancel_margin = 5
[shutdown]
# Path to the shutdown script that will be executed
# This script should handle graceful shutdown of your services
script_path = "/etc/w3p-ups/shutdown.sh"
# Delay in seconds before executing shutdown after low battery is detected
# This gives time for power to potentially be restored
# If power is restored during this period, shutdown is cancelled
delay_seconds = 30
[logging]
# Log level: trace, debug, info, warn, error
level = "info"
# Optional path for file logging (in addition to journald)
# Leave empty or comment out to log only to journald
# file_path = "/var/log/w3p-ups.log"