大佬们,我家里用HA和esphome连接nodemcu+sht3x模块可以正常使用由于单位没有ha,端口映射连接上也获取不到设备
想实现单位的nodemcu+sht3x和能连接家里的ha
问题1 目前用esphome连接巴法云,开关可以使用。这个sht3x不能设置state_topic参数,巴法云无法获取温湿度参数。
问题2 ha通过插件可以同步给巴法云,不能巴法云连接ha,按巴法云的配置方法mqtt提示错误
请大佬帮助!
esphome:
name: nodemcu
friendly_name: nodemcu
esp8266:
board: nodemcuv2
logger:
api:
ota:
wifi:
ssid: 22
password: 114441411
ap:
captive_portal:
i2c:
sda: 4
scl: 5
scan: true
id: bus_a
sensor:
- platform: sht3xd
temperature:
name: "Living Room Temperature"
humidity:
name: "Living Room Humidity"
address: 0x44
update_interval: 5s
state_topic: "sht004" 这里出现问题
command_topic: "sht004"这里出现问题
mqtt:
broker: bemfa.com
port: 9501
client_id: 06b453f1d1a34bfab31587dccb3ad20c
topic_prefix: /esp1
on_message:
- topic: /esp1/test
then: # int value = atoi(x.c_str());
lambda: |-
if (x.c_str() == "on"){
id(wind).turn_on();
}else{
id(wind).turn_off();
}
ESP_LOGD("main", "The current version is %s", x.c_str());
switch:
- platform: gpio
pin: D5
id: wind
name: "wind"
inverted: True
state_topic: "wind006"
command_topic: "wind006"
- platform: gpio
pin: D6
id: air
name: "air"
inverted: True
state_topic: "air006"
command_topic: "air006"
|