Refreshing Entities and Integrations For Recently Powered-On Devices

Working on a Dashboard for the theatre and I’ve run into a road block; hoping for some help.

Using Denon Network Receiver integration for the AVR and HAS Agent for the HTPC.

The HTPC and Receiver sit dormant for days while not in use; and, upon boot-up of the system; they remain dormant until interacted with. HA isn’t updating their availability when they’re powered-on until they are interacted with either physically (for the PC) or via native app (Denon). So, the HA dashboard for the theatre doesn’t work on boot.

Any way to force a refresh of those resources via script?

Do you mean you are shutting down Home Assistant?

You really shouldn’t. And if you need to, make sure all your equipment is on and available before booting up.

Hi Tom,

Thanks for responding.

No, not booting HA.

In this scenario HA is up and running. But, two required devices are off (Denon AVR and the HTPC controlled by HAS Agent).

The script to boot the theatre turns on the PC (via smart socket, pc is set to boot on power recovery), Denon AVR, Projector and the lights I want on on-boot.

So, HA is running at the time. It just doesn’t refresh the availability of the Denon or PC when they are powered-on unless I reload the Denon integration and interact with PC via keyboard first (HAS Agent is set to load on PC start) Denon has a static IP, HTPC has a static IP as well.

I there’s a way to push a refresh via script, I could add a minute delay to give the PC time to fully boot, then send a refresh to HA (?)

You can use this service call to reload an integration

1 Like

Maybe the homeassistant.reload_config_entry service.

      - service: homeassistant.reload_config_entry
        target:
          entity_id: media_player.dennon_avr
1 Like

I’ll try that and followup. Thanks!

Followup in case anyone else is searching for this issue: The issue seems to be with polling; between HA and the router, or the devices and the router/HA. Not sure where the latency is. End result is “just wait a few minutes” and everything works.

I ran the Home Theatre startup script for testing, and I had to take a phone call, so I didn’t interact with it for about 10 mins and all worked fine. Appears 3 to 5 minutes is the time frame.