Advertisement
Guest User

Untitled

a guest
May 11th, 2022
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. sensor:
  2. - platform: template
  3. sensors:
  4. # sensor used to show power flow from Panels to Grid, but shows a negative at night
  5. template_grid_feed_in:
  6. friendly_name: "Solar 2 Grid"
  7. unit_of_measurement: "W"
  8. device_class: power
  9. value_template: >
  10. {% if states('sensor.grid_active_power') | int > 0 %}
  11. {{ states('sensor.grid_active_power') }}
  12. {% else -%}
  13. 0
  14. {% endif %}
  15.  
  16. # sensor used to show power flow from Panels to Grid and doesn't allow it to show a negative number only positive numbers
  17. template_grid_consumption:
  18. friendly_name: "Grid 2 House"
  19. unit_of_measurement: "W"
  20. device_class: power
  21. value_template: >
  22. {% if states('sensor.grid_active_power') | int > 0 %}
  23. 0
  24. {% else -%}
  25. {{ (states('sensor.grid_active_power') | int) | abs }}
  26. {% endif %}
  27.  
  28. # shows the solar power being fed to the house and doesn't allow it to show a negative number only positive numbers
  29. template_curent_solar_consumption:
  30. friendly_name: "Verbruik in huis live"
  31. unit_of_measurement: "W"
  32. device_class: power
  33. value_template: >-
  34. {% if states('sensor.template_grid_consumption') | float > 0 %}
  35. {{ states('sensor.active_power') }}
  36. {% else -%}
  37. {{ (states('sensor.active_power')| float - states('sensor.template_grid_feed_in')| float) }}
  38. {% endif %}
  39.  
  40. # Totaal verbruik per dag
  41. template_totaal_verbruik_dag:
  42. friendly_name: "Totaal verbruik per dag"
  43. unit_of_measurement: "kW"
  44. device_class: energy
  45. value_template: >-
  46.  
  47. {{ (states('sensor.daily_yield')| float - states('grid_export_solar_daily_energy')| float + states('grid_import_solar_daily_energy')| float) }}
  48.  
  49. utility_meter:
  50. grid_import_solar_daily_energy:
  51. source: sensor.grid_consumption
  52. cycle: daily
  53. grid_export_solar_daily_energy:
  54. source: sensor.grid_exported
  55. cycle: daily
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement