Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with def_current_state #352

Open
MikaelHoogen opened this issue Oct 5, 2024 · 0 comments
Open

Help with def_current_state #352

MikaelHoogen opened this issue Oct 5, 2024 · 0 comments

Comments

@MikaelHoogen
Copy link

Hi

I'm trying to use the "def_current_state" function but can't make it work. Would appreciate some help. My understanding is that if you set "def_current_state" = true the def load will be running in the current period, even if it's not optimal. Typically to not turn off a load thats running. Is this correct?

I have an example below. I set "def_current_state" = true but the result is sensor.p_deferrable0 = 0.0.

curl -i -H "Content-Type: application/json" -X POST -d '{
      "load_cost_forecast":[1.075, 1.075, 1.001, 1.001, 0.971, 0.971, 0.942, 0.942, 0.946, 0.946, 0.938, 0.938, 0.938, 0.938, 0.937, 0.937, 0.938, 0.938, 0.984, 0.984, 1.048, 1.048, 1.29, 1.29, 1.521, 1.521, 1.524, 1.524, 1.483, 1.483, 1.432, 1.432, 1.379, 1.379, 1.361, 1.361, 1.431, 1.431, 1.498, 1.498, 1.553, 1.553, 1.643, 1.643, 1.684, 1.684, 1.713, 1.713, 1.612, 1.612, 1.573, 1.573, 1.529, 1.529, 1.451, 1.451],
      "prod_price_forecast":[0.777, 0.777, 0.717, 0.717, 0.693, 0.693, 0.67, 0.67, 0.677, 0.677, 0.671, 0.671, 0.671, 0.671, 0.67, 0.67, 0.671, 0.671, 0.707, 0.707, 0.758, 0.758, 0.952, 0.952, 1.137, 1.137, 1.139, 1.139, 1.107, 1.107, 1.066, 1.066, 1.023, 1.023, 1.009, 1.009, 1.065, 1.065, 1.119, 1.119, 1.163, 1.163, 1.235, 1.235, 1.268, 1.268, 1.291, 1.291, 1.21, 1.21, 1.179, 1.179, 1.144, 1.144, 1.081, 1.081],
      "pv_power_forecast":[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.0, 91.0, 989.0, 1983.0, 3862.0, 5691.0, 6836.0, 7316.0, 7659.0, 7538.0, 7369.0, 7138.0, 6727.0, 6151.0, 5419.0, 4404.0, 3338.0, 2203.0, 1144.0, 374.0, 317.0, 238.0, 115.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      "prediction_horizon":56,
      "alpha": 0.0,
      "beta": 1.0,
      "num_def_loads": 3,
      "num_lags":96,
      "P_deferrable_nom":[
            2200.0,
            1400,
            2000
          ],
      "treat_def_as_semi_cont": [true, true, true],
      "def_current_state": [
                        true,
                        false,
                        false],
      "def_total_hours":[
                        6.5,
                        0.0,
                        0],
      "soc_init": 0.74,
      "set_def_constant": [false,
                          false,false]
      }' http://localhost:5000/action/naive-mpc-optim
2024-09-30 20:15:32,185 - web_server - INFO - Passed runtime parameters: {'load_cost_forecast': [1.075, 1.075, 1.001, 1.001, 0.971, 0.971, 0.942, 0.942, 0.946, 0.946, 0.938, 0.938, 0.938, 0.938, 0.937, 0.937, 0.938, 0.938, 0.984, 0.984, 1.048, 1.048, 1.29, 1.29, 1.521, 1.521, 1.524, 1.524, 1.483, 1.483, 1.432, 1.432, 1.379, 1.379, 1.361, 1.361, 1.431, 1.431, 1.498, 1.498, 1.553, 1.553, 1.643, 1.643, 1.684, 1.684, 1.713, 1.713, 1.612, 1.612, 1.573, 1.573, 1.529, 1.529, 1.451, 1.451], 'prod_price_forecast': [0.777, 0.777, 0.717, 0.717, 0.693, 0.693, 0.67, 0.67, 0.677, 0.677, 0.671, 0.671, 0.671, 0.671, 0.67, 0.67, 0.671, 0.671, 0.707, 0.707, 0.758, 0.758, 0.952, 0.952, 1.137, 1.137, 1.139, 1.139, 1.107, 1.107, 1.066, 1.066, 1.023, 1.023, 1.009, 1.009, 1.065, 1.065, 1.119, 1.119, 1.163, 1.163, 1.235, 1.235, 1.268, 1.268, 1.291, 1.291, 1.21, 1.21, 1.179, 1.179, 1.144, 1.144, 1.081, 1.081], 'pv_power_forecast': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.0, 91.0, 989.0, 1983.0, 3862.0, 5691.0, 6836.0, 7316.0, 7659.0, 7538.0, 7369.0, 7138.0, 6727.0, 6151.0, 5419.0, 4404.0, 3338.0, 2203.0, 1144.0, 374.0, 317.0, 238.0, 115.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'prediction_horizon': 56, 'alpha': 0.0, 'beta': 1.0, 'num_def_loads': 3, 'num_lags': 96, 'P_deferrable_nom': [2200.0, 1400, 2000], 'treat_def_as_semi_cont': [True, True, True], 'def_current_state': [True, False, False], 'def_total_hours': [6.5, 0.0, 0], 'soc_init': 0.74, 'set_def_constant': [False, False, False]}
2024-09-30 20:16:26,552 - web_server - INFO - Publishing data to HASS instance
2024-09-30 20:16:26,561 - web_server - INFO - Successfully posted to sensor.p_pv_forecast = 1.61
2024-09-30 20:16:26,566 - web_server - INFO - Successfully posted to sensor.p_load_forecast = 941.34
2024-09-30 20:16:26,571 - web_server - INFO - Successfully posted to sensor.p_deferrable0 = 0.0
2024-09-30 20:16:26,576 - web_server - INFO - Successfully posted to sensor.p_deferrable1 = 0.0
2024-09-30 20:16:26,580 - web_server - INFO - Successfully posted to sensor.p_deferrable2 = 0.0
2024-09-30 20:16:26,585 - web_server - INFO - Successfully posted to sensor.p_batt_forecast = 0.0
2024-09-30 20:16:26,589 - web_server - INFO - Successfully posted to sensor.soc_batt_forecast = 74.0
2024-09-30 20:16:26,594 - web_server - INFO - Successfully posted to sensor.p_grid_forecast = 939.73
2024-09-30 20:16:26,598 - web_server - INFO - Successfully posted to sensor.total_cost_fun_value = 17.18
2024-09-30 20:16:26,601 - web_server - INFO - Successfully posted to sensor.optim_status = Optimal
2024-09-30 20:16:26,606 - web_server - INFO - Successfully posted to sensor.unit_load_cost = 1.075
2024-09-30 20:16:26,611 - web_server - INFO - Successfully posted to sensor.unit_prod_price = 0.777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant