summaryrefslogtreecommitdiff
path: root/doc/inverter_bot.md
blob: c9b299cf2e284e45c5e5c8f13b83cb15613f6a29 (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
# 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

[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
monstatus - Monitor: dump state
monsetcur - Monitor: set charging currents
```