esphome:
name: tuya-ir-1
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "12345678"
ota:
password: "12345678"
wifi:
ssid: Xiaomi_60A4
password: abcD@0808
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "tuya-ir-121"
password: "12345678"
manual_ip:
static_ip: 192.168.31.66 #自己定义的地址
gateway: 192.168.31.1 #网关
subnet: 255.255.255.0
captive_portal:
remote_receiver:
pin:
number: GPIO5
inverted: True
mode: INPUT_PULLUP
dump: raw
idle: 40ms
remote_transmitter:
pin: GPIO14
carrier_duty_percent: 50%
switch:
- platform: template
name: "客厅空调"
id: esp32_ac_swi
turn_on_action:
then:
- switch.template.publish:
id: esp32_ac_swi
state: ON
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
code: [3252, -1635, 419, -393, 419, -420, 366, -1236, 420, -394, 415, -1211, 416, -396, 393, -420, 419, -402, 418, -1210, 419, -1208, 419, -393, 392, -420, 421, -418, 391, -1215, 413, -1210, 417, -404, 419, -393, 420, -393, 417, -396, 417, -394, 418, -421, 392, -396, 418, -393, 419, -402, 392, -422, 392, -419, 417, -397, 416, -394, 419, -1209, 418, -394, 420, -394, 418, -429, 392, -395, 416, -395, 420, -419, 392, -395, 417, -1212, 419, -391, 418, -396, 418, -402, 419, -419, 394, -1208, 419, -1209, 421, -1206, 419, -1209, 418, -1208, 418, -1211, 416, -1222, 418, -1207, 417, -397, 417, -395, 391, -1236, 417, -397, 418, -393, 419, -392, 421, -401, 418, -395, 416, -395, 419, -393, 420, -419, 393, -1210, 417, -1210, 418, -394, 416, -406, 419, -1210, 416, -394, 420, -393, 416, -396, 418, -1210, 418, -395, 417, -1209, 420, -402, 420, -1208, 418, -394, 391, -421, 419, -394, 418, -394, 392, -446, 392, -395, 419, -402, 391, -448, 391, -395, 390, -422, 417, -396, 419, -396, 415, -395, 417, -395, 418, -404, 415, -397, 417, -395, 421, -392, 417, -394, 417, -396, 420, -395, 417, -393, 390, -431, 417, -396, 394, -420, 415, -396, 416, -396, 418, -395, 417, -395, 417, -396, 417, -403, 417, -394, 419, -394, 417, -397, 417, -395, 418, -395, 418, -395, 416, -395, 419, -403, 414, -398, 416, -397, 417, -395, 416, -399, 414, -396, 418, -1209, 417, -396, 418, -403, 419, -392, 419, -1208, 418, -1211, 419, -1209, 391, -1236, 415, -397, 417, -1210, 418, -395, 419] #这个code改成自己识别到的raw码
turn_off_action:
then:
- switch.template.publish:
id: esp32_ac_swi
state: OFF
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
code: [3252, -1637, 415, -398, 417, -395, 418, -1210, 391, -422, 415, -1214, 391, -419, 392, -421, 416, -404, 392, -1236, 418, -1209, 420, -394, 419, -392, 417, -396, 404, -1224, 417, -1210, 419, -402, 394, -419, 416, -397, 418, -395, 390, -422, 417, -394, 420, -392, 419, -395, 391, -430, 417, -395, 420, -392, 417, -422, 392, -394, 416, -1212, 416, -396, 420, -394, 417, -402, 418, -395, 419, -394, 446, -366, 420, -392, 419, -1209, 418, -394, 418, -395, 417, -403, 418, -396, 419, -1207, 418, -396, 418, -394, 418, -395, 416, -395, 419, -393, 420, -401, 399, -1230, 420, -392, 420, -1208, 417, -1211, 419, -1207, 420, -1208, 418, -1209, 419, -1210, 416] #这个code改成自己识别到的raw码
- platform: template
name: "空调强劲风"
id: esp32_fan_swi
turn_on_action:
then:
- switch.template.publish:
id: esp32_fan_swi
state: ON
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
code: [3255, -1635, 416, -396, 419, -419, 390, -1238, 391, -396, 418, -1210, 420, -395, 420, -389, 420, -402, 418, -1208, 420, -1207, 422, -418, 391, -420, 392, -395, 403, -1225, 420, -1207, 418, -403, 418, -395, 418, -420, 394, -420, 390, -396, 418, -397, 416, -394, 417, -394, 392, -456, 391, -395, 418, -394, 420, -394, 417, -394, 419, -1209, 418, -394, 392, -421, 419, -402, 417, -396, 416, -396, 421, -391, 419, -394, 419, -1209, 415, -396, 418, -396, 418, -402, 420, -1208, 417, -396, 416, -395, 418, -1210, 417, -1210, 419, -1211, 420, -390, 417, -405, 417, -394, 421, -1220, 379, -1237, 420, -391, 418, -397, 416, -420, 365, -1237, 418, -1210, 416] #这个code改成自己识别到的raw码
turn_off_action:
then:
- switch.template.publish:
id: esp32_fan_swi
state: OFF
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
code: [3253, -1636, 418, -395, 418, -398, 413, -1211, 421, -392, 417, -1210, 397, -441, 393, -395, 420, -402, 417, -1208, 419, -1209, 418, -396, 418, -394, 416, -397, 416, -1210, 418, -1208, 394, -430, 389, -423, 417, -395, 392, -421, 417, -394, 417, -396, 420, -393, 419, -394, 419, -401, 418, -395, 418, -393, 418, -397, 416, -394, 417, -1210, 419, -395, 415, -397, 417, -405, 419, -392, 419, -394, 393, -444, 390, -398, 417, -1211, 423, -389, 391, -422, 416, -404, 392, -1237, 416, -395, 418, -394, 419, -1210, 416, -1210, 419, -1209, 420, -393, 418, -403, 418, -394, 418, -1210, 418, -1210, 417, -395, 418, -394, 419, -394, 417, -1210, 418, -1210, 419] #这个code改成自己识别到的raw码
- platform: template
name: "电视盒子"
id: esp32_box_swi
turn_on_action:
then:
- switch.template.publish:
id: esp32_box_swi
state: ON
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
code: [8980, -2292, 547]
turn_off_action:
then:
- switch.template.publish:
id: esp32_box_swi
state: OFF
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
code: [9007, -2290, 518]
- platform: template
name: "电视"
id: esp32_TV_swi
turn_on_action:
then:
- switch.template.publish:
id: esp32_TV_swi
state: ON
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
code: [3989, -3998, 528, -1997, 526, -1998, 526, -1998, 526, -1998, 527, -991, 525, -993, 527, -1995, 528, -990, 526, -1998, 525, -997, 522, -1997, 526, -994, 525, -990, 527, -992, 527, -990, 526, -992, 526, -1997, 526, -2001, 524, -991, 526, -1999, 525, -993, 525, -1997, 527, -992, 525, -1998, 475, -8949, 3989, -3999, 527, -1998, 525, -1999, 525, -1999, 527, -1996, 526, -992, 526, -992, 526, -1999, 528, -989, 526, -1997, 526, -993, 528, -1996, 527, -994, 524, -991, 528, -989, 528, -990, 528, -989, 530, -1994, 528, -1996, 529, -989, 529, -1995, 529, -989, 529, -1995, 530, -989, 528, -1994, 478, -8947, 4017, -3971, 531, -1993, 531, -1993, 530, -1995, 530, -1994, 531, -987, 530, -987, 530, -1994, 557, -961, 555, -1969, 530, -989, 530, -1992, 531, -988, 530, -987, 534, -984, 531, -987, 556, -961, 556, -1968, 532, -1992, 531, -988, 530, -1993, 532, -987, 530, -1994, 529, -988, 531, -1993, 479] #这个code改成自己识别到的raw码
turn_off_action:
then:
- switch.template.publish:
id: esp32_TV_swi
state: OFF
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
code: [3991, -3995, 529, -1996, 528, -1996, 525, -1999, 526, -1998, 527, -991, 525, -992, 526, -1997, 527, -991, 527, -1999, 522, -994, 526, -1998, 526, -992, 524, -993, 526, -991, 527, -991, 526, -991, 525, -1999, 526, -1998, 529, -989, 526, -1998, 525, -992, 528, -1996, 526, -992, 525, -1999, 475, -8948, 3990, -3998, 526, -1999, 525, -1999, 525, -1998, 528, -1998, 525, -992, 525, -992, 527, -1997, 526, -992, 530, -1994, 527, -990, 526, -1998, 526, -992, 526, -992, 527, -990, 525, -993, 525, -992, 526, -1998, 527, -1997, 525, -993, 526, -1998, 527, -991, 525, -2000, 525, -992, 526, -1997, 475, -8949, 3991, -3998, 525, -2000, 527, -1999, 524, -1999, 527, -1996, 526, -991, 525, -993, 525, -1999, 526, -992, 527, -1999, 524, -991, 527, -1998, 528, -989, 528, -990, 529, -989, 526, -993, 525, -991, 529, -1996, 526, -1998, 526, -992, 527, -1996, 529, -989, 529, -1994, 530, -989, 529, -1994, 478] #这个code改成自己识别到的raw码
web_server:
port: 80