@jorgennarduino上的Tx连接到Wemos D1 mini中的Rx。但当它出现时,Wemos D1将断开网络,状态变为离线。

我想试试MQTT而不是ESPHome。希望会有不同的结果。非常感谢:+1:

您是否可能将gpio0连接到地面,从而将其锁定在闪光模式?

另外arduinos一般是5v逻辑,esp是3v3逻辑。你在kevel移位吗?

我的吉尔风声传感器有进展了。
到目前为止,我已经运行了它,并在内部通过uart读取传感器,并在esphome桌面的日志窗口中正确发布变量。它显示为一个集成,但没有显示我的子传感器。

这是我当前的Yaml文件:

esphome:名称:vind平台:ESP32板:esp-wrover-kit包括:- windsonic.h wifi:名称:“阴暗面”密码:“xxxxxx”#启用后备热点(俘虏门户),以防wifi连接失败美联社:名称:“vind后备热点”密码:“xxxxx”captive_portal: #启用日志记录器:baud_rate: 0 #使家庭助理API API:密码:19463331伟德国际"xxxxxx" ota: password: "xxxxxxx" uart: id: wind tx_pin: GPIO1 rx_pin: GPIO3 baud_rate: 19200 sensor: - platform: custom lambda: |- auto my_Windsonic = new Windsonic(id(wind));App.register_component (my_Windsonic);返回{my_Windsonic - > retning_sensor my_Windsonic - > hastighet_sensor};传感器:- name: "Vindretning" unit_of_measurement:°Grader accuracy_decimal: 3

她是我的windaonic.h文件:

#include“esphome.h”类Windsonic:公共组件,公共传感器,公共传感器,公共uartdevice {public:windsonic(uartcomponent *父节目):uartdevice(父){} sensor * hastighet_sensor = new sensor();传感器* Retning_Sensor = New Sensor();浮动恢复;浮动匆匆;void setup()覆盖{//在此处over do do do} void循环()覆盖{//使用Arduino API读取数据,例如字符串行= READSTRINGUNTIL('\ n');string r = line.substring(7,10);string s = line.substring(14,19);Retning = R.Tofloat();hastighet = s.tofloat();Retning_Sensor-> Publish_state(Retning); hastighet_sensor->publish_state(hastighet); retning = 0; hastighet = 0; r = ""; s = ""; } };

我是不是做错了什么让我的变量出现在爱蕾丝里?

根据我对文档的理解,返回行应该指向my_sensor而不是my_windsonic

这是你在定义中给它的名字,两者都有测试,没有区别。
因此,在yaml文件中必须有某种方式来定义要显示的内容。

重读?你在esphome中所做的任何事情都不会配置你的Lovelace,你需要在ha前端进行配置。

为了更清楚一点,在Home assistant的配置中,这个windsonic显示在单位列表中,但2个传感器没有以实体的形式显示。所以在性爱编辑器里没有什么可抓的。

所以UI所以没有什么?

到目前为止没有。

这是对这个ESP日志中的行:

[00:58:40][D][传感器:092]:'Vindhastighet':发送状态0.00000 ms with 3 decimal of accuracy

两个值中为0的原因是目前传感器是室内的,我已经用一个风扇对传感器进行了测试。所以读起来是正确的

在devtools日志中我发现这个重复:

获取初始数据时出现错误:等待API响应时超时!

仍然没有显示ui

ESPHome定制传感器有什么限制吗?ESP正在做我应该做的事情,对我来说,它似乎对传感器名称和数据类型有限制。

这个设备的集成标签在ha中到底显示了什么?源自英国始于1946

这就是集成和单元所表现的

只是为了确保其他一切都工作,因为它应该尝试添加一些已知的工作组件,如uptime或rssi。

增加了正常运行时间传感器,但没有显示

你能发布你的完整的esphome日志吗?

这里是ESPHome仪表板的日志:

ESPHOME DASHBOARDMORE_VERT OTA(空中)内存CAM1MORE_VERT。完整路径:/ config/eSphome/cam1.yaml上传编辑显示日志验证内存lcd2more_vert。完整路径:/ config/eSphome/lcd2.yaml上传编辑显示日志验证内存ilcepaturmore_vert。完整路径:/ config/eSphome/temperatur.yaml上传编辑显示日志验证内存vindmore_vert。完整路径:/ config/eSphome/vind.yaml上传编辑显示日志验证显示日志Vind.yaml信息读取配置/config/eSphome/vind.yaml ...信息从Vind.local使用Eyphome API Info连接到Vind的信息.local:6053(192.168.2.155)信息成功连接到vind.local [01:42:25] [i] [App:100]:Esphome 1.14.3 2012年4月11日,01:18:25编译[01:42:25] [WiFi:415]:[01:42:25] [WiFi:283]:SSID:[删除] [01:42:25] [C] [WiFi:284]:IP地址:192.168.2.155 [01:42:25] [Wifi:286]:BSSID:[编辑] [01:42:25] [Wifi:287]:hostname:'vind'[01:42:25] [Wifi:291]:信号强度:-50 db▂▄▆█[01:42:25] [Wifi:295]:频道:1 [01:42:25] [WiFi:296]:Subnet:255.255.255.0 [WiFi:297]:网关:192.168.2.1 [01:42:25] [C] [WiFi:298]:DNS1:192.168.2.1 [01:42:25] [Wifi:299]:DNS2:0.0.0.0 [01:42:26] [e] [UART:096]:从UART定时阅读在byte 0出来![01:42:26] [传感器:092]:'风向':发送状态0.00000°度,3小数精度[01:42:26] [D] [传感器:092]:'风速':发送状态0 0.00000 ms,具有3个精度的小数[01:42:26] [C] [UART:040]:UART总线:[01:42:26] [C] [UART:042]:TX引脚:GPIO1 [01:42:26][C][uart:045]: RX Pin: GPIO3 [01:42:26][C][uart:047]: Baud Rate: 19200 baud [01:42:26][C][uart:048]: Stop bits: 1 [01:42:27][E][uart:096]: Reading from UART timed out at byte 0! [01:42:27][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:27][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:27][C][uptime.sensor:030]: Uptime Sensor 'Uptime Sensor' [01:42:27][C][uptime.sensor:030]: Unit of Measurement: 's' [01:42:27][C][uptime.sensor:030]: Accuracy Decimals: 0 [01:42:27][C][uptime.sensor:030]: Icon: 'mdi:timer' [01:42:28][E][uart:096]: Reading from UART timed out at byte 0! [01:42:28][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:28][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:28][C][logger:175]: Logger: [01:42:28][C][logger:176]: Level: DEBUG [01:42:28][C][logger:177]: Log Baud Rate: 0 [01:42:28][C][logger:178]: Hardware UART: UART0 [01:42:29][E][uart:096]: Reading from UART timed out at byte 0! [01:42:29][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:29][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:29][D][api:067]: Disconnecting Home Assistant 0.108.2 (192.168.2.42) [01:42:30][E][uart:096]: Reading from UART timed out at byte 0! [01:42:30][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:30][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:31][E][uart:096]: Reading from UART timed out at byte 0! [01:42:31][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:31][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:31][C][captive_portal:169]: Captive Portal: [01:42:32][E][uart:096]: Reading from UART timed out at byte 0! [01:42:32][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:32][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:32][C][ota:029]: Over-The-Air Updates: [01:42:32][C][ota:030]: Address: vind.local:3232 [01:42:32][C][ota:032]: Using Password. [01:42:33][E][uart:096]: Reading from UART timed out at byte 0! [01:42:33][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:33][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:33][C][api:095]: API Server: [01:42:33][C][api:096]: Address: vind.local:6053 [01:42:34][E][uart:096]: Reading from UART timed out at byte 0! [01:42:34][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:34][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:34][D][api.connection:583]: Client 'Home Assistant 0.108.2 (192.168.2.42)' connected successfully! [01:42:35][E][uart:096]: Reading from UART timed out at byte 0! [01:42:35][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:35][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:36][E][uart:096]: Reading from UART timed out at byte 0! [01:42:36][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:36][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:37][E][uart:096]: Reading from UART timed out at byte 0! [01:42:37][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:37][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:38][E][uart:096]: Reading from UART timed out at byte 0! [01:42:39][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:39][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:40][E][uart:096]: Reading from UART timed out at byte 0! [01:42:40][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:40][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:41][E][uart:096]: Reading from UART timed out at byte 0! [01:42:41][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:41][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:42][E][uart:096]: Reading from UART timed out at byte 0! [01:42:42][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:42][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:42][D][api:067]: Disconnecting Home Assistant 0.108.2 (192.168.2.42) [01:42:43][E][uart:096]: Reading from UART timed out at byte 0! [01:42:43][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:43][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:44][E][uart:096]: Reading from UART timed out at byte 0! [01:42:44][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:44][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:45][E][uart:096]: Reading from UART timed out at byte 0! [01:42:45][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:45][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:46][E][uart:096]: Reading from UART timed out at byte 0! [01:42:46][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:46][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:47][E][uart:096]: Reading from UART timed out at byte 0! [01:42:47][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:47][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:48][E][uart:096]: Reading from UART timed out at byte 0! [01:42:48][D][sensor:092]: 'Wind direction': Sending state 0.00000 °Degrees with 3 decimals of accuracy [01:42:48][D][sensor:092]: 'Wind speed': Sending state 0.00000 ms with 3 decimals of accuracy [01:42:48][D][api.connection:583]: Client 'Home Assistant 0.108.2 (192.168.2.42)' connected successfully! © 2019 Copyright ESPHome, Made with MaterializeESPHome 1.14.3 Documentation

@nickrout我使用arduino版本的3.3v逻辑。我从官方渠道核实过了在这里.谢谢你的提示

@nickrout在Wemos D1 mini上的引脚除了Tx Rx引脚是清楚的,因为我把那些引脚连接到我的arduino上的串行。我也尝试用tiny代替arduino,但是结果是一样的。