Help

How to get started?
  1. Create an account at chargebot.io.
  2. Link your Tesla Account with chargebot.io and note down:
    • Your Tesla Token
    • Your chargebot.io Token and Token Password
  3. Set up your chargebot.io remote controller node using a docker-compose.yml file for Docker Compose:
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 services: node: image: ghcr.io/virtualzone/chargebot:latest restart: always ports: - 8080:8080 environment: TESLA_REFRESH_TOKEN: 'initial-tesla-refresh-token' DB_FILE: '/data/chargbeot.db' PORT: '8080' TOKEN: 'your-chargebot.io-token' PASSWORD: 'your-chargebot-io-token-password' CRYPT_KEY: 'a-32-bytes-long-random-key' volumes: - db:/data volumes: data:
  4. Run using: docker compose up -d
  5. Access the web frontend at: http://localhost:8080
How does chargebot.io know about my solar surplus?

You'll need a home automation solution (such as Home Assistant, ioBroker or OpenHAB) or some other kind of scripting at your end which regularly pushes the available surplus to chargebot.io.

Example for Home Assistant:

  1. Make sure Home Assistant knows about your surplus. This can i.e. be done by using a Shelly 3EM or a Tibber Pulse, which are integrated with your Home Assistant installation.
  2. Create a new shell command in your Home Assistant's
    configuration.yaml
    :
    1 2 3 shell_command: push_pv_surplus: > curl --header 'Content-Type: application/json' --data '"surplus_watts": {{surplus}}}' http://localhost:8080/api/1/user/surplus
  3. Restart Home Assistant.
  4. In Home Assistant, navigate to 'Settings' > 'Automations & scenes' > 'Automations'.
  5. Create a new automation:
    • When (trigger): Time (i.e. every 5 minutes: Hours = *, Minutes = /5)
    • Then do (action): Call service 'Shell Command: push_pv_surplus' with data:
      1 2 3 service: shell_command.push_pv_surplus data: surplus: "{{ states('sensor.power_production_changeme') }}"
How does chargebot.io know whether my Tesla is plugged in or not?

By default, chargebot.io tries to auto-detect your vehicle's plugged state. This is done by evaluating data provided via Tesla's Fleet Telemetry service. However, the relevant data provided by Fleet Telemetry is not as accurate as desirable (see this issue).

If you prefer to have more accurate information about your vehicle's plugged state, you can use the following webhooks after setting the environment variable

PLUG_AUTODETECT
to
0
:

When your vehicle got plugged in at your home charger:

curl --header 'Content-Type: application/json' -X POST http://localhost:8080/api/1/user/{{VIN}}/plugged_in

When your vehicle got unplugged from your home charger:

curl --header 'Content-Type: application/json' -X POST http://localhost:8080/api/1/user/{{VIN}}/unplugged
How can I receive push notifications?

Your remote controller node can send push notifications using Telegram Bots. To set it up, follow these steps:

  1. Create a bot by sending
    /newbot
    to Telegram's @BotFather by following these instructions and note down the displayed token.
  2. Find out your Telegram User ID by i.e. sending any message to the GetIDs bot.
  3. Set the
    TELEGRAM_TOKEN
    and
    TELEGRAM_CHAT_ID
    environment variables and restart your node.
Can I connect chargebot.io to MQTT?

Yes, as an alternative to informing your chargebot.io node via HTTP push about your surplus, you can subscribe to an MQTT topic.

Configure your MQTT connecting by setting the following environment variables:

environment: MQTT_BROKER: 'tcp://localhost:1883' MQTT_CLIENT_ID: 'chargebot' MQTT_USERNAME: 'mqtt-username' MQTT_PASSWORD: 'mqtt-password' MQTT_TOPIC_SURPLUS: 'topic/surplus'
How can I add authentication to my chargebot.io node's web interface?

The remote controller node does not have a built-in authentication mechanism.

When authentication is required (i.e. when exposing the web interface to the internet), please use HTTP basic authentication on a reverse proxy in front of the node, or use a solution such as Authelia.

How can I contribute?

Check out chargebot.io's source code repository at GitHub.