As it took me a while to figures this out (being a newcomer to openHAB), I thought that I share my (very simple) solution with others, that allows me to make use of any unused renewable electricity.
The below 2 rules will switch on a Shelly Plug S to make use of any “extra power” generated by the SolarEdge inverter. If there is no unused electricity generated (clouds appearing / consumption goes up) the second rule will switch the Shelly Plug S off again.
This will maximise the local consumption of electricity, e.g. by switching on any heating device connected to it.
rule "Heating_on"
when
Item solaredge_generic_373357ff_live_export changed
then
if (solaredge_generic_373357ff_live_export.state > 0.5|kW) {
shelly_shellyplugs_79a136_relay_output.sendCommand(ON)
}
end
rule "Heating_off"
when
Item solaredge_generic_373357ff_live_import changed
then
if(solaredge_generic_373357ff_live_import.state > 0.1|kW) {
shelly_shellyplugs_79a136_relay_output.sendCommand(OFF)
}
end
Hope this will be useful to other newcomers as well.