Configuring an automation trigger for HASS shutdown

so what is the purpose of your message?
if you need help, please do it properly.