How to use MQTT device discovery?

This is my program:
mqtt:
broker: 10.1.99.66
port: 1883
username: yyymqtt
password: yyymqttmima
discovery: True
discover_ip: True
keepalive:
seconds: 4
——————————————
Because of the cross-subnet issue, we cannot use MDNS; currently, we are using MQTT connection method, and the device can be accessed and integrated normally. However, the physical entity in Esphome always shows “offline”. Could you please advise on how to display the online status normally?

Use ping.

“Use ping for status” is enabled, but it is still not showing online status because of the cross-subnet issue.

He’s saying to use the ping integration.

no actually i was suggesting use_ping_for_status

touche

Yes, it still cannot display that it is online.

Where do I open this, so I can take a screenshot?

Can you in fact ping it from HA terminal? By IP? By name?