Hi there,
I'm doing something similar with my panels, but to turn on a water heater.
To set up something like you want, you have to set up a "Scene" in your my.shelly.cloud page. You choose the room the scene relates to and add a "Condition", which in your case should be the Shelly EM, clamp #1 (or #2) > Power Consumption > When the power is less than X watts; Here you should tick the box "Execute the scene when threshold is reached: One Time" so you trigger the heater only once, which I assume you have connected to the 1PM. Then you would set up a second rule to turn it OFF, when power from EM clamp #1 is higher than X watts 1PM turns OFF. Give an interval between both so the 1PM doesn't turn ON/OFF all the time with small fluctuations (for examples, turn ON when power < -1000w and turn OFF when power > -700w).
Something to keep in mind is that if you start sending electricity back to the network you might still pull out a lot depending on how much is your excess and your heater power needs.
Let's say you are producing 1500w and go from consuming total 2000w in your house (say you were cooking or having the kettle on, meaning you were also pulling the extra 500w from the network) down to consuming 1200w after turning something OFF. You get a negative 300w, which is your excess production. Your shelly EM clamp set around the wire bringing power to your home will now read -300w. If you turn on your heater at this point you will get only 300w for free. If your heater requires 1500w to work, then you still need to pull 1200w from the network, which you need to pay.
Hope this helps!