Add event for HA Restart (to correctly detect power loss)

Issue opened HA shutdown trigger: service doesn’t preserve input changes · Issue #76765 · home-assistant/core (github.com)

Tested this also with notification before and after setting a value. The value is changed, but no preserved.

In the mean time (assuming you have a MQTT broker) you could use an MQTT based entity with the retained flag set. This would correctly restore on startup.

1 Like

Thanks, already did that today. Let’s see how that plays out with the next power loss

Eventually the PC hard drive will get corrupted. It’s just a matter of time. I just don’t want you to have a failed PC to contend with.

Another workaround is that if you know you are going to do a manual shutdown or restart then just create a helper, or helpers, that you use to perform that operation and essentially create an automation that changes your power loss state helper and then calls the shutdown or restart service. This way you know for sure your state helper is going to get set and the appropriate action is going to happen.

I understand that this is still a workaround but is one that is manageable.

1 Like

I actually tried to make an automation for that, but didn’t succeed right away. Will put some more effort in it, thanks.

EDIT: succeeded quite nicely. Made a button for the input helper. Which triggers the automation to restart HA

That could be something to keep in mind. That is if you mean data corruption

I noticed my issue has been closed and marked as “stale”. Can somebody tell me why this happens? So yes, it hasn’t been picked up, there’s no reply or review, and now it’s non-existent again?

HA shutdown trigger: service doesn’t preserve input changes · Issue #76765 · home-assistant/core (github.com)

That happens because there are more issues than volunteers to fix. Once it sits around long enough GitHub autocloses

I understand. But I don’t see any form of prioritization. It would definitely be more user friendly to respond with a MOSCOW categorization, so there’s room for improvement.

Volunteers have to “want” to fix it. Even if there was prioritization, it doesn’t mean it’ll get fixed. Also, you get notified when stale gets added to an issue. Respond in the PR and it won’t get closed.

Thanks @petro, I think I missed the “stale” mail :wink:

Sure, I’m not looking for a guarantee of it being fixed. There’s only so much time and always shifting requirements. I’m a programmer myself and the backlog is always growing. From time to time we groom it and classify at least what we definitely are NOT going to do. That’s a commercial environment.

With volunteers I guess there’s more cherry picking (doing what gets their attention and what’s their strong point). Now a bot is grooming the backlog, so even if it might have been a small thing to fix with rather high value (but being unnoticed), it may be demoted to the trash bin.

I think my question is: what is the process, has at least somebody noticed the issue?

Anyway, off-topic.

Excellent, and since you care about this issue, it’s an opportunity to contribute.

Haha yes I know. Unfortunately I only do C#. Besides my job I have my own company to care about and I also would like need some free time.

1 Like