The problem with shutdown automations is timing. If the integration you’re using has already moved into the stopping process, the automation appears not to work.
I’ve tried a few automations like that, and while some work reliably, others don’t (including setting an input_datetime). The answer unfortunately is experimentation.