Skip to content

Instantly share code, notes, and snippets.

@LanceMcCarthy
Created August 8, 2021 15:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LanceMcCarthy/b1cd52e0fbfa7013e0e8d067c54db7a0 to your computer and use it in GitHub Desktop.
Save LanceMcCarthy/b1cd52e0fbfa7013e0e8d067c54db7a0 to your computer and use it in GitHub Desktop.
Tesla Powerwall Energy Sensor Template for HomeAssistant
# This template reports three values to Home Assistant through: grid_import, grid_export and solar_production sensors
- platform: template
sensors:
grid_import:
value_template: "{{state_attr('sensor.powerwall_site_now', 'energy_exported_(in_kW)')}}"
unit_of_measurement: kWh
device_class: energy
attribute_templates:
last_reset: "1970-01-01T00:00:00+00:00"
state_class: "measurement"
grid_export:
value_template: "{{state_attr('sensor.powerwall_load_now', 'energy_imported_(in_kW)')}}"
unit_of_measurement: kWh
device_class: energy
attribute_templates:
last_reset: "1970-01-01T00:00:00+00:00"
state_class: "measurement"
solar_production:
value_template: "{{state_attr('sensor.powerwall_solar_now', 'energy_exported_(in_kW)')}}"
unit_of_measurement: kWh
device_class: energy
attribute_templates:
last_reset: "1970-01-01T00:00:00+00:00"
state_class: "measurement"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment