QuinLED-An-Penta DIY ESPhome Example configuration
Back to QuinLED-An-Penta-DIY index page
The QuinLED-An-Penta board is fully compatible with ESPhome. With the 5 channels available, SPI OLED header, 3 switch inputs, I2C temperature sensor and screw terminals there is a lot going on and that can be configured. Below will be some example configurations of how I use the board, please use these as a basis to develop your own configuration!
Index
[table]
WiFi, 5x White LED strips, 3x button input, I2C onboard temperature sensor, SPI OLED connected
Ethernet, RGBCCT LED strip, 3x button input, I2C onboard temperature sensor
Configurations
WiFi, 5x White LED strips, 3x button input, I2C onboard temperature sensor, SPI OLED connected
substitutions:
esphome_name: test_anpenta
esphome:
name: ${esphome_name}
platform: ESP32
board: mhetesp32devkit
wifi:
ssid: !secret esphome_wifi_ssid
password: !secret esphome_wifi_pass
#Disable logging/UART
logger:
# level: NONE
baud_rate: 0
api:
reboot_timeout: 60min
password: !secret esphome_api_pass
ota:
password: !secret esphome_ota_pass
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
i2c:
sda: 1
scl: 3
scan: true
spi:
clk_pin: GPIO15
mosi_pin: GPIO16
switch:
- platform: restart
name: ${esphome_name}-restart
id: restart_switch
binary_sensor:
- platform: gpio
pin: 34
id: pin_34
filters:
- invert:
# on_press:
# - light.toggle:
# id: LED1
- platform: gpio
pin: 35
id: pin_35
filters:
- invert:
# on_press:
# - light.toggle:
# id: LED2
- platform: gpio
pin: 39
id: pin_39
filters:
- invert:
# on_press:
# - light.toggle:
# id: LED3
output:
- platform: ledc
pin: 14
frequency: 20000Hz
id: LED_channel_1
- platform: ledc
pin: 13
frequency: 20000Hz
id: LED_channel_2
- platform: ledc
pin: 12
frequency: 20000Hz
id: LED_channel_3
- platform: ledc
pin: 4
frequency: 20000Hz
id: LED_channel_4
- platform: ledc
pin: 2
frequency: 20000Hz
id: LED_channel_5
light:
- platform: monochromatic
name: "${esphome_name}-1"
gamma_correct: 2.0
default_transition_length: 3s
id: LED1
output: LED_channel_1
- platform: monochromatic
name: "${esphome_name}-2"
gamma_correct: 2.0
default_transition_length: 3s
id: LED2
output: LED_channel_2
- platform: monochromatic
name: "${esphome_name}-3"
gamma_correct: 2.0
default_transition_length: 3s
id: LED3
output: LED_channel_3
- platform: monochromatic
name: "${esphome_name}-4"
gamma_correct: 2.0
default_transition_length: 3s
id: LED4
output: LED_channel_4
- platform: monochromatic
name: "${esphome_name}-5"
gamma_correct: 2.0
default_transition_length: 3s
id: LED5
output: LED_channel_5
sensor:
- platform: sht3xd
temperature:
name: "${esphome_name}_Temperature"
id: esptemp
humidity:
name: "${esphome_name}_Humidity"
address: 0x44
update_interval: 15s
- platform: uptime
name: "${esphome_name}_Uptime Sensor"
- platform: wifi_signal
name: "${esphome_name} WiFi Signal"
update_interval: 60s
- platform: template
name: "LED1 readout"
id: LED1_value
internal: true
update_interval: 10ms
filters:
delta: 0.8
lambda: |-
if (id(LED1).current_values.is_on()) {
return (int(id(LED1).current_values.get_brightness() * 100));
}
else {
return 0;
}
- platform: template
name: "LED2 readout"
id: LED2_value
internal: true
update_interval: 10ms
filters:
delta: 0.8
lambda: |-
if (id(LED2).current_values.is_on()) {
return (int(id(LED2).current_values.get_brightness() * 100));
}
else {
return 0;
}
- platform: template
name: "LED3 readout"
id: LED3_value
internal: true
update_interval: 10ms
filters:
delta: 0.8
lambda: |-
if (id(LED3).current_values.is_on()) {
return (int(id(LED3).current_values.get_brightness() * 100));
}
else {
return 0;
}
- platform: template
name: "LED4 readout"
id: LED4_value
internal: true
update_interval: 10ms
filters:
delta: 0.8
lambda: |-
if (id(LED4).current_values.is_on()) {
return (int(id(LED4).current_values.get_brightness() * 100));
}
else {
return 0;
}
- platform: template
name: "LED5 readout"
id: LED5_value
internal: true
update_interval: 10ms
filters:
delta: 0.8
lambda: |-
if (id(LED5).current_values.is_on()) {
return (int(id(LED5).current_values.get_brightness() * 100));
}
else {
return 0;
}
text_sensor:
- platform: wifi_info
ip_address:
name: ESP IP Address
id: espip
ssid:
name: ESP Connected SSID
id: espssid
mac_address:
name: ESP Mac Wifi Address
id: espmac
font:
- file: "Roboto-Regular.ttf"
id: my_font
size: 9
globals:
- id: display_page
type: int
restore_value: no
initial_value: '0' # On first boot, value=0 initiates display.turn_on() command. Can't run as on_boot command
interval:
- interval: 60s
then:
- display.page.show_next: my_display
- delay: 6s
- display.page.show_next: my_display
display:
- platform: ssd1306_spi
model: "SSD1306 128x64"
rotation: 180
cs_pin: 27
dc_pin: 32
reset_pin: 33
id: my_display
update_interval : 10ms
pages:
- id: "page1"
lambda: |-
it.printf(0, 0, id(my_font), TextAlign::TOP_LEFT, "${esphome_name}");
it.strftime(128, 0, id(my_font), TextAlign::TOP_RIGHT, "%H:%M:%S", id(homeassistant_time).now());
it.line(0, 12, 128, 12);
it.rectangle(0, 16, 80, 8);
it.rectangle(0, 26, 80, 8);
it.rectangle(0, 36, 80, 8);
it.rectangle(0, 46, 80, 8);
it.rectangle(0, 56, 80, 8);
it.filled_rectangle(0, 16, id(LED1_value).state /100 * 80, 8);
it.filled_rectangle(0, 26, id(LED2_value).state /100 * 80, 8);
it.filled_rectangle(0, 36, id(LED3_value).state /100 * 80, 8);
it.filled_rectangle(0, 46, id(LED4_value).state /100 * 80, 8);
it.filled_rectangle(0, 56, id(LED5_value).state /100 * 80, 8);
it.printf(128, 13, id(my_font), TextAlign::TOP_RIGHT, "L1 %3.0f %%", id(LED1_value).state);
it.printf(128, 23, id(my_font), TextAlign::TOP_RIGHT, "L2 %3.0f %%", id(LED2_value).state);
it.printf(128, 33, id(my_font), TextAlign::TOP_RIGHT, "L3 %3.0f %%", id(LED3_value).state);
it.printf(128, 43, id(my_font), TextAlign::TOP_RIGHT, "L4 %3.0f %%", id(LED4_value).state);
it.printf(128, 53, id(my_font), TextAlign::TOP_RIGHT, "L5 %3.0f %%", id(LED5_value).state);
- id: "page2"
lambda: |-
it.printf(0, 0, id(my_font), TextAlign::TOP_LEFT, "${esphome_name}");
it.strftime(128, 0, id(my_font), TextAlign::TOP_RIGHT, "%H:%M:%S", id(homeassistant_time).now());
it.line(0, 12, 128, 12);
it.printf(0, 23, id(my_font), TextAlign::TOP_LEFT, "SSID: %s", id(espssid).state.c_str());
it.printf(0, 33, id(my_font), TextAlign::TOP_LEFT, "MAC: %s", id(espmac).state.c_str());
it.printf(0, 43, id(my_font), TextAlign::TOP_LEFT, "IP: %s", id(espip).state.c_str());
it.printf(0, 53, id(my_font), TextAlign::TOP_LEFT, "BoardT: %.1f°C", id(esptemp).state);
Ethernet, RGBCCT LED strip, 3x button input, I2C onboard temperature sensor
substitutions:
esphome_name: test_anpentalan
esphome:
name: ${esphome_name}
platform: ESP32
board: mhetesp32devkit
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO17_OUT
phy_addr: 0
power_pin: GPIO5
#Disable logging/UART
logger:
# level: NONE
baud_rate: 0
api:
reboot_timeout: 60min
password: nohackinghere
ota:
password: nohackinghere
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
i2c:
sda: 1
scl: 3
#frequency: 1Mhz
scan: true
switch:
- platform: restart
name: ${esphome_name}-restart
id: restart_switch
binary_sensor:
- platform: gpio
pin: 34
id: pin_34
# on_press:
# - light.toggle:
# id: LED1
- platform: gpio
pin: 35
id: pin_35
# on_press:
# - light.toggle:
# id: LED2
- platform: gpio
pin: 39
id: pin_39
# on_press:
# - light.toggle:
# id: LED3
output:
- platform: ledc
pin: 14
frequency: 20000Hz
id: LED_channel_1
- platform: ledc
pin: 13
frequency: 20000Hz
id: LED_channel_2
- platform: ledc
pin: 12
frequency: 20000Hz
id: LED_channel_3
- platform: ledc
pin: 4
frequency: 20000Hz
id: LED_channel_4
- platform: ledc
pin: 2
frequency: 20000Hz
id: LED_channel_5
light:
- platform: rgbww
name: "RGBCCT strip"
red: LED_channel_1
green: LED_channel_2
blue: LED_channel_3
cold_white: LED_channel_4
warm_white: LED_channel_5
cold_white_color_temperature: 5500 K
warm_white_color_temperature: 3200 K
constant_brightness: true
sensor:
- platform: sht3xd
temperature:
name: "${esphome_name}_Temperature"
humidity:
name: "${esphome_name}_Room Humidity"
address: 0x44
update_interval: 30s
- platform: uptime
name: "${esphome_name}_Uptime Sensor"
