Requiring Advice/Assistance - Ventilation: Shelly 2PM Gen 4 with 3-level switch

I was wondering and hoping if someone could help me with this, I’m very new to HA and I want to automate my 3-level switch.
The only thing I’ve been able to find is this post, it has exactly what I want and the 3-level switch that I got but the issue is that it’s for a Shelly 2.5 and not for the Shelly 2PM gen 4.

I was hoping if someone could code it for a Shelly 2PM gen 4, I talked to the guy who made this forum post and he said the following:
“I think the Shelly 2PM Gen 4 is perfectly suitable for your use case. You’ll probably need to modify the YAML file (GPIO pins and possibly the platform: ade7953). I don’t have any experience with Gen 4. It’s best to reply to the relevant thread for this. You can also search for other circuit examples from others using Gen 4.”

Also I would need help which wire to connect where since the picture of the forum post of the Shelly 2.5 doesn’t match the numbers on the Shelly 2PM Gen 4

Also I don’t care if I have to end up using stock firmware for it to work, I just know that he is using that, if it works without it and just on stock then that’s also fine for me.

If I need something instead of the Shelly 2PM Gen 4 then please also do tell me, I don’t care for the brand, in the end I just want this thing to work properly :joy: