jasonacox / pypowerwall

Python API for Tesla Powerwall and Solar Power Data
MIT License
132 stars 23 forks source link

PB Updates #2

Closed brianhealey closed 2 years ago

brianhealey commented 2 years ago

This draft PR contains updates to the protocol buffer schema exposed by the tesla powerwall+ (and hopefully others) api's.

These changes are breaking protocol buffer changes, and will require some code to that uses it to be updated.

jasonacox commented 2 years ago

Thank you @brianhealey !

slcasner commented 2 years ago
jasonacox commented 2 years ago

Hi @slcasner - if you run this below, it looks like this is accurate. The ipAddress for the Neurio seems to be "PWRview-" with ShortID suffix. Using the /api/meters API call (not the protobuf /vitals data) you will see the same thing.

import pypowerwall
import json

pw = pypowerwall.Powerwall(host,password,email,timezone)
pw.poll('/api/meters')

Snip of Neurio section:

{
    "serial": "VAHXXXXXXXXXX",
    "short_id": "XXXXX",
    "type": "neurio_w2_tcp",
    "connected": true,
    "cts": [
        {
            "type": "solarRGM",
            "valid": [
                true,
                false,
                false,
                false
            ],
            "inverted": [
                false,
                false,
                false,
                false
            ],
            "real_power_scale_factor": 2
        }
    ],
    "ip_address": "PWRview-XXXXX",
    "mac": "xx-xx-xx-xx-xx-xx"
}

I suspect it is a local lookup name on the Tesla gateway.

slcasner commented 2 years ago

OK, I guess the element names ipAddress and ip_address are just inappropriately chosen, then. To my mind, an IP address (for IPv4) should be a dotted quad numeric value.

[Sorry for the delayed reply, I was traveling.]