esphome:
name: ufo-r1
friendly_name: ufo-r1
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
services:
- service: send_raw_command
variables:
command: int[]
then:
- remote_transmitter.transmit_raw:
code: !lambda 'return command;'
carrier_frequency: 38kHz
- service: send_nec_command
variables:
address: int
command: int
then:
- remote_transmitter.transmit_nec:
address: !lambda 'return address;'
command: !lambda 'return command;'
- service: send_samsung_command
variables:
command: string
then:
- remote_transmitter.transmit_samsung:
data: !lambda 'return strtoll(command.c_str(), NULL, 16);'
ota:
password: "5*****************************8"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Ufo-R1"
password: "********"
button:
- platform: template
name: "power"
icon: "mdi:power-standby"
on_press:
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
code: [4503, -4495, 555, -557, 574, -1684, 552, -1685, 579, -1685, 553, -578, 549, -558, 575, -555, 550, -581, 555, -577, 550, -1686, 550, -1713, 550, -1686, 552, -581, 550, -582, 549, -555, 577, -555, 551, -581, 549, -581, 550, -1686, 553, -1711, 549, -555, 579, -554, 549, -582, 549, -583, 551, -1684, 577, -1685, 549, -558, 576, -555, 575, -1687, 553, -1683, 577, -1687, 547, -1690, 576] #这个code改成自己识别到的raw码
- platform: template
name: "voice+"
icon: "mdi:volume-plus"
on_press:
- remote_transmitter.transmit_samsung:
data: 0x707028D7
nbits: 32
- platform: template
name: "voice-"
icon: "mdi:volume-minus"
on_press:
- remote_transmitter.transmit_samsung:
data: 0x7070A857
nbits: 32
switch:
- platform: gpio
id: ufo_light
pin: GPIO4 #D4
name: "ufo_light"
icon: "mdi:lightbulb"
web_server:
port: 80
captive_portal:
remote_receiver:
pin:
number: GPIO5
inverted: true
mode: INPUT_PULLUP
dump: all
idle: 80ms
remote_transmitter:
pin: GPIO14
carrier_duty_percent: 50%