ESPHome device shows offline

Hi!

I’m new at HomeAssistant. I have a raspberry pi3b+, and an esp8266 d1 mini pro, which I would like to do an automated irrigation system. My previous router died so I got a new one Asus RT-AX55.
Now my device is offline and I cannot do anything about it. previously it worked. I read some articles about using static IP. ESPHome device shows offline but connected when I check my router and also in esphome setting status_use_ping, but that also doesn’t work. Maybe I did the static IP wrong. This is what I wrote in the code:

# Optional manual IP
  manual_ip:
    static_ip: 192.168.50.123
    gateway: 192.168.50.1
    subnet: 255.255.255.0

Log warnings:

WARNING Can’t connect to ESPHome API for irrigation-system.local: Error resolving IP address: [Errno -5] No address associated with hostname

if I use the static IP code:

WARNING Can’t connect to ESPHome API for 192.168.50.123: Error connecting to (‘192.168.50.123’, 6053): [Errno 113] Connect call failed (‘192.168.50.123’, 6053

Sorry if my English is bad.

Does your router show the device as getting a dhcp address?

I made it static that’s what i read, but it didn’t work. I flashed the esp8266 and now it works
ESP8266 Various Connection Issues · Issue #455 · esphome/issues · GitHub this is where I read it.