Devices not available after a few days

Home Assistant 2022.7.6
Supervisor 2022.07.0
Operating System 8.2
Frontend 20220707.1 - latest
MQTT Backend

some devices are displayed as “not available” after a few days.
those are always devices with ESPHome and ESP32.

the web pages of the devices are always accessible and the messages arrive in the MQTT broker.
only Home Assistant insists that the devices are not there.

restarting HA does not work. waiting helps, after a few days the devices are back.

currently i’m testing Iobroker to see if the problem occurs there, but I’d like to stay with HA.

would switching to the API solve the problem?
this also affects devices that are connected via a VPN (Ipsec, Wireguard) and the API does not work with it.