Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sensor:
- - platform: template
- sensors:
- # sensor used to show power flow from Panels to Grid, but shows a negative at night
- template_grid_feed_in:
- friendly_name: "Solar 2 Grid"
- unit_of_measurement: "W"
- device_class: power
- value_template: >
- {% if states('sensor.grid_active_power') | int > 0 %}
- {{ states('sensor.grid_active_power') }}
- {% else -%}
- 0
- {% endif %}
- # sensor used to show power flow from Panels to Grid and doesn't allow it to show a negative number only positive numbers
- template_grid_consumption:
- friendly_name: "Grid 2 House"
- unit_of_measurement: "W"
- device_class: power
- value_template: >
- {% if states('sensor.grid_active_power') | int > 0 %}
- 0
- {% else -%}
- {{ (states('sensor.grid_active_power') | int) | abs }}
- {% endif %}
- # shows the solar power being fed to the house and doesn't allow it to show a negative number only positive numbers
- template_curent_solar_consumption:
- friendly_name: "Verbruik in huis live"
- unit_of_measurement: "W"
- device_class: power
- value_template: >-
- {% if states('sensor.template_grid_consumption') | float(default=0) > 0 %}
- {{ states('sensor.active_power') }}
- {% else -%}
- {{ states('sensor.active_power')| float(default=0) - states('sensor.template_grid_feed_in')| float(default=0) }}
- {% endif %}
- # Totaal verbruik per dag
- template_totaal_verbruik_dag:
- friendly_name: "Totaal verbruik per dag"
- unit_of_measurement: "kW"
- device_class: energy
- value_template: "{{ states('sensor.daily_yield')| float(default=0) - states('grid_export_solar_daily_energy')| float(default=0) + states('grid_import_solar_daily_energy')| float(default=0) }}"
- utility_meter:
- grid_import_solar_daily_energy:
- source: sensor.grid_consumption
- cycle: daily
- grid_export_solar_daily_energy:
- source: sensor.grid_exported
- cycle: daily
Add Comment
Please, Sign In to add comment