Hello all,
I have been moving my custom Arduino code over to ESPHome. The project I am working on is controlling my holiday projectors through IR commands. In my Arduino sketch I used the following to send commands:
irsend.sendNEC(0xFF15EA,32); // power
delay(14000);
irsend.sendNEC(0xFF59A6,32); // down
delay(2000);
irsend.sendNEC(0xFF7986,32); // enter
delay(2000);
irsend.sendNEC(0xFF7986,32); // enter
delay(2000);
irsend.sendNEC(0xFFC936,32); // play
Reading the ESPHome instructions for IR and research in the forums I created the following but unfortunately it is not working.
esphome:
name: mb_closet_projector
platform: ESP8266
board: d1_mini
on_boot:
priority: -10
# ...
then:
- switch.turn_off: annoyingled
wifi:
ssid: "xxxx"
password: "xxxxx"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "xxxx"
password: "xxxx"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
remote_transmitter:
carrier_duty_percent: 100%
pin:
number: D2
switch:
- platform: gpio
pin: GPIO2
name: ledstripwemosled
inverted: true
id: annoyingled
- platform: template
name: MB Closet Projector
turn_on_action:
- remote_transmitter.transmit_lg:
data: 0xFF15EA
nbits: 32
- delay:
milliseconds: 14000
- remote_transmitter.transmit_lg:
data: 0xFF59A6
nbits: 32
- delay:
milliseconds: 2000
- remote_transmitter.transmit_lg:
data: 0xFF7986
nbits: 32
- delay:
milliseconds: 2000
- remote_transmitter.transmit_lg:
data: 0xFF7986
nbits: 32
- delay:
milliseconds: 2000
- remote_transmitter.transmit_lg:
data: 0xFFC936
nbits: 32
turn_off_action:
- remote_transmitter.transmit_lg:
data: 0xFF15EA
nbits: 32