Tesla / SolarCity Solar

I would love to see a SolarCity / Tesla Solar integration to understand when my home is producing solar energy. I can trigger many electrical automations based on this information, as well as better estimate my energy bills for off-solar use.

Anyone else have success with this?

Be sure to request api access from Tesla. Now that Solar City has transitioned over to Tesla, they need to make it accessible. The fact that this is available in their cars and batteries makes me hopeful they will for their solar box. Right now I think the only option would be a web scrapper, or sniff for the zigbee traffic from their control box.

Tesla connect all their products, i would be super suprised if they pump out solar systems that arent internet connected.
they have allowed local interrogation in their previous products, they are likely to do the same with solar as they need them to play nicely and optimally together.
its much better to grab solar / power data locally for fast responsive power control. getting it from the tesla API would be too slow to offer granular control.
for example - you can interrogate the powerwall gateway for production import and export.
with this detail the amount of solar you’re producing (from a control standpoint) is essentially irrelevant.
the only important metric is import / export and how much.
you can rattle the json output with RESTful sensor or use the powerwall integration.

Did anyone make any progress on this? I’m in the same boat. I had/have a Solar City setup that was acquired by Tesla. I can see some data on the Tesla Android app. It would be great to get that data into HA. Thanks.

@carealtor and others, I have a working API call to pull realtime and historical Tesla solar in json format (I am also on a legacy SolarCity system). DM me and i’ll share, not too comfortable posting the details publicly.

All,

If you call Tesla, and be very specific, ask the Energy Customer Support to escalate a Tier 2 technical support ticket to get the API for your system. Once you get that, you can do what you need. I just got mine today for my SolarEdge inverter. You may have to ask a couple of times, but they WILL provide it because YOU own the inverter.

HOWEVER be careful to just use the data to monitor. If you screw things up, you void your warranty, and given that most Solar contracts have a 20+ year warranty, it would not be good to screw it up! :slight_smile:

b

1 Like

Circling back around… anyone make any progress on this or have an API call to get data into HA?

1 Like

It’s been a few months again. Any progress on this?

I would really love this. It is great that you can use the Tesla app to accomplish this - but I want it in HA, as someone else suggested, it would be fantastic to setup automations based on solar generation etc.

There already is a Tesla integration with HA, and there is also one for Powerwall… why can’t we have one for folks who have solar (without the power wall)? Maybe this? State And Settings - Tesla API

I’m in the same boat… about to get my Tesla (AKA SolarCity) inverter/panels installed (and I will not have a PowerWall), and I would love to be able to get API access in order to produce awesome graphs and historical information in Home Assistant (and Influx/Grafana, too!).

This sounds somewhat promising, I might give this a try if I can’t reverse engineer the inverter box once it’s hooked up.

I don’t have the Powerwall either. As for reverse engineering, depending on which Tesla solar system you bought, you may or may not have access.

The API is specifically for Solaredge inverters. Calling SolarEdge is useless. I literally had to go to the absolute highest level of Tesla to get the API codes. If you have the solar roof, then I don’t know anything about that.

Hey all,
Not sure if this still works, since SolarCity has transitioned to Tesla. My config itself still works, but you’ll have to test for yourself if the method for getting the API token is still working. Here’s what I did (3-4 years ago!):
mysolarcity.com website used to have a “share my energy usage data” link, where you could share your power generating stats with your friends. When you shared this link, it was showing your real-time and historical data, without the need to authenticate to your account.
What I did was inspect the headers to see what token it was passing the API when that unauthenticated “share” URL was accessed. I theorized, and have so far been right for many years still, that this was a static API token for “sharing”, and would not roll on a regular key rotation schedule. With this, I was using OpenHAB at the time, to pass this auth token in the header, and my install-ID, and it would return my inverter stats on the interval I requested.
I’m not a good developer, by anyone’s imagination :slight_smile: because of that, I do not know if the token I have is actually unique to my account or not, so I wont share it publicly. that’d be dumb. But, that’s the story of how I was able to get the inverter data for my install programatically. I hope understanding how I went about it would lead someone to “aha!” their way to getting it for themselves as well. As far as I can understand it, this method essentially exploits SolarCity / Tesla’s “share my data” API token.

Has anyone looked into adding support for this to the current Tesla integration?

I’m potentially interested in adding support for this given the new support for energy systems in Energy Management in Home Assistant - Home Assistant.

1 Like

You can now pull your Tesla / SolarCity solar data in with the HACS “Tesla Custom Integration”. There’s a trick to it: Since it pulls the “realtime” data, you have to add a custom sensor to tell it to calculate that data (Watts) in to kWh; from there you can give that to HA’s Energy → Solar Panels config, to see your production. Here’s a snip of that custom sensor you’ll need to add, after you get the Tesla Custom Integration working:

sensor:
  - platform: integration
    source: sensor.home_solar_panel # <-- the actual name of your sensor
    name: tesla_solar_panels_kwh
    unit_prefix: k
    unit_time: h
    round: 2
1 Like