reptilex / tesla-style-solar-power-card

Home assistant power card mimicking the one tesla provides for the powerwall app.
211 stars 59 forks source link

Recommended Method for Adding Additional Tesla Powerwall Sensors as Extra Entities to Match Tesla App Data in Card? #109

Closed ziptbm closed 2 years ago

ziptbm commented 2 years ago

I've got this card up and running well, but I believe there's a better way to create sensors in Home Assistant that match the data points available in the Tesla app. The default sensors from the Powerwall integration show you current usage (NOW) and ongoing totals for import and export, but those are NOT specific to TODAY only. What's the recommended method to create sensors that show the current day totals of imported or exported energy from one of the Tesla Powerwall integration sensors?

For example, I'd like the top number on the solar icon in the card to show the running total of solar produced TODAY only. This would show me how much has been produced and what the current production is in a quick glance. Then I'd like to do the same for the grid icon (total grid usage TODAY) and home icon (total home usage TODAY), and have those values match what's available in the Telsa app. And I'd also like to see how much energy has been given back to the grid, but I don't have a good place to put this in the card...yet.

Here's what I just added to my config, but I haven't had enough time to see if it's going to do what I'm expecting.

utility_meter:
  solar_production_daily:
    source: sensor.powerwall_solar_export
    cycle: daily
  site_energy_usage_daily:
    source: sensor.powerwall_site_import
    cycle: daily
  site_energy_export_daily:
    source: sensor.powerwall_site_export
    cycle: daily
  load_energy_import_daily:
    source: sensor.powerwall_load_import
    cycle: daily

Upon reboot, the solar_production_daily & site_energy_usage_daily were "paused" and do not show kWh for unit of measure, but the other two immediately began counting and had the correct units.

Any recommendations here?

Here's what I've got now: Screenshot 2022-03-26 222052

reptilex commented 2 years ago

You need to create templates that change the values and then render them into the card. See templating docs in HA or ask the forums

purcell-lab commented 2 years ago

@ziptbm , please find a working solution for powerwall, including grid2batter & battery2grid here: https://github.com/reptilex/tesla-style-solar-power-card/issues/99#issuecomment-1106022793