Energy bot to work with differents energy providers
- poe
- energy_ua (old-version)
Energy providers configuration
You can add own energy provider
- create energy provider worker in providers folder for example poe.py
- this provider must contains two function:
- get_queue_info() - for get current info about queue
- print_queue_info() for output info about queue to console (for debugging)
- provider must use load_data() and save_data() function for bot working correctly with other modules
- you can use html parce to get info about queue and output this data to dict format like:
specific_datetime = {
'text': 'OFF/ON',
'id':n,
'value': False/True
}
Bot configuration
Create .env file
BOT_TOKEN=token
ADMIN_CHAT_ID=adminid
TIMEOUT=15
TURN_ON_NOTIFY=True
PROVIDER=
PROVIDER_URL=
Run bot as service for pooling
Loggin as root to the VM:
systemctl edit --force --full energybot.service
create this unit:
[Unit]
Description=E-Energy Bot Service
Wants=network.target
After=network.target
[Service]
WorkingDirectory=/opt/e-energy
ExecStartPre=/bin/sleep 1
ExecStart=/opt/e-energy/venv/bin/energybot
Restart=always
[Install]
WantedBy=multi-user.target
Eneable service:
systemctl enable energybot.service
Check status:
systemctl status energybot.service
Start if needed:
systemctl start energybot.service
Run worker to process notification and sync to sync information about energy schedule. Schedule it using cron: crontab -e
*/30 * * * * cd /opt/e-energy/ && venv/bin/energybot --run sync # e-energy sync service
*/15 * * * * cd /opt/e-energy/ && venv/bin/energybot --run worker # e-energy worker service
Metadata
Release files for energybot 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| energybot-1.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / energybot-1.1-py3-none-any.whl
| Download URL | energybot-1.1-py3-none-any.whl |
|---|---|
| Size | 23.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
37fa3737d8919d4bfe9532d86ae6f1746a4ee7577692dc284669cfad4c9d8ed5
|
|
BLAKE2b-256 checksum How to use checksums |
e3bd57714a82077718628f100f8a90b3d597f8e49b4469e1e7083cd205ec9fa9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|