VirtualWolf / powerwall-to-pvoutput-uploader

An application to save power usage information from a Tesla Powerwall 2 and send it to pvoutput.org, and optionally publish to an MQTT broker.
MIT License
8 stars 1 forks source link
monitoring mqtt nodejs powerwall pvoutput solar tesla-powerwall typescript

Overview

This is a TypeScript/PostgreSQL version of Powerwall2PVOutput, written partially for learning and also because I found the SQLite file from that repository kept getting corrupted.

Configuration

Copy the example configuration file .env.example in the root level of the repository to .env and at a minimum fill out all the uncommented variables.

Required settings

To send extended data to PVOutput, you need a PVOutput account with an active donation and the PVOUTPUT_SEND_EXTENDED_DATA environment variable set to true in .env. To set up the extended data, use the following setup on your Edit System page on PVOutput:

Screenshot of the Extended Data settings on PVOutput
Text description of Extended Data settings | Parameter | Label | Unit | Axis | Summary | |--------------|------------------|------|------|----------| | **v7** Line | Battery Flow | W | 0 | W to kWh | | **v8** Line | Home Load | W | 0 | W to kWh | | **v9** Line | Battery Charge | % | 1 | Last | | **v10** Line | Grid Flow | W | 0 | W to kWh | | **v11** Line | Inverter Voltage | V | 0 | None | | **v12** Area | Solar Generation | W | 0 | None |

Optional settings

Publishing to MQTT

The data format that will be send to the given MQTT topic is the same as what's sent to PVOutput:

{
    "timestamp": <number>,
    "solar_generation": <number>,
    "solar_voltage": <number>,
    "home_usage": <number>,
    "home_voltage": <number>,
    "grid_flow": <number>,
    "battery_flow": <number>,
    "battery_charge_percentage": <number>
}

Running