Skip to main content

You personal assistant

Project description

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

Project details


Release history Release notifications | RSS feed

This version

1.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

energybot-1.1-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file energybot-1.1-py3-none-any.whl.

File metadata

  • Download URL: energybot-1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for energybot-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 37fa3737d8919d4bfe9532d86ae6f1746a4ee7577692dc284669cfad4c9d8ed5
MD5 521231188aa851cda7c71ef20f320a2e
BLAKE2b-256 e3bd57714a82077718628f100f8a90b3d597f8e49b4469e1e7083cd205ec9fa9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page