Skip to content

jbuchner/pwgateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Powerwall plugin for TeslaSolarCharger

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.

Configuring the Docker image

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}

Configure Teslasolarcharger

Open the base configuration of your Teslasolarcharger and configure the following endpoints.

Grid power

Source

REST

Grid Power Url

http://pwplugin/aggregates

Result type

JSON

Grid Power Json Pattern

$.site

Grid Power Correction Factor

-1

Home Battery

Source

REST

Home Battery Soc

Home Battery Soc Url

http://pwplugin/soc

Result Type

JSON

Home Battery Soc Json Pattern

$.adjusted_soc

Home Battery Soc Correction Factor

1

Home Battery Minimum Soc

See documentation of TeslaSolarCharger

Home Battery Power

Home Battery Power Url

http://pwplugin/aggregates

Result Type

JSON

Home Battery Power Json Pattern

$.battery

Home Battery Power Correction Factor

-1

Home Battery Goal charging power

See documentation of TeslaSolarCharger

Inverter

Source

REST

Inverter Power Url

http://pwplugin/aggregates

Result type

JSON

Inverter Power Json Pattern

$.solar

Inverter Power Correction Factor

1

Adjusted and unadjusted state of charge

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

$.raw_soc

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published