I’d be impressed if you guess the right parameter name in a few minutes. I’ve had no luck “guessing” the parameter name to retrieve historical battery percent charged values from the `calendar_history` endpoint. The known `kind`s for this endpoint are:
Code:
/api/1/energy_sites/{site_id}/calendar_history?kind=power
/api/1/energy_sites/{site_id}/calendar_history?kind=energy
/api/1/energy_sites/{site_id}/calendar_history?kind=self_consumption
/api/1/energy_sites/{site_id}/calendar_history?kind=time_of_use_energy
/api/1/energy_sites/{site_id}/calendar_history?kind=savings
I‘ve tried kind=battery_percent, kind=battery_charge, kind=percentage_charged etc none work so far. You quickly realise that there so many possible names they could have called this that it’s throwing darts in the dark to
guess the right parameter name. The odds are close to zero!
Yeah I’ve tried that too. The Tesla App uses SSL Certificate Pinning to verify it is talking to
owner-api.teslamotors.com and not some intermediate server
pretending to be
owner-api.teslamotors.com, so it’s not possible as far as I know to sniff the commands it sends. Otherwise this would be trivial to solve.
Having vehicle-PW2 integration has been on Tesla’s ‘to do’ list for a couple of years. It’s within the realms of possibility that 2021.36 will pave the way for Tesla to build charging from excess solar into their App (saving you the need to roll your own
). There’s no need for v3 HPWCs either, Tesla talks directly to the PW2 and vehicle to work out what to do.
You’re in Sydney, who’s giving you negative FITs? You still potentially have an issue with this if your PW2 is full and your car is full and your house is using what it can. You’d need an additional script to turn your inverter off in that situation, and turn it back on again when you can use the power.