Hi and home energy

Hi
looking aruond to see if i can find somthing that i can use fore my home energy control
i have 3 solar systems, fronius 7.7 kwp sma 7.7 kwp growatt 1.8 kwp
som batterys that will be used about 50 kwh

later this year i will have new energy (electricity) bill form, per 1 hour

somhow i want to

  1. log my meters , house energy meter ,han port, serial 115k 8n1
    2 use my electricity i my best way

this is when it going to be difficult
to low price to sell, better to dump it in hot water, but i dont want to buy
or dump it in battery, to use later or sell later

so i have to read the energymeter, look if there are selling or buying
and have my own pricetag for what i want to do

i can enter tomorrows price manually , or maybee reeding it from a api on the webb

then let home assistant decide to what output should be activated,
ex dump energy in hot wator, or charge batterys

somthing like that
is this even possible in home assistant?

old analog gay , but i have done som programming in machinecode (6502 & Z80) and basic