本帖最后由 gmshiwoge 于 2023-3-2 18:08 编辑
不知道是esphome跟新了 还是怎么了 今日编译一天接收的外红码什么通过mqtt发送 都接收不了 node-red和mqttx调试软件都收不到esphome的web有提示收到遥控器
贴上esphome配置
esphome:
name: broadlink4
platform: ESP32
board: esp32dev
substitutions:
switch_name: broadlink_1
logger:
#esp32_ble_tracker:
#bluetooth_proxy:
#api:
ota:
sensor:
# Wifi signal
- platform: wifi_signal
name: "${switch_name}_wifi"
update_interval: 60s
id: wifi1
wifi:
ssid: xxxxx
#password: !secret wifi_password
ap:
ssid: "${switch_name}"
password: "12345678"
captive_portal:
web_server:
port: 80
mqtt:
broker: 192.168.1.122
port: 1883
username: mqtt
password: mqtt
discovery: true
button: #重启
- platform: restart
name: "${switch_name}_restart"
# inverted: true
id: Restart
##########按红外接收模块#####################
remote_receiver:
pin:
number: GPIO23
inverted: True
# mode: INPUT_PULLUP
dump: all
on_nec:
then:
- mqtt.publish:
topic: esphome32/senso/ir
payload: !lambda |-
char temp[20];
sprintf(temp, "%d:%d", x.address, x.command);
ESP_LOGI("main", "rcv nec: %s", temp);
return temp;
on_panasonic:
then:
- mqtt.publish:
topic: esphome32/senso/ir
payload: !lambda |-
char temp[20];
sprintf(temp, "%d:%d", x.address, x.command);
ESP_LOGI("main", "rcv pan: %s", temp);
return temp;
on_sony:
then:
- mqtt.publish:
topic: esphome32/senso/ir
payload: !lambda |-
char temp[20];
sprintf(temp, "%d:%d", x.data, x.nbits);
ESP_LOGI("main", "rcv sony: %s", temp);
return temp;
on_jvc:
then:
- mqtt.publish:
topic: esphome32/senso/ir
payload: !lambda |-
char temp[20];
sprintf(temp, "%d", x.data);
ESP_LOGI("main", "rcv jvc: %s", temp);
return temp;
on_rc5:
then:
- mqtt.publish:
topic: esphome32/senso/ir
payload: !lambda |-
char temp[20];
sprintf(temp, "%d:%d", x.address, x.command);
ESP_LOGI("main", "rcv rc5: %s", temp);
return temp;
|