Ewelink wifi dual power changeover switch

I have both single phase grid connection and a solar charged battery with inverter.
I want to change power to come from the inverter if the grid fails which is an automatic feature of an automatic changeover switch (ATS ) of course.
But I also want to change to the inverter at 3pm, when my power price doubles (until 9pm).
I then want it to stay on inverter power until my solar array starts producing power in my grid connected PV system - until 3pm again.
The only wifi controllable changeover switch I can find is Ewelink controlled.
Does anyone know if there is an integration for these switches yet?
Yes, I know there is and I have the Sonoff integration, but I can’t figure out if it’s compatible with the ATS. It’s important to me to have this controlled locally, not in the cloud.
I would consider a completely separate stand-alone timer controller too (maybe even preferred).
Anyone tackle anything like it?