Hi mark… thanks again…
Being new to HA… I’m still have a lot to learn… how to I get the status code when I call the optimization?
alias: EMHASS Post MPC Solcast
description: ""
trigger:
- platform: time_pattern
minutes: /1
condition:
action:
- service: rest_command.naive_mpc_optim
data: {}
- service: rest_command.publish_data
data: {}
mode: single
It looks fine to me…
2023-07-13 03:45:01.645 WARNING (MainThread) [homeassistant.components.rest_command] Error. Url: http://localhost:5000/action/naive-mpc-optim. Status code 500. Payload: b'{\n "prod_price_forecast": [-0.03, -0.04, -0.01, -0.0, 0.04, 0.06, 0.07, 0.04, 0.12, 0.13, 0.06, 0.02, 0.01, 0.0, -0.01, -0.02, -0.04, -0.05, -0.05, -0.05, -0.05, -0.05, -0.05, -0.02, -0.0, 0.01, 0.04, 0.05, 0.08, 0.07, 0.06, 0.06, 0.06, 0.07, 0.07, 0.06, 0.05, 0.01, -0.0, -0.0, -0.01, -0.01, -0.02, -0.02, -0.02, -0.04, -0.04, -0.04, -0.05],\n "load_cost_forecast": [0.07, 0.06, 0.1, 0.1, 0.15, 0.17, 0.18, 0.14, 0.24, 0.25, 0.17, 0.13, 0.12, 0.11, 0.1, 0.08, 0.06, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.23, 0.24, 0.26, 0.29, 0.3, 0.34, 0.32, 0.31, 0.31, 0.31, 0.32, 0.32, 0.17, 0.16, 0.12, 0.1, 0.1, 0.1, 0.1, 0.08, 0.08, 0.08, 0.05, 0.06, 0.05, 0.05],\n "load_power_forecast": [361, 900, 600, 2400, 3100, 2700, 2000, 2200, 2500, 1900, 1800, 1500, 700, 1300, 2100, 2500, 1700, 500, 900, 0, 800, 2000, 1900, 900, 800, 1100, 1100, 1200, 1000, 1000, 900, 1700, 2400, 800, 700, 700, 900, 900, 600, 500, 700, 400, 400, 600, 700, 600, 500, 600],\n "pv_power_forecast": [0, 0, 0, 0, 0, 0, 0, 0, 133, 1057, 1677, 2178, 2587, 3035, 3350, 3603, 3747, 3722, 3532, 3220, 2816, 2427, 1986, 1483, 979, 523, 162, 15, 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, 32, 227, 845, 1548, 2036, 2458, 2748, 2958, 3072, 3095, 3006, 2863, 2655, 2353, 1952, 1481, 1010, 578, 176, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n "prediction_horizon": 48,\n "alpha": 1,\n "beta": 0,\n "num_def_loads": 0,"def_total_hours": [0],"P_deferrable_nom": [0],\n "treat_def_as_semi_cont": [1, 1],\n "set_def_constant": [0, 0],\n "soc_init": 0.75,\n "soc_final": 0.05\n}'