Created
June 2, 2023 20:26
-
-
Save gregdasney/a64ee67e7fc2ab89bb32f10061676d7d to your computer and use it in GitHub Desktop.
Sample esp home config for merkury-innovations-mi-ew010-999ww-led-strip.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Single click toggles on/off | |
# double click toggles between a few different color modes | |
esphome: | |
name: merk-dim-strip-0 | |
friendly_name: merk-dim-strip-0 | |
libretiny: | |
board: cb3s | |
framework: | |
version: dev | |
# Enable logging | |
logger: | |
# Enable Home Assistant API | |
api: | |
encryption: | |
key: !secret apiKey | |
ota: | |
password: !secret otaPassword | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_password | |
# Enable fallback hotspot in case wifi connection fails | |
ap: | |
ssid: "mds-0 Fallback" | |
password: "GiS3tJy62fPT" | |
light: | |
- platform: rgbw | |
id: strip | |
name: "mds-0" | |
red: output_red | |
green: output_green | |
blue: output_blue | |
white: output_white | |
color_interlock: true | |
effects: | |
- random: | |
name: slowRandom | |
transition_length: 2s | |
update_interval: 3s | |
- random: | |
name: "Fast Random" | |
transition_length: 4s | |
update_interval: 5s | |
output: | |
- platform: ledc | |
id: output_red | |
pin: P8 | |
- platform: ledc | |
id: output_green | |
pin: P24 | |
- platform: ledc | |
id: output_blue | |
pin: P26 | |
- platform: ledc | |
id: output_white | |
pin: P7 | |
binary_sensor: | |
- platform: gpio | |
name: 'mds-0-button' | |
pin: | |
number: P9 | |
inverted: true | |
mode: | |
input: true | |
pullup: true | |
# https://community.home-assistant.io/t/esphome-button-held-double-press/136083/10 | |
on_multi_click: | |
#Tripple Click | |
- timing: | |
- ON for at most 0.5s | |
- OFF for at most 0.3s | |
- ON for at most 0.5s | |
- OFF for at most 0.3s | |
- ON for at most 0.5s | |
- OFF for at least 0.2s | |
then: | |
- light.turn_on: | |
id: strip | |
brightness: 100% | |
blue: 0% | |
red: 0% | |
green: 100% | |
#Double Click | |
- timing: | |
- ON for at most 0.5s | |
- OFF for at most 0.3s | |
- ON for at most 0.5s | |
- OFF for at least 0.2s | |
then: | |
- light.turn_on: | |
id: strip | |
brightness: 100% | |
- lambda: |- | |
static int state = 0; | |
auto call = id(strip).turn_on(); | |
// Transition of 1000ms = 1s | |
call.set_transition_length(500); | |
call.set_color_mode(ColorMode::RGB); | |
if (state == 0) { | |
call.set_rgb(1.0, 1.0, 1.0); | |
} else if (state == 1) { | |
call.set_rgb(1.0, 0.0, 1.0); | |
} else if (state == 2) { | |
call.set_rgb(0.0, 0.0, 1.0); | |
} else if (state == 3) { | |
call.set_rgb(1.0, 0.0, 0.0); | |
} | |
else { | |
call.set_color_mode(ColorMode::WHITE); | |
} | |
call.perform(); | |
state += 1; | |
if (state == 5) | |
state = 0; | |
#Single Click | |
- timing: | |
- ON for at most 0.5s | |
- OFF for at least 1s | |
then: | |
- light.toggle: strip | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment