Show energy balance of solar production in sitemap with different icons regarding in or out

You might not like my answer in the first place but your imho best bet is to drop sitemaps altogether and replace them with MainUI widgets. Any invest (of your time) in ‘doomed’ old technology options is a waste and better spent on familiarizing yourself with what has become available as alternatives in OH3.

More work short term yes, but savings in the long run.
Don’t worry it’s no one-or-the-other. I myself am also still using sitemaps but anything “new” I want I will only implement based on widgets. There’s so much more you can do with them, and there’s even many templates available you can copy ‘n’ paste.
It’ll be a huge leap in terms of UX, i.e. the look and usability of it.
There’s for example an animated widget to show energy flows of your inverter, battery, grid and consumers.