[PROJECT] Driver for Connecting to Your Tesla Devices

Great will try them and post logs soon.

Parent Logs

dev:7052020-05-23 01:47:31.757 am debugTesla Powerwall - Connected to Tesla for Powerwalls.

dev:7052020-05-23 01:47:31.101 am debugTesla Powerwall - Connected to Tesla for Site Info.

dev:7052020-05-23 01:47:31.082 am debugTesla Powerwall - Connected to Tesla for Aggregate.

dev:7052020-05-23 01:47:31.078 am debugTesla Powerwall - Connected to Tesla for Grid Status.

dev:7052020-05-23 01:47:31.063 am debugTesla Powerwall - Connected to Tesla for System Status.

dev:7052020-05-23 01:47:31.045 am debugTesla Powerwall - Device data = {"max_site_meter_power_kW":1000000000,"min_site_meter_power_kW":-1000000000,"nominal_system_energy_kWh":13.5,"nominal_system_power_kW":10,"max_system_energy_kWh":0,"max_system_power_kW":0,"site_name":"Home Energy Gateway","timezone":"America/Los_Angeles","grid_code":"60Hz_240V_s_UL1741SA:2019_California","grid_voltage_setting":240,"grid_freq_setting":60,"grid_phase_setting":"Split","country":"United States","state":"California","distributor":"*","utility":"Pacific Gas and Electric Company","retailer":"Silicon Valley Clean Energy (SVCE)","region":"UL1741SA-CA:2019"}

dev:7052020-05-23 01:47:31.010 am debugTesla Powerwall - Connected to Tesla for Registration.

dev:7052020-05-23 01:47:31.008 am debugTesla Powerwall - Connected to Tesla for Sitemaster.

Child Logs

dev:7382020-05-23 01:45:47.570 am tracePowerwall SERIALNUMBER - State: grid_state = Grid_Uncompliant

dev:7382020-05-23 01:45:47.544 am tracePowerwall SERIALNUMBER - State: Device Type = AC Powerwall

dev:7382020-05-23 01:45:47.518 am tracePowerwall SERIALNUMBER - State: bc_type =

dev:7382020-05-23 01:45:47.456 am tracePowerwall SERIALNUMBER - State: PackagePartNumber = 1092170-53-J

dev:7382020-05-23 01:45:47.432 am tracePowerwall SERIALNUMBER - State: under_phase_detection = false

dev:7382020-05-23 01:45:47.406 am tracePowerwall SERIALNUMBER - State: updating = false

dev:7382020-05-23 01:45:47.381 am tracePowerwall SERIALNUMBER - State: Type =

dev:7382020-05-23 01:45:47.354 am tracePowerwall SERIALNUMBER - State: grid_reconnection_time_seconds = 0

dev:7382020-05-23 01:45:41.437 am infoPowerwall SERIALNUMBER - State variables cleared

dev:7382020-05-23 01:45:24.469 am tracePowerwall SERIALNUMBER - State: Device Type = AC Powerwall

I would not worry about child logs really.

I've been recalled from home automation projects this morning by SWMBO to attend to some home organization projects...so I'll have a look at this sometime this PM. Have a couple of the new Jasco Zigbee outlets to install too, so lots of fun to be had for sure!

S.

I snuck some time in to confirm it works nicely again now.

Couple of observations, and I expect this is a limitation of how Tesla presents the data.

The Nominal System Energy (kWh): data is the capacity of 1 battery. I'm not sure why, but 2 batteries should be 27 kWh.

Nominal System energy also appears to be some sort of Static Value, and would appear to be the Max that my inverter can handle. (10kWh), even though my nominal system power is somwhere around 18 * 315 Watts (5.7kW).

Interestingly, the app also gives forward and reverse power (from grid, from panels, to grid and to load/house. Seems like that data ought to be hiding someplace in the stuff you're able to see. Not sure if it is, but it seems like it should be.

Working great. I have a nice dashboard set up showing the attributes from the Powerwall system. Very cool.

S.

I will take a look at what I can find... The numbers are what the device sends back, but maybe I can find ways to tweak that.

1 Like

Either of you running into any issues lately?

If possible... could either/both of you set your Parent device to Debug logging, and capture a refresh for me? I want to see if there is still anything missing and see if I can narrow down some way to identify things like the combined battery capacity and such. If you want to PM them to me (to help make sure Serial #s do not get into public view) that is fine.

Mine has been running smoothly, no issues at all.

I'll run a refresh!

Scott

@snell any luck being able to pull the current house draw or current incoming flow from solar?

I think those are possible. I will check tonight.

1 Like

everything seems to be working smoothly for me for the last few days running 0.2.4 and 0.1.3

dev:7052020-05-27 12:35:03.907 pm debugTesla Powerwall - Connected to Tesla for Powerwalls.

dev:7052020-05-27 12:35:01.655 pm debugTesla Powerwall - Connected to Tesla for Site Info.

dev:7052020-05-27 12:35:01.651 pm debugTesla Powerwall - Connected to Tesla for System Status.

dev:7052020-05-27 12:35:01.600 pm debugTesla Powerwall - Connected to Tesla for Sitemaster.

dev:7052020-05-27 12:35:01.584 pm debugTesla Powerwall - Device data = {"max_site_meter_power_kW":1000000000,"min_site_meter_power_kW":-1000000000,"nominal_system_energy_kWh":13.5,"nominal_system_power_kW":10,"max_system_energy_kWh":0,"max_system_power_kW":0,"site_name":"Home Energy Gateway","timezone":"America/Los_Angeles","grid_code":"60Hz_240V_s_UL1741SA:2019_California","grid_voltage_setting":240,"grid_freq_setting":60,"grid_phase_setting":"Split","country":"United States","state":"California","distributor":"*","utility":"Pacific Gas and Electric Company","retailer":"Silicon Valley Clean Energy (SVCE)","region":"UL1741SA-CA:2019"}

dev:7052020-05-27 12:35:01.475 pm debugTesla Powerwall - Connected to Tesla for Aggregate.

dev:7052020-05-27 12:35:01.408 pm debugTesla Powerwall - Connected to Tesla for Grid Status.

dev:7052020-05-27 12:35:01.405 pm debugTesla Powerwall - Connected to Tesla for Registration.

dev:7052020-05-27 12:35:00.616 pm debugTesla Powerwall - Connected to Tesla for Powerwalls.

dev:7052020-05-27 12:34:59.660 pm debugTesla Powerwall - Connected to Tesla for System Status.

dev:7052020-05-27 12:34:59.606 pm debugTesla Powerwall - Connected to Tesla for Site Info.

dev:7052020-05-27 12:34:59.603 pm debugTesla Powerwall - Connected to Tesla for Aggregate.

dev:7052020-05-27 12:34:59.539 pm debugTesla Powerwall - Device data = {"max_site_meter_power_kW":1000000000,"min_site_meter_power_kW":-1000000000,"nominal_system_energy_kWh":13.5,"nominal_system_power_kW":10,"max_system_energy_kWh":0,"max_system_power_kW":0,"site_name":"Home Energy Gateway","timezone":"America/Los_Angeles","grid_code":"60Hz_240V_s_UL1741SA:2019_California","grid_voltage_setting":240,"grid_freq_setting":60,"grid_phase_setting":"Split","country":"United States","state":"California","distributor":"*","utility":"Pacific Gas and Electric Company","retailer":"Silicon Valley Clean Energy (SVCE)","region":"UL1741SA-CA:2019"}

dev:7052020-05-27 12:34:59.410 pm debugTesla Powerwall - Connected to Tesla for Registration.

dev:7052020-05-27 12:34:59.407 pm debugTesla Powerwall - Connected to Tesla for Sitemaster.

dev:7052020-05-27 12:34:59.383 pm debugTesla Powerwall - Connected to Tesla for Grid Status.

--- Live Log Started, waiting for events ---

Version 0.2.5 is now posted for the TeslaDriver. Minor changes trying to narrow down that frustrating Device data (the initial logging I added before does not appear in the latest data from Jared for some reason).

Still working on the best way to determine system totals. At this point it looks like it will be counting the number of Powerwalls and then just multiplying the nominal values since I am not finding an overall total. Or even separate % levels per battery for some reason...

1 Like

15 mind to bedtime! Seems like a great time to load a new driver! Woo! Here we go!

S.

Loaded perfectly. Just sent you a data dump in a PM.

Noted that it thinks I'm not getting grid power, even though its dark out. Tesla really makes this data strange. Lol

S.

Will load it in a sec, but just wanted to say that even with the Tesla software I can’t access charge levels of individual batteries, I assume the gateway obfuscates this, so I wouldn’t bother spending too much time searching for that. Who knows how Tesla chooses to optimize charging. I don’t have a use for it anyway. Grid in/out and solar in/out I would want to visualize on a dashboard.

1 Like

Good point.

S.

The link at the top of the thread still says 0.2.4 did you update the url, or not change the version number in the code?

Just double checked, version 0.2.5 is posted. If you use the link, your browser might bring up the cached version. Instead, I recommend going into the Driver Code window for it and select Import. That will always bring in the latest published version.

Version 0.3.0 is now posted!

Reworked the way aggregate data is handled so it will add a lot of attributes and events (we can remove the events if you find no use for most of them). But with Instant Power being displayed by Site, Battery, Solar, or Load now you can track the power usage at that moment by area.

I also added 3 status attributes that are booleans:
Grid Being Used
Powerwall(s) Charging
Solar Generating Power

Hopefully these changes help make it all more useful.

Somthing might be wrong,

I'm in debug and the long logs generated are

dev:7052020-05-28 05:00:22.356 pm debugTesla Powerwall - Driver version up to date

dev:7052020-05-28 05:00:21.824 pm infoTesla Powerwall - Updated

dev:7052020-05-28 05:00:21.810 pm debugTesla Powerwall - Refresh rate: 1 minute

--- Live Log Started, waiting for events ---

current system state is :

the main driver shows this

Solar is being generated, but because we're in "high time of use" power billing rate, the solar that is being generated is going to the grid and I'm using my cheap stored power.

So solar should be a string maybe? (Not Generating/Sending to Grid/Sending to Powerwall)

Certainly works and is recovering more items as said. But like @jared.zimmerman I'm still seeing the grid Being used as false, even though in my house, I only pull from the battery when the Grid is down.

There's something odd in how Tesla is dumping that data, as it also reports my battery as charging, which it it doesn't do off the grid (its night here) unless we're under storm watch, which we presently are not.

But no errors!

Thanks @snell!

S.