Created
January 4, 2020 10:43
-
-
Save mplinuxgeek/a9e163dc650dc42199d06ba2256f0266 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
esphome: | |
name: bedroom_light | |
platform: ESP8266 | |
board: d1_mini | |
wifi: | |
ssid: '' | |
password: '' | |
web_server: | |
port: 80 | |
mqtt: | |
broker: 192.168.1.60 | |
#api: | |
logger: | |
ota: | |
password: '' | |
time: | |
- platform: sntp | |
id: sntp_time | |
timezone: Australia/Adelaide | |
light: | |
- platform: fastled_clockless | |
chipset: WS2812B | |
pin: GPIO14 | |
num_leds: 16 | |
rgb_order: GRB | |
#name: "Bedroom Light" | |
id: "light_1" | |
effects: | |
- strobe: | |
name: Police Light | |
colors: | |
- state: True | |
brightness: 100% | |
red: 100% | |
green: 0% | |
blue: 0% | |
duration: 250ms | |
- state: True | |
brightness: 100% | |
red: 0% | |
green: 0% | |
blue: 100% | |
duration: 250ms | |
- random: | |
name: "Random" | |
transition_length: 4s | |
update_interval: 5s | |
i2c: | |
sda: 4 | |
scl: 5 | |
scan: True | |
sensor: | |
- platform: bme280 | |
address: 0x77 | |
update_interval: 30s | |
iir_filter: 16x | |
temperature: | |
name: "Bedroom Temperature" | |
id: bme280_temperature | |
oversampling: 16x | |
on_value: | |
- lambda: |- | |
auto time = id(sntp_time).now(); | |
auto call = id(light_1).turn_on(); | |
if (id(bme280_temperature).state > 28.0) { | |
call.set_rgb(1.0, 0, 0); | |
} else if (id(bme280_temperature).state > 26.0) { | |
call.set_rgb(1.0, 0.75, 0); | |
} else if (id(bme280_temperature).state > 24.0) { | |
call.set_rgb(1.0, 1.00, 0); | |
} else if (id(bme280_temperature).state > 20) { | |
call.set_rgb(0, 1.0, 0); | |
} else if (id(bme280_temperature).state > 18) { | |
call.set_rgb(0, 1.0, 1.00); | |
} else if (id(bme280_temperature).state < 18) { | |
call.set_rgb(0, 0, 1.0); | |
} | |
if (time.hour > 21 || time.hour < 8) { | |
call.set_brightness(0.20); | |
} else { | |
call.set_brightness(0.50); | |
} | |
call.perform(); | |
pressure: | |
name: "Bedroom Pressure" | |
id: bme280_pressure | |
oversampling: 16x | |
humidity: | |
name: "Bedroom Relative Humidity" | |
id: bme280_humidity | |
oversampling: 16x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment