aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-05-08 01:53:47 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-05-16 02:54:29 +0300
commitb804a5d7e7dab93bf6056e8969a5dd4d4c52f452 (patch)
tree582beaf43cd92f65f55f3e4963afff25d927559c /README.md
parenta9f26cf874a74cd3cd90f4185e537609fffdb815 (diff)
migrate from isv to inverterd
Diffstat (limited to 'README.md')
-rw-r--r--README.md43
1 files changed, 25 insertions, 18 deletions
diff --git a/README.md b/README.md
index 9f7f33c..abc44a0 100644
--- a/README.md
+++ b/README.md
@@ -1,33 +1,40 @@
# inverter-bot
-This is a Telegram bot for querying information from an InfiniSolar V family of hybrid solar inverters, in particular
-inverters supported by **isv** utility, which is an older version of **infinisolarctl** from **infinisolar-tools**
-package.
+This is a Telegram bot for querying information from an InfiniSolar V family of hybrid solar inverters.
It supports querying general status, such as battery voltage or power usage, printing amounts of energy generated in
the last days, dumping status or rated information and more.
It requires Python 3.6+ or so.
-## Configuration
+## Requirements
-Configuration is stored in `config.ini` file in `~/.config/inverter-bot`.
+- **`inverterd`** from [inverter-tools](https://github.com/gch1p/inverter-tools)
+- **[`inverterd`](https://pypi.org/project/inverterd/)** python library
+- Python 3.6+ or so
-Config example:
-```
-token=YOUR_TOKEN
-admins=
- 123456 ; admin id
- 000123 ; another admin id
-isv_bin=/path/to/isv
-use_sudo=0
-```
+## Configuration
+
+The bot accepts following parameters:
-Only users in `admins` are allowed to use the bot.
+* ``--token`` — your telegram bot token (required)
+* ``--users-whitelist`` — space-separated list of IDs of users who are allowed
+ to use the bot (required)
+* ``--inverterd-host`` (default is `127.0.0.1`)
+* ``--inverterd-port`` (default is `8305`)
## Launching with systemd
-Create a service file `/etc/systemd/system/inverter-bot.service` with the following content (changing stuff like paths):
+This is tested on Debian 10. Something might differ on other systems.
+
+Create environment configuration file `/etc/default/inverter-bot`:
+```
+TOKEN="YOUR_TOKEN"
+USERS="ID ID ID ..."
+OPTS="" # here you can pass other options such as --inverterd-host
+```
+
+Create systemd service file `/etc/systemd/system/inverter-bot.service` with the following content (changing stuff like paths):
```systemd
[Unit]
@@ -35,10 +42,11 @@ Description=inverter bot
After=network.target
[Service]
+EnvironmentFile=/etc/default/inverter-bot
User=user
Group=user
Restart=on-failure
-ExecStart=python3 /home/user/inverter-bot/main.py
+ExecStart=python3 /home/user/inverter-bot/inverter-bot --token $TOKEN --users-whitelist $USERS $PARAMS
WorkingDirectory=/home/user/inverter-bot
[Install]
@@ -47,7 +55,6 @@ WantedBy=multi-user.target
Then enable and start the service:
```
-systemctl daemon-reload
systemctl enable inverter-bot
systemctl start inverter-bot
```