Ok so I set up an automation that does three things
- Charges at p_batt_forecast when its a negative figure
- Puts the battery into standby when p_batt_forecast is 0
- Puts the battery into ‘Automatic - self consumption’ when above 0 (don’t quite trust it to discharge at p_batt_forecast yet)
Result:
Overynight is charged the battery to just under 50% when there’s a sunny day coming up so not sure why?
Also, the forecast seems to want to charge again in the middle of a sunny day?
I’m on the Ausgrid two way trial tariff that adds an extra 26.58 c/kWh FiT between 14:00 and 20:00 so I don’t want to be charging when this schedule wants to charge. I’ll want to be discharging somewhat but not too much as I want to get over the evening peek which will end at 20:00.
So I want the system to combine the forecast PV and battery capacity and calculate the discharge rate to streatch battery to 20:00 and feed in as much energy during this Ausgrid two way tariff peek. Perhaps I have something misconfigured?
My shell commands:
shell_command:
dayahead_optim: 'curl -i -H "Content-Type: application/json" -X POST -d ''{}'' http://localhost:5000/action/dayahead-optim'
publish_data: 'curl -i -H "Content-Type: application/json" -X POST -d ''{}'' http://localhost:5000/action/publish-data'
post_amber_forecast:
'curl -i -H ''Content-Type: application/json'' -X POST -d ''{"prod_price_forecast":{{(
state_attr(''sensor.cecil_st_feed_in_forecast'', ''forecasts'')|map(attribute=''per_kwh'')|list)
}},"load_cost_forecast":{{(
state_attr(''sensor.cecil_st_general_forecast'', ''forecasts'') |map(attribute=''per_kwh'')|list)
}},"prediction_horizon":33}'' http://localhost:5000/action/dayahead-optim'
post_emhass_forecast:
'curl -i -H ''Content-Type: application/json'' -X POST -d ''{"prod_price_forecast":{{(
state_attr(''sensor.cecil_st_feed_in_forecast'', ''forecasts'')|map(attribute=''per_kwh'')|list)
}},{{states(''sensor.solcast_24hrs_forecast'')}},"load_cost_forecast":{{(
state_attr(''sensor.cecil_st_general_forecast'', ''forecasts'') |map(attribute=''per_kwh'')|list)
}}}'' http://localhost:5000/action/dayahead-optim'
post_mpc_optim_solcast:
'curl -i -H "Content-Type: application/json" -X POST -d ''{"load_cost_forecast":{{(
([states(''sensor.cecil_st_general_price'')|float(0)] +
state_attr(''sensor.cecil_st_general_forecast'', ''forecasts'') |map(attribute=''per_kwh'')|list)[:48])
}}, "prod_price_forecast":{{(
([states(''sensor.cecil_st_feed_in_price'')|float(0)] +
state_attr(''sensor.cecil_st_feed_in_forecast'', ''forecasts'')|map(attribute=''per_kwh'')|list)[:48])
}}, "pv_power_forecast":{{states(''sensor.solcast_24hrs_forecast'')
}}, "prediction_horizon":48,"soc_init":{{(states(''sensor.sonnenbatterie_84324_state_charge_user'')|float(0))/100
}},"soc_final":1.0,"def_total_hours":[2,2,2,0]}'' http://localhost:5000/action/naive-mpc-optim'
# def_total_hours [Deferrable_0=PoolPump] [Deferrable_1=DW] [Deferrable_2=WM&D] [Deferrable_3=tesla]
Automations that call these shell commands are as follows:
- calling dayahead_optim at 05:30
- calling post_mpc_optim_solcast and then publish_data every 5 min
But I’m not calling post_amber_forecast or post_emhass_forecast at all. Don’t understand if these are required.