About PM devices aka Shelly 1PM or Plug S. Currently the device cannot measure negative and positive consumption which mean cannot be used as you expect. For Gen2 devices this is hardware limitation and there is no way to fix that.
Shelly PM mini, 1PM Mini, 1PM Gen3 and upcoming PlugS Gen3 use different power measurement chip which can report positive and negative energy with firmware 1.4. They can do the job same as EM/3EM devices especially for balcony solar systems.