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:
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:
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
1
2
3
service: shell_command.push_pv_surplus
data:
surplus: "{{ states('sensor.power_production_changeme') }}"
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_AUTODETECTto
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
Your remote controller node can send push notifications using Telegram Bots. To set it up, follow these steps:
/newbotto Telegram's @BotFather by following these instructions and note down the displayed token.
TELEGRAM_TOKENand
TELEGRAM_CHAT_IDenvironment variables and restart your node.
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'
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.
Check out chargebot.io's source code repository at GitHub.