@jordes First part of the automation is ssh call for shutdown.
81b2715c-7ddc-4528-9d6c-c60ea332f0ec-image.png

Finding a working script took me a while, but it works like a charm without any excessive MM modules.

All you need is to setup passwordless ssh connection between HA and MM.