@waly_de
Thank you very much for this first encouraging reply.
Will I have to change your script? I'm not a computer scientist. It's complicated for me.
Yes, I can retrieve the called power in volts amperes via mqtt. An intier
If value = 0 then no consumption
if the value > 0 then consumption.
If you could be so kind as to guide me, I'd be very grateful.