What are you trying to achieve?
Maybe if you share your end goal it would be easier to help maybe with a different approach other than stopping Add-ons and integrations, which is odd.
The Kodi integration really slows down my HA startup (~2m) if the Kodi instance is not present while booting up. (Kodi is on my pc so if the exe is not running or the pc is off then I have an issue)
But there are several posts about it, I don’t want to hijack this thread
Yes, you can reload ENTIRE integrations using @swa72’s script.
In order to get your entry_id, (at least this is what I did), view the latest backup that has the integration available (you may need to do a backup if this is a new integration).
Download the backup to your Desktop computer.
Open the Backup file (I use Winrar for my PC), and locate .\homeassistant.tar.gz (double-click this)
Then open the folder “data”
Then open the folder “.storage”
Locate the file “core.config_entries” and open it (choose “Notepad” as the program that reads it)
Do a search for the integration, and you’ll see the entity_id right above the integration name.
Finally, write a script using the template (copied from above post by @swa72 for convenience):
If your integration have an entity, you can try going to Developer Tools, Template tab and then type this (please replace the entity_id for the one you are looking for):
I would’ve liked this to work, but when I try this I receive a list of 3-4 possible entry_ids. When I swap to a different entity some of the numbers from the first list remain. I have tested a number of entity and sometimes the correct entry id is listed in the last place, sometimes not.
I personally pulled the information from a backup file as I couldn’t get to this information any other way (this includes File Editor, Studio Code Server or Samba Share beforehand. So I think your way is pulling in additional numbers besides the entry_id? Or might all of these ids be needed to reload that device?
I did do some more digging and found the the way to pull only a single entry that corresponded to that entity (ie. light/switch rather than light/switch AND power consumption):
I tested the above in Template tab of Developer Tools and matched the test results with my core.config_entries file (in my backup file of HA) of a light entry and they match.
Yeah, that can happen. 8ne device could have entities provided by different integrations, like whe a tuya wifi bulb have a device tracker from your router integration and a power entity from powercalc, as an example, all the 3 integrations would be shown.
Great!
Good catch!
But by the way, I’m pretty sure this will do the job in the same way:
HA is a team sport and we’re all here to learn with each other and improve
Very nice, I haven’t tried it on entities, but I know this won’t work for integrations. Still, it’s a great idea in creating an automation that would reload an entity that goes unavailable (I had issues with my Kasa smart switches going unavailable until I created an Asus aiMesh network - couldn’t get the Zigbee thing to work for the few Zigbee devices that I had, which had a constant stream of AC power)