ok, I took the liberty to refine the flow a bit - you should be able to just import it and only change the entities as described above
it is configured to start the dimmer as soon as there’s more than 0.1kW excess power and stop it as soon as there’s power draw from mains.
you should observe it a little and see if it behaves the way you want it to - and then change the thresholds of the switch and percentage steps to refine it even more
[{"id":"91c85c02cdecad80","type":"switch","z":"37d6892f50d80d96","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"2.5","vt":"num"},{"t":"eq","v":"1.5","vt":"str"},{"t":"gte","v":"0.5","vt":"num"},{"t":"eq","v":"0.2","vt":"str"},{"t":"gte","v":"0.1","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":6,"x":1110,"y":1120,"wires":[["ce00faeb54982ab8"],["21de4e72b8ae40d3"],["3740f6e6b8ac9ba0"],["c070fbed4485437c"],["a551c7a4250f53ee"],[]]},{"id":"a551c7a4250f53ee","type":"api-call-service","z":"37d6892f50d80d96","name":"Dimmer +1%","server":"938bbb0d.d39038","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.boiler_steuerung_dimmer"],"data":"{\"brightness_step_pct\": \"+1\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1390,"y":1140,"wires":[[]]},{"id":"3740f6e6b8ac9ba0","type":"api-call-service","z":"37d6892f50d80d96","name":"Dimmer +25%","server":"938bbb0d.d39038","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.boiler_steuerung_dimmer"],"data":"{\"brightness_step_pct\": \"+25\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1400,"y":1060,"wires":[[]]},{"id":"ce00faeb54982ab8","type":"api-call-service","z":"37d6892f50d80d96","name":"Dimmer +100%","server":"938bbb0d.d39038","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.boiler_steuerung_dimmer"],"data":"{\"brightness_step_pct\": \"+100\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1400,"y":980,"wires":[[]]},{"id":"9c1d25c75bc0b00d","type":"api-call-service","z":"37d6892f50d80d96","name":"Dimmer -1%","server":"938bbb0d.d39038","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.boiler_steuerung_dimmer"],"data":"{\"brightness_step_pct\": \"-1\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1390,"y":1360,"wires":[[]]},{"id":"a86f3c56f89b23b6","type":"api-call-service","z":"37d6892f50d80d96","name":"Dimmer -3%","server":"938bbb0d.d39038","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.boiler_steuerung_dimmer"],"data":"{\"brightness_step_pct\": \"-3\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1390,"y":1320,"wires":[[]]},{"id":"e658143d241adbcf","type":"api-call-service","z":"37d6892f50d80d96","name":"Dimmer -25%","server":"938bbb0d.d39038","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.boiler_steuerung_dimmer"],"data":"{\"brightness_step_pct\": \"-25\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1400,"y":1280,"wires":[[]]},{"id":"f46ca99da1feb9ae","type":"api-call-service","z":"37d6892f50d80d96","name":"Dimmer -50%","server":"938bbb0d.d39038","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.boiler_steuerung_dimmer"],"data":"{\"brightness_step_pct\": \"-50\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1400,"y":1240,"wires":[[]]},{"id":"2a46f031e12ed2c2","type":"switch","z":"37d6892f50d80d96","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"2","vt":"str"},{"t":"gte","v":"1","vt":"num"},{"t":"gte","v":"0.5","vt":"num"},{"t":"gte","v":"0.2","vt":"num"},{"t":"gte","v":"0","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":6,"x":1110,"y":1220,"wires":[["f7d62ae02292de92"],["f46ca99da1feb9ae"],["e658143d241adbcf"],["a86f3c56f89b23b6"],["9c1d25c75bc0b00d"],[]]},{"id":"974f9dbf97ce08c0","type":"server-state-changed","z":"37d6892f50d80d96","name":"sensor.electricity_meter_power_production","server":"938bbb0d.d39038","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.shelly_3em_total_power","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":780,"y":1160,"wires":[["91c85c02cdecad80"]]},{"id":"7a6e1780f91a6535","type":"server-state-changed","z":"37d6892f50d80d96","name":"sensor.electricity_meter_power_consumption","server":"938bbb0d.d39038","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.shelly_3em_total_power","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":770,"y":1200,"wires":[["2a46f031e12ed2c2"]]},{"id":"c070fbed4485437c","type":"api-call-service","z":"37d6892f50d80d96","name":"Dimmer +3%","server":"938bbb0d.d39038","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.boiler_steuerung_dimmer"],"data":"{\"brightness_step_pct\": \"+3\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1390,"y":1100,"wires":[[]]},{"id":"21de4e72b8ae40d3","type":"api-call-service","z":"37d6892f50d80d96","name":"Dimmer +50%","server":"938bbb0d.d39038","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.boiler_steuerung_dimmer"],"data":"{\"brightness_step_pct\": \"+50\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1400,"y":1020,"wires":[[]]},{"id":"f7d62ae02292de92","type":"api-call-service","z":"37d6892f50d80d96","name":"Dimmer -100%","server":"938bbb0d.d39038","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.boiler_steuerung_dimmer"],"data":"{\"brightness_step_pct\": \"-75\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1400,"y":1200,"wires":[[]]},{"id":"938bbb0d.d39038","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]