Advertisement
Guest User

Untitled

a guest
Jan 6th, 2022
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. sensor:
  2. - platform: template
  3. sensors:
  4. grid_export: # Instant power export for energy dashboard - goes 0 if currently importing (uses Sense)
  5. friendly_name: "Grid Export"
  6. unit_of_measurement: 'W'
  7. value_template: >
  8. {% if (states('sensor.energy_usage') | int(0) - states('sensor.energy_production') | int(0)) > 0 %}
  9. 0
  10. {% else -%}
  11. {{ (states('sensor.energy_usage') | int(0) - states('sensor.energy_production') | int(0)) | abs }}
  12. {% endif %}
  13. grid_import: # Instant power import for energy dashboard - goes 0 if currently exporting (uses Sense)
  14. friendly_name: "Grid Import"
  15. unit_of_measurement: 'W'
  16. value_template: >
  17. {% if (states('sensor.energy_usage') | int(0) - states('sensor.energy_production') | int(0)) > 0 %}
  18. {{ (states('sensor.energy_usage') | int(0) - states('sensor.energy_production') | int(0)) }}
  19. {% else -%}
  20. 0
  21. {% endif %}
  22.  
  23.  
  24. - platform: integration # Grid energy import for Energy dashboard - from forum
  25. source: sensor.grid_import
  26. name: grid_import_kwh
  27. unit_prefix: k
  28. round: 2
  29. - platform: integration # Grid energy export for Energy dashboard - from forum
  30. source: sensor.grid_export
  31. name: grid_export_kwh
  32. unit_prefix: k
  33. round: 2
  34.  
  35. - platform: integration # experimental energy build up for AC costs
  36. source: sensor.ac_usage
  37. name: ac_usage_kwh
  38. unit_prefix: k
  39. round: 2
  40. - platform: integration # experimental energy build up for hot water heater costs
  41. source: sensor.water_heater_usage
  42. name: water_heater_usage_kwh
  43. unit_prefix: k
  44. round: 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement