From 3dec8b120e6a6ad64024e6f96199fd13518f2932 Mon Sep 17 00:00:00 2001 From: g1za <88257868+g1za@users.noreply.github.com> Date: Thu, 19 Oct 2023 00:52:07 +0200 Subject: [PATCH 1/7] Update command_line.py typo fix --- src/emhass/command_line.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emhass/command_line.py b/src/emhass/command_line.py index ba50c6ff..5fdf58a7 100644 --- a/src/emhass/command_line.py +++ b/src/emhass/command_line.py @@ -488,7 +488,7 @@ def publish_data(input_data_dict: dict, logger: logging.Logger, custom_deferrable_forecast_id = params['passed_data']['custom_deferrable_forecast_id'] for k in range(input_data_dict['opt'].optim_conf['num_def_loads']): if "P_deferrable{}".format(k) not in opt_res_latest.columns: - logger.error("P_deferrable{}".format(k)+" was not found in results DataFrame. Optimization task may need to be relaunched or it did not converged to a solution.") + logger.error("P_deferrable{}".format(k)+" was not found in results DataFrame. Optimization task may need to be relaunched or it did not converge to a solution.") else: input_data_dict['rh'].post_data(opt_res_latest["P_deferrable{}".format(k)], idx_closest, custom_deferrable_forecast_id[k]["entity_id"], @@ -500,7 +500,7 @@ def publish_data(input_data_dict: dict, logger: logging.Logger, # Publish battery power if input_data_dict['opt'].optim_conf['set_use_battery']: if 'P_batt' not in opt_res_latest.columns: - logger.error("P_batt was not found in results DataFrame. Optimization task may need to be relaunched or it did not converged to a solution.") + logger.error("P_batt was not found in results DataFrame. Optimization task may need to be relaunched or it did not converge to a solution.") else: custom_batt_forecast_id = params['passed_data']['custom_batt_forecast_id'] input_data_dict['rh'].post_data(opt_res_latest['P_batt'], idx_closest, From dd630d3475f2aa6abf32b9d4088403f75b2514b0 Mon Sep 17 00:00:00 2001 From: g1za <88257868+g1za@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:24:40 +0100 Subject: [PATCH 2/7] Update study_case.md Added computed variables definitions (thanks to rcruikshank for the list) and corresponding published sensors --- docs/study_case.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/study_case.md b/docs/study_case.md index bcb8fd59..06e489b2 100644 --- a/docs/study_case.md +++ b/docs/study_case.md @@ -166,3 +166,20 @@ The real implementation of EMHASS and its efficiency depends on the quality of t Here is an extract of the PV power production forecast with the default PV forecast method from EMHASS: a web scarpping of the clearoutside page based on the defined lat/lon location of the system. These are the forecast results of the GFS model compared with the real PV produced data for a 4 day period. ![](./images/forecasted_PV_data.png) + +## Computed variables and published data + +Below you can find a list of the data resulting from EMHASS computation, showin in the graphs and then published to Home Assistant through the ```publish_data``` command: + +| EMHASS varibale | Definition | Home Assistant published sensor | +| --------------- | ---------- | --------------------------------| +| P_PV | Forecasted power generation from your solar panels (Watts). This helps you predict how much solar energy you will produce during the forecast period. | sensor.p_pv_forecast | +| P_Load | Forecasted household power consumption (Watts). This gives you an idea of how much energy your appliances are expected to use. | sensor.p_load_forecast | +| P_deferrableX [X = 0, 1, 2, ...] | Forecasted power consumption of deferrable loads (Watts). Deferable loads are appliances that can be managed by EMHASS. EMHASS helps you optimise energy usage by prioritising solar self-consumption and minimizing reliance on the grid or by taking advantage or supply and feed-in tariff volatility. You can have multiple deferable loads and you use this sensor in HA to control these loads via smart switch or other IoT means at your disposal. | sensor.p_deferrableX | +| P_grid_pos | Forecasted power imported from the grid (Watts). This indicates the amount of energy you are expected to draw from the grid when your solar production is insufficient to meet your needs or it is advantagous to consume from the grid. | - | +| P_grid_neg | Forecasted power exported to the grid (Watts). This indicates the amount of excess solar energy you are expected to send back to the grid during the forecast period. | - | +| P_grid | Forecasted net power flow between your home and the grid (Watts). This is calculated as P_grid_pos - P_grid_neg. A positive value indicates net export, while a negative value indicates net import. | sensor.p_grid_forecast | +| unit_load_cost | Forecasted cost per unit of energy you pay to the grid (typically "Currency"/kWh). This helps you understand the expected energy cost during the forecast period. | sensor.unit_load_cost | +| unit_prod_price | Forecasted price you receive for selling excess solar energy back to the grid (typically "Currency"/kWh). This helps you understand the potential income from your solar production. | sensor.unit_prod_price | +| cost_profit | Forecasted profit or loss from your energy usage for the forecast period. This is calculated as unit_load_cost * P_Load - unit_prod_price * P_grid_pos. A positive value indicates a profit, while a negative value indicates a loss. | sensor.total_cost_profit_value | +| cost_fun_cost | Forecasted cost associated with deferring loads to maximize solar self-consumption. This helps you evaluate the trade-off between managing the load and not managing and potential cost savings. | sensor.total_cost_fun_value | From 419395fc9694b8a16074de76db770f5b9b545cad Mon Sep 17 00:00:00 2001 From: g1za <88257868+g1za@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:35:05 +0100 Subject: [PATCH 3/7] Update study_case.md Added P_batt variable --- docs/study_case.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/study_case.md b/docs/study_case.md index 06e489b2..22aff5dd 100644 --- a/docs/study_case.md +++ b/docs/study_case.md @@ -178,6 +178,7 @@ Below you can find a list of the data resulting from EMHASS computation, showin | P_deferrableX [X = 0, 1, 2, ...] | Forecasted power consumption of deferrable loads (Watts). Deferable loads are appliances that can be managed by EMHASS. EMHASS helps you optimise energy usage by prioritising solar self-consumption and minimizing reliance on the grid or by taking advantage or supply and feed-in tariff volatility. You can have multiple deferable loads and you use this sensor in HA to control these loads via smart switch or other IoT means at your disposal. | sensor.p_deferrableX | | P_grid_pos | Forecasted power imported from the grid (Watts). This indicates the amount of energy you are expected to draw from the grid when your solar production is insufficient to meet your needs or it is advantagous to consume from the grid. | - | | P_grid_neg | Forecasted power exported to the grid (Watts). This indicates the amount of excess solar energy you are expected to send back to the grid during the forecast period. | - | +| P_batt | Forecasted (dis)charge power load (Watt) for the battery (if installed). If negative it indicates the battery is charging, if positive that the battery is discharging. | sensor.p_batt_forecast | | P_grid | Forecasted net power flow between your home and the grid (Watts). This is calculated as P_grid_pos - P_grid_neg. A positive value indicates net export, while a negative value indicates net import. | sensor.p_grid_forecast | | unit_load_cost | Forecasted cost per unit of energy you pay to the grid (typically "Currency"/kWh). This helps you understand the expected energy cost during the forecast period. | sensor.unit_load_cost | | unit_prod_price | Forecasted price you receive for selling excess solar energy back to the grid (typically "Currency"/kWh). This helps you understand the potential income from your solar production. | sensor.unit_prod_price | From a6de62943cda46a6fc1d0347527ab1e54842f3e7 Mon Sep 17 00:00:00 2001 From: g1za <88257868+g1za@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:42:57 +0100 Subject: [PATCH 4/7] Update study_case.md Added SOC_opt --- docs/study_case.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/study_case.md b/docs/study_case.md index 22aff5dd..7908d894 100644 --- a/docs/study_case.md +++ b/docs/study_case.md @@ -180,6 +180,7 @@ Below you can find a list of the data resulting from EMHASS computation, showin | P_grid_neg | Forecasted power exported to the grid (Watts). This indicates the amount of excess solar energy you are expected to send back to the grid during the forecast period. | - | | P_batt | Forecasted (dis)charge power load (Watt) for the battery (if installed). If negative it indicates the battery is charging, if positive that the battery is discharging. | sensor.p_batt_forecast | | P_grid | Forecasted net power flow between your home and the grid (Watts). This is calculated as P_grid_pos - P_grid_neg. A positive value indicates net export, while a negative value indicates net import. | sensor.p_grid_forecast | +| SOC_opt | Forecasted battery optimized Status Of Charge (SOC) percentage level | sensor.soc_batt_forecast | | unit_load_cost | Forecasted cost per unit of energy you pay to the grid (typically "Currency"/kWh). This helps you understand the expected energy cost during the forecast period. | sensor.unit_load_cost | | unit_prod_price | Forecasted price you receive for selling excess solar energy back to the grid (typically "Currency"/kWh). This helps you understand the potential income from your solar production. | sensor.unit_prod_price | | cost_profit | Forecasted profit or loss from your energy usage for the forecast period. This is calculated as unit_load_cost * P_Load - unit_prod_price * P_grid_pos. A positive value indicates a profit, while a negative value indicates a loss. | sensor.total_cost_profit_value | From df93a02bfe289ab37c4b7b7713ec62559a3bd48b Mon Sep 17 00:00:00 2001 From: g1za <88257868+g1za@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:52:30 +0100 Subject: [PATCH 5/7] Update README.md Moved the variables definition to a better section --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 07cfb247..a9aad30e 100644 --- a/README.md +++ b/README.md @@ -292,6 +292,26 @@ shell_command: ``` And you should be careful that the list of dictionaries has the correct length, which is the number of defined deferrable loads. +### Computed variables and published data + +Below you can find a list of the data resulting from EMHASS computation, showed in the charts, and then published to Home Assistant through the ```publish_data``` command: + +| EMHASS varibale | Definition | Home Assistant published sensor | +| --------------- | ---------- | --------------------------------| +| P_PV | Forecasted power generation from your solar panels (Watts). This helps you predict how much solar energy you will produce during the forecast period. | sensor.p_pv_forecast | +| P_Load | Forecasted household power consumption (Watts). This gives you an idea of how much energy your appliances are expected to use. | sensor.p_load_forecast | +| P_deferrableX [X = 0, 1, 2, ...] | Forecasted power consumption of deferrable loads (Watts). Deferable loads are appliances that can be managed by EMHASS. EMHASS helps you optimise energy usage by prioritising solar self-consumption and minimizing reliance on the grid or by taking advantage or supply and feed-in tariff volatility. You can have multiple deferable loads and you use this sensor in HA to control these loads via smart switch or other IoT means at your disposal. | sensor.p_deferrableX | +| P_grid_pos | Forecasted power imported from the grid (Watts). This indicates the amount of energy you are expected to draw from the grid when your solar production is insufficient to meet your needs or it is advantagous to consume from the grid. | - | +| P_grid_neg | Forecasted power exported to the grid (Watts). This indicates the amount of excess solar energy you are expected to send back to the grid during the forecast period. | - | +| P_batt | Forecasted (dis)charge power load (Watt) for the battery (if installed). If negative it indicates the battery is charging, if positive that the battery is discharging. | sensor.p_batt_forecast | +| P_grid | Forecasted net power flow between your home and the grid (Watts). This is calculated as P_grid_pos - P_grid_neg. A positive value indicates net export, while a negative value indicates net import. | sensor.p_grid_forecast | +| SOC_opt | Forecasted battery optimized Status Of Charge (SOC) percentage level | sensor.soc_batt_forecast | +| unit_load_cost | Forecasted cost per unit of energy you pay to the grid (typically "Currency"/kWh). This helps you understand the expected energy cost during the forecast period. | sensor.unit_load_cost | +| unit_prod_price | Forecasted price you receive for selling excess solar energy back to the grid (typically "Currency"/kWh). This helps you understand the potential income from your solar production. | sensor.unit_prod_price | +| cost_profit | Forecasted profit or loss from your energy usage for the forecast period. This is calculated as unit_load_cost * P_Load - unit_prod_price * P_grid_pos. A positive value indicates a profit, while a negative value indicates a loss. | sensor.total_cost_profit_value | +| cost_fun_cost | Forecasted cost associated with deferring loads to maximize solar self-consumption. This helps you evaluate the trade-off between managing the load and not managing and potential cost savings. | sensor.total_cost_fun_value | + + ## Passing your own data In EMHASS we have basically 4 forecasts to deal with: From d5ebcf36d8638b40b78d09b76ff15d7a3b7cca99 Mon Sep 17 00:00:00 2001 From: g1za <88257868+g1za@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:53:03 +0100 Subject: [PATCH 6/7] Update study_case.md moved the new section with computed variables to a better section --- docs/study_case.md | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/docs/study_case.md b/docs/study_case.md index 7908d894..bcb8fd59 100644 --- a/docs/study_case.md +++ b/docs/study_case.md @@ -166,22 +166,3 @@ The real implementation of EMHASS and its efficiency depends on the quality of t Here is an extract of the PV power production forecast with the default PV forecast method from EMHASS: a web scarpping of the clearoutside page based on the defined lat/lon location of the system. These are the forecast results of the GFS model compared with the real PV produced data for a 4 day period. ![](./images/forecasted_PV_data.png) - -## Computed variables and published data - -Below you can find a list of the data resulting from EMHASS computation, showin in the graphs and then published to Home Assistant through the ```publish_data``` command: - -| EMHASS varibale | Definition | Home Assistant published sensor | -| --------------- | ---------- | --------------------------------| -| P_PV | Forecasted power generation from your solar panels (Watts). This helps you predict how much solar energy you will produce during the forecast period. | sensor.p_pv_forecast | -| P_Load | Forecasted household power consumption (Watts). This gives you an idea of how much energy your appliances are expected to use. | sensor.p_load_forecast | -| P_deferrableX [X = 0, 1, 2, ...] | Forecasted power consumption of deferrable loads (Watts). Deferable loads are appliances that can be managed by EMHASS. EMHASS helps you optimise energy usage by prioritising solar self-consumption and minimizing reliance on the grid or by taking advantage or supply and feed-in tariff volatility. You can have multiple deferable loads and you use this sensor in HA to control these loads via smart switch or other IoT means at your disposal. | sensor.p_deferrableX | -| P_grid_pos | Forecasted power imported from the grid (Watts). This indicates the amount of energy you are expected to draw from the grid when your solar production is insufficient to meet your needs or it is advantagous to consume from the grid. | - | -| P_grid_neg | Forecasted power exported to the grid (Watts). This indicates the amount of excess solar energy you are expected to send back to the grid during the forecast period. | - | -| P_batt | Forecasted (dis)charge power load (Watt) for the battery (if installed). If negative it indicates the battery is charging, if positive that the battery is discharging. | sensor.p_batt_forecast | -| P_grid | Forecasted net power flow between your home and the grid (Watts). This is calculated as P_grid_pos - P_grid_neg. A positive value indicates net export, while a negative value indicates net import. | sensor.p_grid_forecast | -| SOC_opt | Forecasted battery optimized Status Of Charge (SOC) percentage level | sensor.soc_batt_forecast | -| unit_load_cost | Forecasted cost per unit of energy you pay to the grid (typically "Currency"/kWh). This helps you understand the expected energy cost during the forecast period. | sensor.unit_load_cost | -| unit_prod_price | Forecasted price you receive for selling excess solar energy back to the grid (typically "Currency"/kWh). This helps you understand the potential income from your solar production. | sensor.unit_prod_price | -| cost_profit | Forecasted profit or loss from your energy usage for the forecast period. This is calculated as unit_load_cost * P_Load - unit_prod_price * P_grid_pos. A positive value indicates a profit, while a negative value indicates a loss. | sensor.total_cost_profit_value | -| cost_fun_cost | Forecasted cost associated with deferring loads to maximize solar self-consumption. This helps you evaluate the trade-off between managing the load and not managing and potential cost savings. | sensor.total_cost_fun_value | From 83f25cea1f95c86ea4118979f65b9be6b2e51b8e Mon Sep 17 00:00:00 2001 From: g1za <88257868+g1za@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:55:09 +0100 Subject: [PATCH 7/7] Update README.md error fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a9aad30e..1728f792 100644 --- a/README.md +++ b/README.md @@ -294,7 +294,7 @@ And you should be careful that the list of dictionaries has the correct length, ### Computed variables and published data -Below you can find a list of the data resulting from EMHASS computation, showed in the charts, and then published to Home Assistant through the ```publish_data``` command: +Below you can find a list of the variables resulting from EMHASS computation, showed in the charts, and then published to Home Assistant through the ```publish_data``` command: | EMHASS varibale | Definition | Home Assistant published sensor | | --------------- | ---------- | --------------------------------|