Edit (9/3/2021): Much of what I described in my original post was done on Home Assistant 2019.8. The 2019.9 release improved things dramatically and made my PowerWall setup way more plug and play. There’s been a lot of discussion here since the 2019.9 release, so I figured I’d bring this post up-to-date
TL;DR: Make sure you’re on 2019.9 or newer when working with the Tesla Integration
Here’s what I did after upgrading to Home Assistant 2019.9
- Grid Consumption: Powerwall Site Import
- Return to grid: Powerwall Site Export
- Solar Production: Powerwall Solar Export
-
Home Battery Storage:
- Energy going in to the battery (kWh): Powerwall Battery Import
- Energy coming out of the battery (kWh): Powerwall Battery Export
I was relieved to come back and see that @shanelord had set up his energy dashboard nearly exactly the same way and was seeing good results but had also set up the Power Load Export as an individual device, which I might be interested to check out!
So far, I’ve had pretty good results. Here’s a screenshot of my dashboard the day after my upgrade. There’s a gap (from 1:00 AM to 7:00 AM) on the graph because the integration needed me to re-authenticate to the Tesla Energy Gateway. I assume that the huge spike for 7:00AM was actually spread throughout that gap.
I’m trying to sort out why the CO2 Signal isn’t able to calculate the non-fossil energy consumption, I assume they’re not able to poll that data for my home. I may wind up just disabling it.
Altogether, I’m pretty excited about both releases. But especially excited at how much easier 2019.9 was to get working!
Here’s what I did back when I was using Home Assistant 2019.8:
I’m trying to get the Energy Dashboard setup to use the information that’s being polled by the Powerwall Integration.
Here’s some details:
- HA Supervisor (supervisor-2021.06.8) and HA Core (core-2021.8.8) are both up-to-date with the latest versions.
- Tesla Solar (11.2kW) and 3x Powerwall v2
- Batteries’ inclusion on the Energy Dashboard is in a future release.
I created new sensors in my configuration.yaml:
sensor:
- platform: template
sensors:
grid_return_kw:
friendly_name: "Grid Return (kW)"
device_class: power
unit_of_measurement: kW
value_template: "{{ states('sensor.powerwall_site_now') | float | min(0) | abs | round(4) }}"
grid_consumption_kw:
friendly_name: "Grid Consumption (kW)"
device_class: power
unit_of_measurement: kW
value_template: "{{ states('sensor.powerwall_site_now') | float | max(0) | round(4) }}"
powerwall_charging_kw:
friendly_name: "Powerwall Charging (kW)"
device_class: power
unit_of_measurement: kW
value_template: "{{ states('sensor.powerwall_battery_now') | float | min(0) | abs | round(4) }}"
powerwall_discharging_kw:
friendly_name: "Powerwall Discharging (kW)"
device_class: power
unit_of_measurement: kW
value_template: "{{ states('sensor.powerwall_battery_now') | float | max(0) | round(4) }}"
- platform: integration
source: sensor.powerwall_solar_now
name: energy_solar
- platform: integration
name: energy_totalConsumption
source: sensor.powerwall_load_now
- platform: integration
name: energy_grid_consumption
source: sensor.grid_consumption_kw
- platform: integration
name: energy_grid_return
source: sensor.grid_return_kw
- platform: integration
source: sensor.powerwall_charging_kw
name: energy_powerwall_charging
- platform: integration
source: sensor.powerwall_discharging_kw
name: energy_powerwall_discharging
I’ve set up the Energy Dashboard using
- Grid Consumption: energy_grid_consumption
- Return to grid: energy_grid_return
- Solar Production: energy_solar
My electric plan charges and buys back at a static rate, so I used the static price option for both–but I’m not too concerned about tracking costs, yet.
After waiting a few hours and looking at the dashboard, I have a few questions:
Q: Did I do a good job?
A: TBD
Q: Are the totals in the Energy Distribution today card cumulative for the entire day?
A: I think so.
Q: Do I need to create two different sensors for grid consumption and return to grid? If so, can anyone offer pointers on how to do conditional logic to determine that?
A: I think the answer to this is yes. I’ve created a few template sensors to split up the battery for charging and discharging. I’ve also split up the grid for consumption from and returning to the grid. Those seem to be working well
Q: Is there anything that I haven’t done yet that other Tesla Power customers and/or energy enthusiasts would suggest?
A: reply down below!
I’d take a screenshot of my Energy Dashboard, but I’ve tried so many different things the past 24 hours, it’s a bit of a mess and I don’t trust it!
Edit (8/27 11:21AM CDT):: I tinkered a bit last night, since there’s no replies yet–I figured I’d update this with the current state.