ESPhome device goes unavailable and shows up as discovered after it was rebooted

I just put together a small presence sensor from an ESP32-C3 SuperMini and a LD2410C module. I succesfully flashed it and added to HA. It works until I unplug the sensor from power. After plugging it in, it still shows as unavailable in HA. If I open the ESPhome dashboard, it shows the device twice: once as newly discovered, and once as online.


I cannot do anything with it. If I delete the online one, and adopt the discovered, I have to reflash the whole config. What can cause such an issue?

I found a line in the logs that using _ in the name of the device is discouraged as it can cause issues with DHCP. I substituted it with - and also set the device to static IP. It seems to solve the issue so far.