This plugin makes it possible to use the TeslaSolarCharger together with a Tesla Powerwall. All values required by the TeslaSolarCharger can be retrieved via this plugin.
Add the following lines to the docker-compose.yml
file of Teslasolarcharger:
pwplugin:
image: jbuchner/pwplugin:latest
restart: always
environment:
- POWERWALL=<Host or IP>
- USER_EMAIL=<Email>
- USER_PASSWORD=<Password>
- TZ=<TZ>
ports:
- 8081:80
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
Replace the variables <Host or IP>
, <Email>
, <Password>
and <TZ>
with the appropriate values for your Powerwall.
Note: <Email>
and <Password>
are not the credentials for your Tesla account (which you use in your car and your app), but different credentials for your Powerwall.
As value for TZ use the appropriate TZ identifier from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. For example, use the value Europe/Berlin
for Germany.
Use
docker compose up -d
to start the containers.
You can check the installation by entering the following URL in your Browser:
If the TeslaSolarCharger is running on a different computer, you will have to modify the URL accordingly.
The plugin should return the SoC of your Powerwall in this form:
{"raw_soc":30,"adjusted_soc":27}
Open the base configuration of your Teslasolarcharger and configure the following endpoints.
Source |
|
Grid Power Url |
|
Result type |
|
Grid Power Json Pattern |
|
Grid Power Correction Factor |
|
Source |
|
Home Battery Soc Url |
|
Result Type |
|
Home Battery Soc Json Pattern |
|
Home Battery Soc Correction Factor |
|
Home Battery Minimum Soc |
See documentation of TeslaSolarCharger |
Home Battery Power Url |
|
Result Type |
|
Home Battery Power Json Pattern |
|
Home Battery Power Correction Factor |
|
Home Battery Goal charging power |
See documentation of TeslaSolarCharger |
Source |
|
Inverter Power Url |
|
Result type |
|
Inverter Power Json Pattern |
|
Inverter Power Correction Factor |
|
The Tesla API provides values for the state of charge that differ from the state of charge displayed in the app. When the app displays the value 0%, the API returns the value 5%.
The endpoint /soc
provides both the state of charge provided by the API ($.raw_soc
) and an adjusted value that corresponds approximately to the value displayed in the app ($.adjusted_soc
).
If you want to use the value provided by the API, you have to adjust the configuration as follows:
Home Battery Soc Json Pattern |
|