Skip to content

Instantly share code, notes, and snippets.

@radiantly
Last active June 16, 2024 09:16
Show Gist options
  • Save radiantly/54cea0c55bc4265e10130db4f0e48d15 to your computer and use it in GitHub Desktop.
Save radiantly/54cea0c55bc4265e10130db4f0e48d15 to your computer and use it in GitHub Desktop.
ESP32 ESPHome configuration for Atomberg fans (control via IR LED)
esphome:
name: atomberg
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
# Enter Wi-Fi credentials below
wifi:
ssid: "WIFI_NAME"
password: "WIFI_PASS"
# Connect your IR led to GPIO4
# see https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending
remote_transmitter:
pin: GPIO04
carrier_duty_percent: 50%
id: remote
# Atomberg Fan component
fan:
- platform: template
name: "Fan"
speed_count: 6
restore_mode: RESTORE_DEFAULT_OFF
on_state:
- remote_transmitter.transmit_nec:
transmitter_id: remote
address: 0xF300
command: !lambda |-
if (!x->state) // turn off
return 0x6E91;
else if (x->speed == 1)
return 0x748B;
else if (x->speed == 2)
return 0x6F90;
else if (x->speed == 3)
return 0x758A;
else if (x->speed == 4)
return 0x6C93;
else if (x->speed == 5)
return 0x7788;
else // boost mode
return 0x708F;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment