summaryrefslogtreecommitdiff
path: root/doc/inverter_bot.md
blob: 973fcf5dbf89bef1192fa0bee6290b05d0f9fc44 (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Inverter Bot

### Bot configuration

**`~/.config/inverter_bot/config.toml`**:

```toml
[bot]
token = "..."
users = [ 1, 2, 3 ]
notify_users = [ 1, 2 ]

[inverter]
host = "127.0.0.1"
port = 8305

[ac_mode.generator]
thresholds = [51, 58]
initial_current = 2

[ac_mode.utilities]
thresholds = [48, 54]
initial_current = 40

[monitor]
vlow = 47
vcrit = 45

gen_currents = [2, 10, 20, 30]
gen_raise_intervals = [
    180, # 3 minutes for 2 A, then
    120, # 2 more minutes for 10 A, then
    120, # 3 more minutes for 20 A, then, finally, 30 A 
]
gen_cur30_v_limit = 56.9
gen_cur20_v_limit = 56.7
gen_cur10_v_limit = 54

gen_floating_v = 54
gen_floating_time_max = 7200

[logging]
verbose = false

[api]
token = "..."
```

### systemd integration

**`/etc/systemd/system/inverter_bot.service`**:

```systemd
[Unit]
Description=inverter bot
After=inverterd.service

[Service]
User=user
Group=user
Restart=on-failure
ExecStart=/home/user/home/bin/inverter_bot
WorkingDirectory=/home/user

[Install]
WantedBy=multi-user.target
```


### Commands
```
lang - Set language
status - Show status
config - Show configuration
errors - Show errors
flags - Toggle flags
calcw - Calculate daily watts usage 
calcwadv - Advanced watts usage calculator
setbatuv - Set battery under voltage
setgencc - Set AC charging current
setgenct - Set AC charging thresholds
setacmode - Set AC input mode
setosp - Set output source priority
monstatus - Monitor: dump state
monsetcur - Monitor: set charging currents
```