-
-
Save MiguelAngelLV/1d2815eb29b8897902c6e03bdf3cb021 to your computer and use it in GitHub Desktop.
Paquete para Home Assistant para calcular el precio con balance horario
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Necesitas configurar este componente ESIOS para el precio de excedentes con PVPC: | |
# https://github.com/azogue/aiopvpc/issues/9#issuecomment-968049577 | |
# | |
# Después debes configurar Coste Total y Devuelto Total en el calculo monetario en el componente Energy | |
template: | |
- trigger: | |
- platform: time_pattern | |
minutes: 59 | |
seconds: 59 | |
sensor: | |
- name: "Consumo Total" | |
unique_id: consumo_total | |
state: "{{ states('sensor.consumo_total') | float + iif ( states('sensor.importacion_ultima_hora') | float > states('sensor.exportacion_ultima_hora') | float, (states('sensor.importacion_ultima_hora') | float - states('sensor.exportacion_ultima_hora') | float) * states('sensor.esios_pvpc') | float, 0) }}" | |
unit_of_measurement: "€" | |
state_class: total_increasing | |
- name: "Devuelto Total" | |
unique_id: devuelto_total | |
state: "{{ states('sensor.devuelto_total') | float + iif ( states('sensor.exportacion_ultima_hora') | float > states('sensor.importacion_ultima_hora') | float, (states('sensor.exportacion_ultima_hora') | float - states('sensor.importacion_ultima_hora') | float) * states('sensor.esios_grid_inyection_price') | float, 0) }}" | |
unit_of_measurement: "€" | |
state_class: total_increasing | |
utility_meter: | |
import_grid: | |
source: sensor.grid_consumption | |
cycle: hourly | |
name: Importación última hora | |
unique_id: import_grid | |
export_grid: | |
source: sensor.grid_exported | |
cycle: hourly | |
name: Exportación última hora | |
unique_id: export_grid | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment