可能是这样,8266有两个UART口,分别是URAT0和URAT1;UART1只有发送没有接收功能;UART0是完整的发送、接收数据串口,可以使用GPIO1和GPIO3或者使用GPIO13和GPIO15,通常情况GPIO1和GPIO3主要用于主机通信和调试,GPIO13和GPIO15用于和外部设备的串口通信;所以ESPHOME中定义传感器的URAT串口通常使用URAT0,且使用的针脚为GPIO13和GP1O15,也就是D7、D8。
下面这段话是ESPHOME官方的原文:The ESP8266 has two UARTs; the second of which is TX-only. Only a limited set of pins can be used. UART0 may use either tx_pin: GPIO1 and rx_pin: GPIO3, or tx_pin: GPIO15 and rx_pin: GPIO13. UART1 must use tx_pin: GPIO2. Any other combination of pins will result in use of a software UART.
理解不对望见谅并指正