I have some python scripts which utilize the teslapy library to update the utility plan, these can be called directly from home assistant.
There is a site tariff endpoint with the FleetAPI that allows you to inject the utility plan.
For forecasting I use the excellent EMHASS add-on: An energy management optimization add-on for Home Assistant OS and supervised
It gives me very detailed forecasts and control signals for my battery and other household loads. Here is my plan for the next 24 hours.