In my case, I’m storing Harmony state in logic variables.
So when an activity is started I update the logic variable.
When an activity is stopped I set that logic variable to “None”.
I notice that when I poweroff my system, the logic variable indicates “PowerOff” as activity.
So it might be that what’s happening is not that Harmony triggers “Activity stopped” for your current activity but instead Harmony triggers “Activity started” for activity “PowerOff”.
Hope this helps.
Anyway: I suggest adding a flow for “Activity started” which just adds a notification with the value of the activity tag and another one flow “Activity stopped” with the same thing.
This way, you can check your notification timeline to see what’s happening.