As you may have noticed I have been trying to get ESPHome running on my RGB bulbs, this is how I eventually got it working 😁
NOTE : If Using Windows Make Sure You Have 7-Zip Installed
01) Go To The ESPHome Addon In Home Assistant
02) Create A "New Device"
03) Skip Installation Step (This Will Come Later)
04) Select ESP8266
05) Once "Configuration Created" Is Displayed, Copy The "Encryption Key" For Future Reference To A Notepad Document ( Or Somewhere Else LoL ). Now Click "Skip"
06) Click On "Edit" On Your New Device
07) Change "board: esp01_1m" to "board: esp8285" And Click "Save" ( it should look something like the below ) (You May Need To Change The WiFi SSID & Password To Suit You)
esphome:
name: test
friendly_name: test
esp8266:
board: esp8285
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "REDACTED FOR PRIVACY"
ota:
password: "REDACTED"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Test Fallback Hotspot"
password: "REDACTED"
captive_portal:
08) Click "Save" And Close With "X" Button
09) On The New Device Now Click The "Three Dots" And Press "Validate" ( To Check All Is Good )
10) Click "Install" And Click The "Manual Download" ( This Will Compile The New BIN File We Will Be Using, This May Take Some Time )
10a) Click "Close"
11) Save The "BIN" To Your "Desktop" Or Where You Are Working ( EG test.bin )
12) Find Your "BIN" File And Now Right Click (If Using Windows 11 Click "Show More Options)
12a) Hover Over "7-Zip", Move Over To "Add To Archive..." And Click "Add To Archive"
12b) Change Archive Format To "gzip" Then Click "OK"
You Now Have Your BIN Compressed EG test.gz
13) Now Head To Your Tasmota Bulb EG 192.168.0.69
13a) Click "Firmware Upgrade"
13b) Click "Choose File" On "Upgrade by file upload"
13c) Find Your "test.gz" And Click "OK"
14) WAIT, WAIT, WAIT. ( Be Patient )
15) Look In Home Assistant, It Should Find A "New Device"
15a) Add This To Home Assistant
16) Go Back To The ESPHome Addon In Home Assistant
16a) Click On Edit On Your New Device
16b) Add The Following Code Directly Below "captive_portal:" ( Thanks to JamesSwift/localbytes-bulb-9w-rgbct For This Code )
light:
- platform: rgbww
name: none
id: bulb
restore_mode: ALWAYS_ON
warm_white: warm_white
cold_white: white
red: red
green: green
blue: blue
cold_white_color_temperature: 6000 K
warm_white_color_temperature: 3000 K
color_interlock: true
effects:
- random:
- strobe:
- pulse:
- flicker:
- strobe:
name: Police
colors:
- state: true
color_mode: RGB
brightness: 100%
red: 100%
green: 0%
blue: 0%
duration: 700ms
- state: true
color_mode: RGB
brightness: 100%
red: 0%
green: 0%
blue: 100%
duration: 700ms
- strobe:
name: Police Fast
colors:
- state: true
color_mode: RGB
brightness: 100%
red: 100%
green: 0%
blue: 0%
duration: 300ms
- state: true
color_mode: RGB
brightness: 100%
red: 0%
green: 0%
blue: 100%
duration: 300ms
#4, 5, 12, 13, 14
output:
- platform: esp8266_pwm
id: red
pin: GPIO4
- platform: esp8266_pwm
id: green
pin: GPIO12
- platform: esp8266_pwm
id: blue
pin: GPIO14
- platform: esp8266_pwm
id: white
pin: GPIO5
- platform: esp8266_pwm
id: warm_white
pin: GPIO13
number:
- platform: template
optimistic: true
restore_value: true
name: "Red Max Power"
id: red_max
icon: "mdi:lightbulb-question"
min_value: 0
max_value: 100
step: 1
unit_of_measurement: "%"
initial_value: 100
on_value:
lambda: |-
id(red).set_max_power(x/100);
ESP_LOGI("light", "Set red max power to: %f", id(red).get_max_power());
auto call = id(bulb).toggle();
call.perform();
call = id(bulb).toggle();
call.perform();
- platform: template
optimistic: true
restore_value: true
name: "Green Max Power"
id: green_max
icon: "mdi:lightbulb-question"
min_value: 0
max_value: 100
step: 1
unit_of_measurement: "%"
initial_value: 100
on_value:
lambda: |-
id(green).set_max_power(x/100);
ESP_LOGI("light", "Set green max power to: %f", id(green).get_max_power());
auto call = id(bulb).toggle();
call.perform();
call = id(bulb).toggle();
call.perform();
- platform: template
optimistic: true
restore_value: true
name: "Blue Max Power"
id: blue_max
icon: "mdi:lightbulb-question"
min_value: 0
max_value: 100
step: 1
unit_of_measurement: "%"
initial_value: 100
on_value:
lambda: |-
id(blue).set_max_power(x/100);
ESP_LOGI("light", "Set blue max power to: %f", id(blue).get_max_power());
auto call = id(bulb).toggle();
call.perform();
call = id(bulb).toggle();
call.perform();
sensor:
# WiFi Signal Sensor
- platform: wifi_signal
name: "WiFi Status"
update_interval: 60s
16c) The Complete Config Sould Look Like The One Below
esphome:
name: test
friendly_name: test
esp8266:
board: esp8285
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "REDACTED FOR PRIVACY"
ota:
password: "REDACTED"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Test Fallback Hotspot"
password: "REDACTED"
captive_portal:
light:
- platform: rgbww
name: none
id: bulb
restore_mode: ALWAYS_ON
warm_white: warm_white
cold_white: white
red: red
green: green
blue: blue
cold_white_color_temperature: 6000 K
warm_white_color_temperature: 3000 K
color_interlock: true
effects:
- random:
- strobe:
- pulse:
- flicker:
- strobe:
name: Police
colors:
- state: true
color_mode: RGB
brightness: 100%
red: 100%
green: 0%
blue: 0%
duration: 700ms
- state: true
color_mode: RGB
brightness: 100%
red: 0%
green: 0%
blue: 100%
duration: 700ms
- strobe:
name: Police Fast
colors:
- state: true
color_mode: RGB
brightness: 100%
red: 100%
green: 0%
blue: 0%
duration: 300ms
- state: true
color_mode: RGB
brightness: 100%
red: 0%
green: 0%
blue: 100%
duration: 300ms
#4, 5, 12, 13, 14
output:
- platform: esp8266_pwm
id: red
pin: GPIO4
- platform: esp8266_pwm
id: green
pin: GPIO12
- platform: esp8266_pwm
id: blue
pin: GPIO14
- platform: esp8266_pwm
id: white
pin: GPIO5
- platform: esp8266_pwm
id: warm_white
pin: GPIO13
number:
- platform: template
optimistic: true
restore_value: true
name: "Red Max Power"
id: red_max
icon: "mdi:lightbulb-question"
min_value: 0
max_value: 100
step: 1
unit_of_measurement: "%"
initial_value: 100
on_value:
lambda: |-
id(red).set_max_power(x/100);
ESP_LOGI("light", "Set red max power to: %f", id(red).get_max_power());
auto call = id(bulb).toggle();
call.perform();
call = id(bulb).toggle();
call.perform();
- platform: template
optimistic: true
restore_value: true
name: "Green Max Power"
id: green_max
icon: "mdi:lightbulb-question"
min_value: 0
max_value: 100
step: 1
unit_of_measurement: "%"
initial_value: 100
on_value:
lambda: |-
id(green).set_max_power(x/100);
ESP_LOGI("light", "Set green max power to: %f", id(green).get_max_power());
auto call = id(bulb).toggle();
call.perform();
call = id(bulb).toggle();
call.perform();
- platform: template
optimistic: true
restore_value: true
name: "Blue Max Power"
id: blue_max
icon: "mdi:lightbulb-question"
min_value: 0
max_value: 100
step: 1
unit_of_measurement: "%"
initial_value: 100
on_value:
lambda: |-
id(blue).set_max_power(x/100);
ESP_LOGI("light", "Set blue max power to: %f", id(blue).get_max_power());
auto call = id(bulb).toggle();
call.perform();
call = id(bulb).toggle();
call.perform();
sensor:
# WiFi Signal Sensor
- platform: wifi_signal
name: "WiFi Status"
update_interval: 60s
16d) Click "Save" And Close With "X" Button
17) Once Again On The New Device Now Click The "Three Dots" And Press "Validate" ( To Check All Is Good )
17a) Now "Install", Now Click "Wirelessly" And Wait For The Code To Re-Compile And Upload ( When Done You Will See The Log Start To Update )
17b) Click "Stop" ( Only When You Can See The Logs Start See Below )
[12:37:47][I][app:100]: ESPHome version 2024.4.1 compiled on Apr 25 2024, 16:44:54
[12:37:47][C][wifi:580]: WiFi:
[12:37:47][C][wifi:408]: Local MAC: 69:69:6A:D9:F6:9C
[12:37:47][C][wifi:413]: SSID: [redacted]
[12:37:47][C][wifi:416]: IP Address: 192.168.0.69
[12:37:47][C][wifi:419]: BSSID: [redacted]
[12:37:47][C][wifi:421]: Hostname: 'redacted'
18) Head To "config/integrations/dashboard" And Click On ESPHome ( Toy Should See Your Bulb Listed, Click On It To Test )
19) If You Still HaveThe Tasmota Intergration Visable On "Device Info" You Can Click On The 3 Dots And "Delete Tasmota"
20) Hopefully It's All Done Now :-)
I hope this is useful to someone :-)