Eliminate the need for restarts

Compared to other home automation products, Home Assistant currently requires far more restarts (or reloads) to perform basic operations. The following operations should not require a restart/reload:

  • Add or modify an entity
  • Add or modify an automation

Ideally, additions/modifications should be handled incrementally. In other words, adding/modifying a single entity should only require loading that one entity; it should not require (re)loading all other entities. For example, changing a single automation currently does not require a restart but does require reloading all automations. It should only require reloading the modified automation.

This capability is found in other products including one that is 20 years old so itā€™s not a radically new concept. Advantages include:

  • Fewer disruptions.
    The system continues to function normally, without interruption, while automations and entities are added/modified.
  • Faster modifications.
    It would no longer require waiting for the system to perform a complete restart which may involve a lengthy discovery process plus ā€˜settling timeā€™ for some sensors to become available.

thanks for writing this! Hope this will get the necessary traction and attention from the devā€™s.
Hope (expectā€¦) you will be involved when developing this for HA.

3 Likes

This is really the only thing that bugs me in HA (coming from HomeSeer)

2 Likes

Thereā€™s a lot to like about Home Assistant but this curious need to restart for basic operations is an unwelcome ā€˜featureā€™, especially for anyone who has used other home automation software.

Iā€™m familiar with about a half-dozen products (ranging from hands-on usage to just ā€˜book-learningā€™) and only MisterHouse required a full restart. openHAB doesnā€™t require a full restart but it does reload the entire (for example) Items file whenever it is changed. So not a full restart but still not as refined as other products that donā€™t need to reload the whole shebang just because one thing changed.

The fact Home Assistant is now several years old and still requires restarting for these basic operations, implies (to me) that the architectural changes needed to avoid restarting are probably non-trivial.

1 Like

Yes. THIS.

Would LOVE the ability to reload SENSORS & BINARY_SENSORS & possibly template SWITCHES.

More and more I find myself making duplicate sensors / switches to display things differently (some of which could be fixed with Lovelace enhancements Iā€™m guessing [conditional icons / icon colors, state changes { ā€œonā€: ā€œOnā€, ā€œoffā€:ā€œOffā€, ā€œclearā€:ā€œoffā€, etc.}]).

I know the infrastructure is in place for this with something flow I forget what itā€™s called. Itā€™s just a matter of migrating all of the integrations over to that take a lot of time from what I gather.

Theyā€™re targeting the most popular integrations first is what Iā€™m seeing, which makes sense. I agree though, some of my MQTT devices freak out when they loose HAā€¦ which is a problem of itā€™s ownā€¦

I have spent countless hours staring at terminal screen waiting for home assistant to restart. Particularly when first learning HA and then setting everything up (is anyone ever actually ā€œdoneā€ setting it up?)

Iā€™m actually in the same boat right now. Iā€™ve got a memory leak somewhere and Iā€™ve had to restart a bajillion times trying to narrow down where it is. The ability to load and unload stuff on the fly would help tremendously.

Long story short less restarts would make configuration and troubleshooting a much less painful experience. +1 from me.

3 Likes

This not require restart if done from UI.
Command line maybe require ā€œreload configā€ but thisnis unclear.

Agreed that entity changes could do without reboots

The above is not the full story, Iā€™ve heard Taras speak in depth about how this works on other platforms (go read the ā€˜Alternative HASSā€™ thread, itā€™s a really educational read).
I CAN reload automations without a restart but as @klogg will tell you thatā€™s a recent inovation if you use packages (I do).
At the moment Iā€™m really hesitant about restarts and basically save up minor changes till ā€œI really need this oneā€ and then the whole raft gets done. Ever tried to troubleshoot multiple changes (yes, thank balloob (heā€™s a god in this simulation isnā€™t he ? :rofl: ) for check config but ā€¦ )

Say what again? Since when? Scripts and groups too? I thought this would never be supported. I literally just redid my configuration back to non-packages a month ago because I got tired of restarting to test stuff.

Canā€™t remember exactly but about May or June this year
Not sure about groups, I rarely use them, but they are defined in my packages

1 Like

This has been available for a while nowā€¦and Iā€™ve been on since ~ version .26

In the UI, Configuration ==> Server Control

Are there somethings that are best done with a reboot, yesā€¦ but they are few and far between.

You missed the pointā€¦

When you use packages the ā€œserver control->reloadā€¦ā€ controls didnā€™t work for those domains (automation, scripts, etc) if they were contained in a package. You were forced to do a restart to cause those things to reload. Apparently the ability to ā€œreloadā€ those in packages as well was just recently quietly added.

Iā€™m not sure you understood. I was referring to ability to do this when utilizing packages. I mentioned that I converted back so I didnā€™t have to restart so often.

Iā€™m not even sure the information provided by @Mutt is correct. Iā€™ve been going back through all the Release Notes trying to find when this changed with no luck (so far).

As a matter of fact all I can find are github issues where @arsaboo makes it abundantly clear this feature will never be implemented because of issues with the back end. Perhaps this has changed (I hope it has!) but I cannot find any documentation that says so.

https://github.com/home-assistant/home-assistant/issues/9864
https://github.com/home-assistant/home-assistant/issues/16167
https://github.com/home-assistant/home-assistant/issues/16117

And this doesnā€™t take into consideration that you absolutely must restart whenever adding any kind of entity (sensors, devices etc.)

Have you had a chance to verify this yet @finity? Iā€™m trying to track down a memory leak right now and really donā€™t want to change anything until Iā€™ve got that figured out. Youā€™d think they would have announced it - it looks like a lot of people were looking for it to happen.

I missed the packages referenceā€¦ which I had never heard of before. Which explains why I have never seen this issue :slight_smile:

My whole system is package based, my configuration file is 27 lines long (3 of those are comments) I have 1089 lines in my ui-lovelace.yaml, 33 z-wave devices, 300 sensors, 69 scripts and 179 automations.
I donā€™t have a scripts.yaml or an automation.yaml
Youā€™d think Iā€™d notice if I couldnā€™t reload an automation or a script

I have no issue with the packages implementation.

Adding a package with nothing in it but a couple of input_boolean s would take 5 minutes including a restart. Do it, then add an automation, reload automations and see for yourself if you can get one boolean to switch the other.

Once you have encountered a halting restart, showing the ever lasting Logo and ā€˜Loading dataā€™ you know some of these small alterations is flawed, even when the config checker didnā€™t complain.

Because of that, Ive learned to always restart after changes, even small ones, so I know what to revert to if the proverbial shit hits the fanā€¦

1 Like

VERY good point, I may have to rethink that MO ā€¦

The startup time of 90sec+ (and config check of 30sec+) is the only major ugliness left for me in HA and I already moved from raspi to an i5-5200u/8GB. I donā€™t remember openhab being any better, but in ioBroker one could at least reload each integration.
I donā€™t mind the waiting that much, but multiple restarts caused real acceptancy problems within the family, so I had to move all the maintenance to the night :wink:

I recently discovered Appdaemon where changes are detected and reloaded without restarts. I wished something similar would be possible with the configuration.yaml.