From 494ed0352380f3e2ce851a6f88ad321cf49e714a Mon Sep 17 00:00:00 2001 From: Ryan McLean Date: Thu, 6 Apr 2023 11:06:16 +0100 Subject: [PATCH] Add more utility meter tariffs and fix for solar_autarkie_ratio --- packages/electricity_tarriff_automations.yaml | 101 +++++++++--------- packages/energy_stats.yaml | 2 +- packages/energy_utilities.yaml | 6 ++ 3 files changed, 55 insertions(+), 54 deletions(-) diff --git a/packages/electricity_tarriff_automations.yaml b/packages/electricity_tarriff_automations.yaml index 3f2148d..d7740f1 100644 --- a/packages/electricity_tarriff_automations.yaml +++ b/packages/electricity_tarriff_automations.yaml @@ -41,138 +41,133 @@ automation: entity_id: select.household_grid_to_battery_yearly data: option: '{{ tariff }}' - - service: select.select_option - target: - entity_id: select.household_imported_power_daily - data: + - data: option: '{{ tariff }}' - - service: select.select_option + service: select.select_option target: - entity_id: select.household_imported_power_monthly - data: + entity_id: select.solar_imported_power_daily_solaredge + - data: option: '{{ tariff }}' - - service: select.select_option + service: select.select_option target: - entity_id: select.household_imported_power_yearly - data: - option: '{{ tariff }}' + entity_id: select.solar_imported_power_daily - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: - entity_id: select.solar_imported_power_daily_solaredge + entity_id: select.solar_battery_from_grid_daily - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: - entity_id: select.solar_imported_power_daily + entity_id: select.solar_battery_to_grid_daily - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: - entity_id: select.solar_battery_from_grid_daily + entity_id: select.solar_battery_out_daily - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_house_consumption_daily - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_imported_power_weekly_solaredge - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_imported_power_weekly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_battery_from_grid_weekly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' + service: select.select_option + target: + entity_id: select.solar_battery_to_grid_weekly + - data: + option: '{{ tariff }}' + service: select.select_option + target: + entity_id: select.solar_battery_out_weekly + - data: + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_house_consumption_weekly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_imported_power_monthly_solaredge - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_imported_power_monthly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_battery_from_grid_monthly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' + service: select.select_option + target: + entity_id: select.solar_battery_to_grid_monthly + - data: + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_battery_in_monthly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_battery_out_monthly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_house_consumption_monthly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_imported_power_yearly_solaredge - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_imported_power_yearly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_battery_from_grid_yearly - data: - option: "{{ tariff }}" - service: select.select_option - target: - entity_id: select.solar_battery_in_yearly - - data: - option: "{{ tariff }}" - service: select.select_option - target: - entity_id: select.solar_battery_out_yearly - - data: - option: "{{ tariff }}" - service: select.select_option - target: - entity_id: select.solar_house_consumption_yearly - - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: entity_id: select.solar_battery_to_grid_yearly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: - entity_id: select.solar_battery_to_grid_monthly + entity_id: select.solar_battery_in_yearly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: - entity_id: select.solar_battery_to_grid_weekly + entity_id: select.solar_battery_out_yearly - data: - option: "{{ tariff }}" + option: '{{ tariff }}' service: select.select_option target: - entity_id: select.solar_battery_to_grid_daily \ No newline at end of file + entity_id: select.solar_house_consumption_yearly diff --git a/packages/energy_stats.yaml b/packages/energy_stats.yaml index 7228903..18aca31 100644 --- a/packages/energy_stats.yaml +++ b/packages/energy_stats.yaml @@ -24,7 +24,7 @@ template: {% if (house_consumption_daily <= 0) %} 0 {% else %} - {{ (1 - (imported_power_daily / house_consumption_daily) * 100) | round (1) }} + {{ ((1 - (imported_power_daily / house_consumption_daily)) * 100) | round (1) }} {% endif %} - name: "Solar Inverter Effectiveness" diff --git a/packages/energy_utilities.yaml b/packages/energy_utilities.yaml index 6eb5701..7e049b7 100644 --- a/packages/energy_utilities.yaml +++ b/packages/energy_utilities.yaml @@ -53,6 +53,9 @@ utility_meter: source: sensor.solar_battery_out_kwh name: Solar Battery Out Daily cycle: daily + tariffs: + - peak + - offpeak # Electricity Export solar_exported_power_daily: @@ -124,6 +127,9 @@ utility_meter: source: sensor.solar_battery_out_kwh name: Solar Battery Out Weekly cycle: weekly + tariffs: + - peak + - offpeak # Electricity Export solar_exported_power_weekly: