datMaffin / homebridge-tesla-powerwall

Homebridge Plugin for the Tesla Powerwall
ISC License
21 stars 11 forks source link
homebridge homebridge-plugin powerwall tesla tesla-powerwall

homebridge-tesla-powerwall

npm npm

(Unofficial) Homebridge Plugin for the Tesla Powerwall.

Communication with the Tesla Powerwall is according to https://github.com/vloschiavo/powerwall2 .

This Plugin is considered to be complete. If you encounter a bug or want to propose a new feature, feel free to open an issue!

If you like this plugin, it is possible to donate a "cup of coffee" via Paypal:

Donate

Installation

  1. Install Homebridge: see the Homebridge wiki
  2. In the Homebridge Web-GUI, search for the "Tesla Powerwall" plugin and install it.
  3. Adapt the config.json using the config view; add this plugin as a "platform" to your config.json file.

Legacy Installation Instructions

  1. Install Homebridge: sudo npm install -g --unsafe-perm homebridge
  2. Install this plugin sudo npm install -g homebridge-tesla-powerwall
  3. Add this plugin as a platform to your config.json file

Configuration

Inside config.json of Homebridge:

...
    "platforms": [
        {

Mandatory:

            "platform": "TeslaPowerwall",
            "name": "Tesla Powerwall",
            "ip": "111.222.111.222",
            "password": "abc123",

Optional:

            "port": "",
            "username": "customer",
            "email": "Lt.Dan@bubbagump.com",
            "loginInterval": 39600000,
            "pollingInterval": 15000,
            "historyInterval": 300000,
            "lowBattery": 20,
            "additionalServices": {
                "powerwall": {
                    "homekitVisual": true,
                    "eveHistory": true,
                    "batteryIsLowSwitch": false,
                    "batteryIsChargingSwitch": false,
                    "makeOnOffSwitchReadOnly": true
                },
                "solar": {
                    "homekitVisual": true,
                    "evePowerMeter": true,
                    "eveHistory": true,
                    "eveLineGraph": false,
                    "pullingFromSensor": false,
                    "sensorThreshold": 0
                },
                "grid": {
                    "homekitVisual": true,
                    "positiveEvePowerMeter": true,
                    "negativeEvePowerMeter": true,
                    "eveHistory": true,
                    "eveLineGraph": false,
                    "feedingToSensor": false,
                    "pullingFromSensor": false,
                    "sensorThreshold": 0
                },
                "battery": {
                    "homekitVisual": true,
                    "positiveEvePowerMeter": true,
                    "negativeEvePowerMeter": true,
                    "eveHistory": true,
                    "eveLineGraph": false,
                    "feedingToSensor": false,
                    "pullingFromSensor": false,
                    "sensorThreshold": 0
                },
                "home": {
                    "homekitVisual": true,
                    "evePowerMeter": true,
                    "eveHistory": true,
                    "eveLineGraph": false,
                    "feedingToSensor": false,
                    "sensorThreshold": 0
                },
                "gridstatus": {
                    "gridIsDownSwitch": false,
                    "gridIsUpSwitch": false,
                    "gridIsNotYetInSyncSwitch": false,
                    "gridIsDownSensor": false,
                    "gridIsUpSensor": false
                }
            }
        },
    ...
    other platforms
    ...
    ]
...

History Configuration

From: Fakegato project

No persistence (The Elgato-Eve App will still save received measurements):

File-System persistence:

            "historySetting": {

Mandatory:

                "storage": "fs",

Optional:

                "size": 4032,
                "path": "/place/to/store/my/persistence/"
            }

Google Drive persistence:

            "historySetting": {

Mandatory:

                "storage": "googleDrive",

Optional:

                "size": 4032,
                "folder": "fakegato",
                "keyPath": "/place/to/store/my/keys/"
            }

For the setup of Google Drive, please follow the Google Drive Quickstart for Node.js instructions from https://developers.google.com/drive/v3/web/quickstart/nodejs, except for these changes:

Example Configuration

Minimal Configuration

...
        {
            "platform": "TeslaPowerwall",
            "name": "Tesla Powerwall",
            "ip": "192.168.178.100",
            "password": "abc123",
            "pollingInterval": 10000,
            "historyInterval": 120000,
            "lowBattery": 10,
            "historySetting": {
                "storage": "fs"
            }

        }
...

When using Eve.app

...
        {
            "platform": "TeslaPowerwall",
            "name": "Tesla Powerwall",
            "ip": "192.168.178.100",
            "password": "abc123",
            "additionalServices": {
                "powerwall": {
                    "homekitVisual": false
                },
                "solar": {
                    "homekitVisual": false
                },
                "grid": {
                    "homekitVisual": false
                },
                "battery": {
                    "homekitVisual": false
                },
                "home": {
                    "homekitVisual": false
                }
            }
        }
...

Using only Home.app supported services (minimal)

...
        {
            "platform": "TeslaPowerwall",
            "name": "Tesla Powerwall",
            "ip": "192.168.178.100",
            "password": "abc123",
            "additionalServices": {
                "powerwall": {
                    "homekitVisual": false,
                    "eveHistory": false
                },
                "solar": {
                    "homekitVisual": false,
                    "evePowerMeter": false,
                    "eveHistory": false
                },
                "grid": {
                    "homekitVisual": false,
                    "positiveEvePowerMeter": false,
                    "negativeEvePowerMeter": false,
                    "eveHistory": false
                },
                "battery": {
                    "homekitVisual": false,
                    "positiveEvePowerMeter": false,
                    "negativeEvePowerMeter": false,
                    "eveHistory": false
                },
                "home": {
                    "homekitVisual": false,
                    "evePowerMeter": false,
                    "eveHistory": false
                }
            }
        }
...

Using only Home.app supported services (all the visualization services)

...
        {
            "platform": "TeslaPowerwall",
            "name": "Tesla Powerwall",
            "ip": "192.168.178.100",
            "password": "abc123",
            "additionalServices": {
                "powerwall": {
                    "eveHistory": false
                },
                "solar": {
                    "evePowerMeter": false,
                    "eveHistory": false
                },
                "grid": {
                    "positiveEvePowerMeter": false,
                    "negativeEvePowerMeter": false,
                    "eveHistory": false
                },
                "battery": {
                    "positiveEvePowerMeter": false,
                    "negativeEvePowerMeter": false,
                    "eveHistory": false
                },
                "home": {
                    "evePowerMeter": false,
                    "eveHistory": false
                }
            }
        }
...

FAQ

I get a login error

If you get a login error similar to:

[4/16/2021, 6:56:52 PM] [Powerwall] error: null
[4/16/2021, 6:56:52 PM] [Powerwall] status code: 403
[4/16/2021, 6:56:52 PM] [Powerwall] body: {"code":403,"error":"Unable to GET to resource","message":"User does not have adequate access rights"}

Plugin stopped working after the Powerwall upgraded to version 20.49.0

Upgrade to the latest update of this plugin and make sure the password field is added (see documentation above).

The username field should, at the moment, have a value equal to the default, i.e., it must be equal to "customer".

Plugin behaves not as it should and the Powerwall version is lower than 20.49.0

Try to use the last 1.x.y version "1.1.0", i.e., sudo npm install -g homebridge-tesla-powerwall@1.1.0.

Feature request / Bug found?

You are welcome to create an Issue.