You can find the information in the official documentation of the ethernet component: Ethernet Component — ESPHome
But here is my (working) YAML:
esp32:
variant: esp32c3
board: esp32-c3-devkitm-1
framework:
type: esp-idf
ethernet:
type: DM9051
clk_pin: GPIO07
mosi_pin: GPIO10
miso_pin: GPIO03
cs_pin: GPIO09
interrupt_pin: GPIO08
reset_pin: GPIO06
clock_speed: 8MHz
Add this to see some basic network information:
text_sensor:
- platform: ethernet_info
ip_address:
name: IP Address
dns_address:
name: DNS Address
mac_address:
name: MAC Address
binary_sensor:
- platform: status
name: "Status"