How did you get the reloading part to work?
Mine is for a different integrationâŚ
UPDATE 02/16/23: There is an updated simpler way doing this that I posted here: Add service integration.reload - #160 by skynet01
OLD WAY:
but it does work if I manually trigger it
Set up automation like this:
- id: auto_reload_emporia
alias: "Keep Emporia running"
mode: single
description: 'Check if Emporia is down'
trigger:
- platform: state
entity_id: sensor.power_av_closet_6 # use any entity that is an emporia device / channel
to: unavailable
for: 00:05:00
- platform: template #check if any sensor gets stuck on the same number for 10 min
value_template: "{{ as_timestamp( utcnow() ) | int > as_timestamp( states.sensor.power_pelican_123.last_changed ) | int + 10*60 }}"
condition: []
action:
- service: rest_command.reload_emporia
data: {}
Then in your main config file
rest_command:
reload_emporia:
url: http://[IP]:8123/api/config/config_entries/entry/[entry_id]/reload
method: POST
headers:
authorization: 'Bearer [Long-Lived Access Token]'
content-type: 'application/json'
- [IP] = home assistant ip
- [entry_id] = go to config/.storage/core.config_entries search for emporia_vue you will see entry_id as the first record
- [Long Lived Access Token:] = Token can be created in the HA menu under your instance name. Yes there is a space between Bearer and the actual token
the whole idea behind this thread was the reload function, so you should not need/use the rest_command at all, and instead be using homeassistant.reload_config_entry
service
Just need to verify, whatâs the proper way of placing the long live access token?
rest_command:
reload_aqara:
url: http://192.168.1.40:8123/api/config/config_entries/entry/62dbc0b5edd9b3026b9078d199cb335c/reload
method: POST
headers:
authorization: eyJ0eXAiOiJblablalongaccesscode
content-type: application/json
So it should it be like this?
rest_command:
reload_aqara:
url: http://192.168.1.40:8123/api/config/config_entries/entry/62dbc0b5edd9b3026b9078d199cb335c/reload
method: POST
headers:
authorization: 'Bearer eyJ0eXAiOiJblablalongaccesscode'
content-type: application/json
hi @Mariusthvdb for the lovelace ui code, how do you key in for the rest of integration logo in your list other than âLuftdatenâ & âPhilipsâ?
It should be like the second example with the word Bearer and a space before the token
homeassistant.reload_config_entry does not allow you to reload integrations thatâs why rest_command is needed.
it allows you to reload config entries. which are integrations you setup via the UI config.
Welp⌠you were right, thanks for telling me about this. I guess you just reference an entity to this service and it will automatically reload the automation thatâs connected to it. Pretty sweet!
only thing youâve got to remember is that when an integration has more entries, you have to reload those individually
just like you would have to do in the UI (click the entry, click 3 dots, and then click reload )
Iâd LOVE to have this.
Some integrations would just stop working at some point and manually reloading is almost the solution to everyone of em.But having a nice automation to do this for me would be a much nicer touch.
Thank you guys.
This is already supported use " homeassistant.reload_config_entry" command, give it an entity thatâs connected to an integration and integration will be reloaded
Iâve tried this, my case is the Eufy Security integration through HACS. Iâve tried Rest API and even a shell command to run curl. Neither would reload the integration
And Ann me to the list of wanting an integration.reload function
Do you have a reload option available on the integrations page? Not all integrations support reloading, if you donât see a reload option for that integration on the main page then Rest Api or homeassistant.reload_config_entry will not work.
No it has the option to reload. And doing so fixes the issue. Just canât find a way to automate it
I am looking for this as a use case for restarting/reloading and integration (not an addon), in homeassistant. Can you tell me where and how I can get the âIDâ of an integration? Thanks
Right, thatâs exactly what the service I linked does. When you add an integration in Home Asssistant it creates a config entry. Thatâs how it keeps track of what integrations you have added to your particular instance and what values you entered for any settings of that integration. This distinction is also how you are able to add some integrations multiple times (multiple config entries for one particular integration)
Since that post about 6 months ago the service appears to have changed since then. It no longer accepts a config entry ID, instead it accepts the ID of an entity, device or area created for a config entry (i.e. integration). It then uses that to find the corresponding config entry and reloads it.
So you no longer need Node RED for this. Just go to the integration you want to reload with an automation and find an entity connected to it, then use homeassistant.reload_config_entry
and pass it to it. You can also get device and area IDs in templates now if you prefer.
though this topic is long closed⌠I dont understand why you would say that. As someone using:
reload_tradfri_integration:
alias: Reload Tradfri integration
mode: restart
sequence:
service: homeassistant.reload_config_entry
data:
entry_id: 37702redacted51
multiple times a day (hope the next dev will see a bump in the tradfri library and this wont be needed any longerâŚ) I can say it still works just fine with the entry_id
it only accepts an entry_id:
The thing is I DO want to use node-red :-)âŚ
So this should reload the integration of which the entity is part?
Ah gotcha. Yea thatâs my understanding. I havenât used it in a while, I forget what I was doing when I posted that. But based on what others have said above and the doc of that service that should do trick.