emhass 0.10.4__py3-none-any.whl → 0.10.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
emhass/command_line.py CHANGED
@@ -896,6 +896,25 @@ def publish_data(input_data_dict: dict, logger: logging.Logger,
896
896
  dont_post=dont_post
897
897
  )
898
898
  cols_published = cols_published + ["P_deferrable{}".format(k)]
899
+ # Publish thermal model data (predicted temperature)
900
+ custom_predicted_temperature_id = params["passed_data"][
901
+ "custom_predicted_temperature_id"
902
+ ]
903
+ for k in range(input_data_dict["opt"].optim_conf["num_def_loads"]):
904
+ if "def_load_config" in input_data_dict["opt"].optim_conf.keys():
905
+ if "thermal_config" in input_data_dict["opt"].optim_conf["def_load_config"][k]:
906
+ input_data_dict["rh"].post_data(
907
+ opt_res_latest["predicted_temp_heater{}".format(k)],
908
+ idx_closest,
909
+ custom_predicted_temperature_id[k]["entity_id"],
910
+ custom_predicted_temperature_id[k]["unit_of_measurement"],
911
+ custom_predicted_temperature_id[k]["friendly_name"],
912
+ type_var="temperature",
913
+ publish_prefix=publish_prefix,
914
+ save_entities=entity_save,
915
+ dont_post=dont_post
916
+ )
917
+ cols_published = cols_published + ["predicted_temp_heater{}".format(k)]
899
918
  # Publish battery power
900
919
  if input_data_dict["opt"].optim_conf["set_use_battery"]:
901
920
  if "P_batt" not in opt_res_latest.columns:
@@ -967,18 +986,19 @@ def publish_data(input_data_dict: dict, logger: logging.Logger,
967
986
  logger.warning(
968
987
  "no optim_status in opt_res_latest, run an optimization task first",
969
988
  )
970
- input_data_dict["rh"].post_data(
971
- opt_res_latest["optim_status"],
972
- idx_closest,
973
- custom_cost_fun_id["entity_id"],
974
- custom_cost_fun_id["unit_of_measurement"],
975
- custom_cost_fun_id["friendly_name"],
976
- type_var="optim_status",
977
- publish_prefix=publish_prefix,
978
- save_entities=entity_save,
979
- dont_post=dont_post
980
- )
981
- cols_published = cols_published + ["optim_status"]
989
+ else:
990
+ input_data_dict["rh"].post_data(
991
+ opt_res_latest["optim_status"],
992
+ idx_closest,
993
+ custom_cost_fun_id["entity_id"],
994
+ custom_cost_fun_id["unit_of_measurement"],
995
+ custom_cost_fun_id["friendly_name"],
996
+ type_var="optim_status",
997
+ publish_prefix=publish_prefix,
998
+ save_entities=entity_save,
999
+ dont_post=dont_post
1000
+ )
1001
+ cols_published = cols_published + ["optim_status"]
982
1002
  # Publish unit_load_cost
983
1003
  custom_unit_load_cost_id = params["passed_data"]["custom_unit_load_cost_id"]
984
1004
  input_data_dict["rh"].post_data(
emhass/retrieve_hass.py CHANGED
@@ -370,6 +370,9 @@ class RetrieveHass:
370
370
  elif type_var == "deferrable":
371
371
  data = RetrieveHass.get_attr_data_dict(data_df, idx, entity_id, unit_of_measurement,
372
372
  friendly_name, "deferrables_schedule", state)
373
+ elif type_var == "temperature":
374
+ data = RetrieveHass.get_attr_data_dict(data_df, idx, entity_id, unit_of_measurement,
375
+ friendly_name, "predicted_temperatures", state)
373
376
  elif type_var == "batt":
374
377
  data = RetrieveHass.get_attr_data_dict(data_df, idx, entity_id, unit_of_measurement,
375
378
  friendly_name, "battery_scheduled_power", state)
emhass/utils.py CHANGED
@@ -143,6 +143,7 @@ def treat_runtimeparams(runtimeparams: str, params: str, retrieve_hass_conf: dic
143
143
  params = {}
144
144
  # Some default data needed
145
145
  custom_deferrable_forecast_id = []
146
+ custom_predicted_temperature_id = []
146
147
  for k in range(optim_conf["num_def_loads"]):
147
148
  custom_deferrable_forecast_id.append(
148
149
  {
@@ -151,6 +152,13 @@ def treat_runtimeparams(runtimeparams: str, params: str, retrieve_hass_conf: dic
151
152
  "friendly_name": "Deferrable Load {}".format(k),
152
153
  }
153
154
  )
155
+ custom_predicted_temperature_id.append(
156
+ {
157
+ "entity_id": "sensor.temp_predicted{}".format(k),
158
+ "unit_of_measurement": "°C",
159
+ "friendly_name": "Predicted temperature {}".format(k),
160
+ }
161
+ )
154
162
  default_passed_dict = {
155
163
  "custom_pv_forecast_id": {
156
164
  "entity_id": "sensor.p_pv_forecast",
@@ -208,6 +216,7 @@ def treat_runtimeparams(runtimeparams: str, params: str, retrieve_hass_conf: dic
208
216
  "friendly_name": "Unit Prod Price",
209
217
  },
210
218
  "custom_deferrable_forecast_id": custom_deferrable_forecast_id,
219
+ "custom_predicted_temperature_id": custom_predicted_temperature_id,
211
220
  "publish_prefix": "",
212
221
  }
213
222
  if "passed_data" in params.keys():
@@ -521,6 +530,10 @@ def treat_runtimeparams(runtimeparams: str, params: str, retrieve_hass_conf: dic
521
530
  params["passed_data"]["custom_deferrable_forecast_id"] = runtimeparams[
522
531
  "custom_deferrable_forecast_id"
523
532
  ]
533
+ if "custom_predicted_temperature_id" in runtimeparams.keys():
534
+ params["passed_data"]["custom_predicted_temperature_id"] = runtimeparams[
535
+ "custom_predicted_temperature_id"
536
+ ]
524
537
  # A condition to put a prefix on all published data, or check for saved data under prefix name
525
538
  if "publish_prefix" not in runtimeparams.keys():
526
539
  publish_prefix = ""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: emhass
3
- Version: 0.10.4
3
+ Version: 0.10.6
4
4
  Summary: An Energy Management System for Home Assistant
5
5
  Home-page: https://github.com/davidusb-geek/emhass
6
6
  Author: David HERNANDEZ
@@ -1,11 +1,11 @@
1
1
  emhass/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- emhass/command_line.py,sha256=rQGyUQgoalJZu9Nr8pyELQQeuYF9SjLsKLWiSEE1KKc,60855
2
+ emhass/command_line.py,sha256=7C5YO4-sgmrk13G2c8HOz8QDHyhx5rXWZgAXol3hgOQ,61981
3
3
  emhass/forecast.py,sha256=ZwTjZxodszGM_1VBfFz5zhlzx0gobCQAkHA3PLjTXnA,53141
4
4
  emhass/machine_learning_forecaster.py,sha256=kUa5b5Ay3ZO7ceU7yUo1p5vu2DI6QbXMFmzX6IVLkzw,16027
5
5
  emhass/machine_learning_regressor.py,sha256=WmR9ODWkY64RAniqLowwf5tZWzPTVp5ftCTKNtzcd6I,10407
6
6
  emhass/optimization.py,sha256=CqvaZstNe7J1PSqdG9mwUrTXfseCYOE8wApPZR5VKnI,49748
7
- emhass/retrieve_hass.py,sha256=k-BPZMqW-uQ95Q7Gzz93nPkLHStDCkI7-047GVYBGC0,22983
8
- emhass/utils.py,sha256=yRatrmnT1VgDlFahB6iY5XXViM2inIO1kCz-O6PXuLE,50939
7
+ emhass/retrieve_hass.py,sha256=_WydIf5wNzO6rltmtzqAof_lgrKqUHMMPZmt9syNQWc,23219
8
+ emhass/utils.py,sha256=jTvS73csx6sybVn5XP8GHz78gsMZNn1b0LwaMki0NmA,51545
9
9
  emhass/web_server.py,sha256=Kwx3YmNugxMDHHWMiK-cb8qjLmM9ugKvaj6HWnI_NYc,24638
10
10
  emhass/data/cec_inverters.pbz2,sha256=tK8FvAUDW0uYez8EPttdCJwHhpPofclYV6GhhNZL0Pk,168272
11
11
  emhass/data/cec_modules.pbz2,sha256=8vEaysgYffXg3KUl8XSF36Mdywzi3LpEtUN_qenjO9s,1655747
@@ -18,9 +18,9 @@ emhass/static/img/emhass_logo_short.svg,sha256=yzMcqtBRCV8rH84-MwnigZh45_f9Eoqwh
18
18
  emhass/static/img/feather-sprite.svg,sha256=VHjMJQg88wXa9CaeYrKGhNtyK0xdd47zCqwSIa-hxo8,60319
19
19
  emhass/templates/index.html,sha256=_BsvUJ981uSQkx5H9tq_3es__x4WdPiOy7FjNoNYU9w,2744
20
20
  emhass/templates/template.html,sha256=TkGgMecQEbFUZA4ymPwMUzNjKHsENvCgroUWbPt7G4Y,158
21
- emhass-0.10.4.dist-info/LICENSE,sha256=1X3-S1yvOCBDBeox1aK3dq00m7dA8NDtcPrpKPISzbE,1077
22
- emhass-0.10.4.dist-info/METADATA,sha256=VeMsl6CD2pY5cdA1cZhlCF02ynKb1n24KNggBDZg8Ss,45146
23
- emhass-0.10.4.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
24
- emhass-0.10.4.dist-info/entry_points.txt,sha256=6Bp1NFOGNv_fSTxYl1ke3K3h3aqAcBxI-bgq5yq-i1M,52
25
- emhass-0.10.4.dist-info/top_level.txt,sha256=L7fIX4awfmxQbAePtSdVg2e6x_HhghfReHfsKSpKr9I,7
26
- emhass-0.10.4.dist-info/RECORD,,
21
+ emhass-0.10.6.dist-info/LICENSE,sha256=1X3-S1yvOCBDBeox1aK3dq00m7dA8NDtcPrpKPISzbE,1077
22
+ emhass-0.10.6.dist-info/METADATA,sha256=Xw40CjZAFm426WmjbZJ9Veykb7-WwV5IbuCbxxtk_CQ,45146
23
+ emhass-0.10.6.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
24
+ emhass-0.10.6.dist-info/entry_points.txt,sha256=6Bp1NFOGNv_fSTxYl1ke3K3h3aqAcBxI-bgq5yq-i1M,52
25
+ emhass-0.10.6.dist-info/top_level.txt,sha256=L7fIX4awfmxQbAePtSdVg2e6x_HhghfReHfsKSpKr9I,7
26
+ emhass-0.10.6.dist-info/RECORD,,