Remote Transmitter sending signal on boot

I have flashed a Nedis IR remote sender (ESP8266) with ESPHome and learned some codes for my Krinner Christmastree lights, and that all works quite well. The problem is that everytime I install new code (update or juse a code edit install) the device emits IR signals at boot. Not sure why it does that? The problem is that it turns off my christmastree lights when I work on new IR codes for example … is there a way to disable this behaviour?

For reference here is my code:

substitutions:
  devicename: ir-blaster-livingroom
  friendly_name: Livingroom IR Blaster

# Set device attributes
esphome:
  name: $devicename
  platform: ESP8266
  board: esp01_1m

# Enable Wi-Fi connection
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: ESP-${devicename}
    password: !secret esp_pw

# Enable captive poral
captive_portal:

# Enable websever
web_server:
  port: 80
  auth:
    username: !secret webuser
    password: !secret webpasswd

# Enable HomeAssistant API
api:
  encryption:
    key: !secret key

ota:
  password: !secret ota_pw

# Enable logging without UART support as there would be no way to read it
logger:
  baud_rate: 0

# Enable external blue LED as a status indictator
status_led:
  pin:
    number: GPIO4

# Enable the IR receiver to dump all IR commands to the log. Change dump type to your capture remote type. Use the captured IR command to replicate that IR command. You can disable this part when you aren't capturing IR command data.
#remote_receiver:
#  pin:
#    number: GPIO5
#    inverted: true
#    #mode:
#    #  input: true
#    #  pullup: true
#  dump: raw
  
# Enable the remote transmitter
remote_transmitter:
  pin: GPIO14
  carrier_duty_percent: 50%

# Enable the underside button.
#binary_sensor:
#  - platform: gpio
#    pin:
#      number: GPIO13
#      inverted: true
#    name: Underside Button

switch:
  - platform: template
    name: "Juletrelys"
    optimistic: true
    assumed_state: true
    turn_on_action:
      # Data would be the IR command captured in the log by the remote receiver
      - remote_transmitter.transmit_raw:
          code: [2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,2000,-5600,
                 2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,2000,-5600,
                 2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,2000,-5600]
          carrier_frequency: 38kHz
          repeat:
            times: 5
            wait_time: 16ms
    turn_off_action:
      # Data would be the IR command captured in the log by the remote receiver
      - remote_transmitter.transmit_raw:
          code: [2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000, -400,1000, -400,2000,-5600,
                 2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000, -400,1000, -400,2000,-5600,
                 2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000, -400,1000, -400,2000,-5600]
          carrier_frequency: 38kHz
          repeat:
            times: 5
            wait_time: 16ms
  - platform: template
    name: "Juletrelys Blinking"
    optimistic: true
    assumed_state: true
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000,-1000, 400, -400,2000,-5600,
                 2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000,-1000, 400, -400,2000,-5600,
                 2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000,-1000, 400, -400,2000,-5600]
          carrier_frequency: 38kHz
          repeat:
            times: 5
            wait_time: 16ms

Are your switches always “off” on boot?

Try another restore_mode: like RESTORE_DEFAULT_OFF

That did the trick. Thanks :+1:

1 Like