Posted on 4 Comments

Using The Color Kit Grande With ESPHome and HomeAssistant

The Color Kit Grande is more than just a simple starter kit for home automation. This kit, which includes an ESP32, a capacitive touch screen, and options for a LiPo battery and 3D-printed enclosure, provides an incredible foundation for building interactive and portable smart home interfaces. When paired with ESPHome and Home Assistant, the Color Kit Grande can control lights, shutters, and other devices, while also displaying real-time data such as temperature, right on its touchscreen.

In this blog post, we’ll explore how the Color Kit Grande integrates with ESPHome and Home Assistant and walk you through the YAML configuration that powers it.

What is the Color Kit Grande?

The Color Kit Grande includes the following components:

  • ESP32: A powerful microcontroller that is Wi-Fi-enabled, providing the backbone for the smart interface.
  • Capacitive Touch Screen: A 480×320 ILI9488 display that allows you to control lights and other devices interactively.
  • LiPo Battery: An optional battery for untethered operation, ideal for portable or inaccessible locations.
  • 3D-Printed Enclosure: A custom enclosure for a sleek, finished look, making it easy to integrate into your home.

With ESPHome, you can configure the Color Kit Grande to interact with Home Assistant, enabling advanced automations, real-time monitoring, and user-friendly control interfaces.

Understanding the YAML Configuration

Let’s break down the ESPHome YAML configuration used to turn the Color Kit Grande into a powerful smart home controller.

Basic Setup: ESPHome, Wi-Fi, and Logging

esphome:
  name: esphome-web-c2e08c
  friendly_name: ESPHome CKG Touch

esp32:
  board: esp32dev
  framework:
    type: arduino

  • esphome: Defines the ESPHome device name (esphome-web-c2e08c) and a human-friendly name (ESPHome CKG Touch) to identify it in Home Assistant.
  • esp32: Specifies the board type (esp32dev) and the use of the Arduino framework for development.

Wi-Fi Configuration

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true

ap:
ssid: "Esphome-Web-C2E08C"
password: "JuciUmZ6f9rL"
  • Wi-Fi Setup: Here, the device connects to your home network using your hidden Wi-Fi credentials.
  • Fallback Hotspot: In case Wi-Fi is unavailable, the Color Kit Grande will create its own hotspot (Esphome-Web-C2E08C), allowing you to still access it.

Display and Touchscreen Configuration

display:
- platform: ili9xxx
id: CKG
model: ILI9488
rotation: 180
cs_pin: 15
dc_pin: 2
reset_pin: 4
dimensions:
width: 480
height: 320

touchscreen:
- platform: ft63x6
interrupt_pin: 27
display: CKG
id: touch
on_touch:
- logger.log:
format: Touch %d at (%d, %d)
args: [touch.id, touch.x, touch.y]
  • Display: The ILI9488 display is configured with a resolution of 480×320, and specific pins (e.g., cs_pin, dc_pin, reset_pin) are assigned to connect the display.
  • Touchscreen: The FT63x6 touchscreen driver is used to manage touch interactions. The on_touch event logs the position of each touch, which can later be used for controlling lights or other devices.

Displaying Temperature Data from Home Assistant

sensor:
- platform: homeassistant
entity_id: sensor.th_sensor_8a0ab5_lywsd03mmc_mjwsd05mmc_atc_tempc
id: livingroom_temperature
on_value:
- lvgl.label.update:
id: temp_text
text:
format: "Living Room: %.1f"
args: [ 'x' ]
  • Temperature Sensor: This setup pulls temperature data from Home Assistant (sensor.th_sensor_8a0ab5) and updates the on-screen label with the latest value, displaying the temperature of the living room on the touchscreen.

Lighting Control for Backlight and Home Assistant Lights

output:
- platform: ledc
pin: 32
id: gpio_backlight_pwm

light:
- platform: monochromatic
output: gpio_backlight_pwm
name: "Display Backlight"
id: back_light
restore_mode: ALWAYS_ON
  • Backlight Control: The backlight of the touchscreen is configured as a monochromatic light. You can control its brightness and on/off state via Home Assistant, making it easy to adjust based on the time of day or device usage.
binary_sensor:
- platform: homeassistant
name: "Office Light"
id: ha_office_light
entity_id: switch.office
publish_initial_state: true
on_state:
then:
lvgl.widget.update:
id: office_button
state:
checked: !lambda return x;
  • Home Assistant Light Control: This snippet syncs the office light switch with the touch interface. If the light state changes, the button on the screen updates to reflect the light’s status (on or off).

Touchscreen Buttons for Controlling Devices

lvgl:
pages:
- id: main_page
widgets:
- button:
id: office_button
height: 100
width: 140
x: 10
y: 20
align: TOP_LEFT
checkable: true
widgets:
- label:
align: center
text: "Office"
on_short_click:
- homeassistant.service:
service: switch.toggle
data:
entity_id: switch.office
  • Office Button: A touch button on the display labeled “Office” is mapped to the office light. When pressed, it triggers the switch.toggle service in Home Assistant to turn the office light on or off.
  • Dining Table Button: Similarly, a button is mapped to the dining table light, allowing for easy control from the touchscreen.

Complete Configuration

You can find the complete yaml file in this repository on Github. There is also another example which shows how to display a watch face.

Conclusion

The Color Kit Grande is a powerful starter kit for those looking to add smart home control and interactivity to their home. With its ESP32-based architecture, capacitive touch screen, and compatibility with ESPHome and Home Assistant, it allows for seamless control over devices such as lights, shutters, and sensors. Together with the LiPo Battery and the 3D printed enclosure it makes a beautiful and independent addition to your home automation

This setup enables you to:

  • Control lights and other devices directly from the capacitive touch screen.
  • Display real-time data such as temperature from Home Assistant.
  • Automate and customize device behavior based on your needs.

With a bit of configuration using ESPHome’s YAML file, the Color Kit Grande can transform your home automation system, making it more intuitive, portable, and efficient.

4 thoughts on “Using The Color Kit Grande With ESPHome and HomeAssistant

  1. I have assembled the color kit grande + flashed the code with success. Now I woukd like to connect and control outputs via Zigbee. What xould I need (hard/software ?) Thank you

  2. Dani: Thanks for your project Color Kit Grande With ESPHome and HomeAssistant. I also have another Color Grande Kit that is running the Weather project and I love it. However, I am having trouble with the Home Assistant kit. Below is my yaml file and some output after I update the controller:
    Yaml File
    esphome:
    name: thingpulse
    friendly_name: ThingPulse

    esp32:
    board: esp32dev
    framework:
    type: arduino

    # Enable logging
    logger:

    # Enable Home Assistant API
    api:
    encryption:
    key: “/VnL1jbTWUvH0JIR8SQ3TshAc/HzRDUybloViNTVcyk=”

    ota:
    – platform: esphome
    password: “a108c9afa7bb1ac8baa81571e232bd48”

    wifi:
    ssid: !secret wifi_ssid
    password: !secret wifi_key

    # Enable fallback hotspot (captive portal) in case wifi connection fails
    ap:
    ssid: “Thingpulse Fallback Hotspot”
    password: “w4bAcEBmM2HQ”

    captive_portal:

    color:
    – id: yellow
    red: 100%
    green: 100%
    blue: 0%

    – id: red
    red: 100%
    green: 0%
    blue: 0%

    – id: navy
    red: 0%
    green: 0%
    blue: 50%

    i2c:
    sda: 23
    scl: 22
    scan: true

    spi:
    clk_pin: 5
    mosi_pin: 18
    miso_pin: 19

    output:
    – platform: ledc
    pin: 32
    id: gpio_backlight_pwm

    display:
    – platform: ili9xxx
    id: CKG
    model: ILI9488_A
    #rotation: 180
    cs_pin: 15
    dc_pin: 2
    reset_pin: 4
    auto_clear_enabled: false
    invert_colors: false
    transform:
    swap_xy: false
    mirror_x: true
    dimensions:
    width: 320
    height: 480
    offset_height: 0
    offset_width: 0

    touchscreen:
    – platform: ft63x6
    interrupt_pin: 27
    display: CKG
    id: touch
    on_touch:
    – logger.log:
    format: Touch %d at (%d, %d)
    args: [touch.id, touch.x, touch.y]

    sensor:
    – platform: homeassistant
    entity_id: sensor.th_sensor_8a0ab5_lywsd03mmc_mjwsd05mmc_atc_tempc
    id: livingroom_temperature
    on_value:
    – lvgl.label.update:
    id: temp_text
    text:
    format: “Living Room: %.1f”
    args: [ ‘x’ ]

    binary_sensor:
    – platform: lvgl
    widget: office_button
    name: Office Button
    – platform: lvgl
    widget: hall_button
    name: Hall Light
    – platform: homeassistant
    name: “Office Light”
    id: ha_office_lamp
    entity_id: switch.office_lamp
    publish_initial_state: true
    on_state:
    then:
    lvgl.widget.update:
    id: office_button
    state:
    checked: !lambda return x;
    – platform: homeassistant
    name: “Hall Light”
    id: ha_hall_light
    entity_id: switch.hall_light
    publish_initial_state: true
    on_state:
    then:
    lvgl.widget.update:
    id: hall_button
    state:
    checked: !lambda return x;

    # Define a monochromatic, dimmable light for the backlight
    light:
    – platform: monochromatic
    output: gpio_backlight_pwm
    name: “Display Backlight”
    id: back_light
    restore_mode: ALWAYS_ON

    lvgl:
    log_level: INFO
    color_depth: 16
    bg_color: 0x000000
    border_width: 0
    outline_width: 0
    shadow_width: 0
    text_font: unscii_16
    align: center
    theme:
    button:
    text_font: montserrat_24
    scroll_on_focus: true
    radius: 25
    width: 150
    height: 97
    pad_left: 10px
    pad_top: 10px
    pad_bottom: 10px
    pad_right: 10px
    shadow_width: 0
    border_width: 1
    border_color: 0xFFFFFF
    bg_color: 0x000000
    text_color: 0xFFFFFF
    checked:
    bg_color: 0xFFFFFF
    text_color: 0x000000
    pages:
    – id: main_page
    widgets:
    – label:
    text_font: montserrat_14
    text: “-.-°C”
    id: temp_text
    align: bottom_left
    x: 10
    y: -10
    #text_align: right
    text_color: 0xFFFFFF
    – button: # Button
    id: office_button
    height: 100
    width: 140
    x: 10
    y: 20
    align: TOP_LEFT
    checkable: true
    widgets:
    – label:
    align: center
    text: “Office”
    on_short_click:
    – homeassistant.service:
    service: switch.toggle
    data:
    entity_id: switch.office_lamp
    – button: # Button
    id: hall_button
    height: 100
    width: 140
    x: 170
    y: 20
    align: TOP_LEFT
    checkable: true
    widgets:
    – label:
    align: center
    text: “Hall Light”
    on_short_click:
    – homeassistant.service:
    service: light.toggle
    data:
    entity_id: living_room_lamp
    Here is some output after running update:
    [11:54:31][D][main:494]: Touch 0 at (259, 97)
    [11:54:31][I][lvgl:000]: indev_proc_press: pressed at x:259 y:97 (in lv_indev.c line #818)
    [11:54:31][D][binary_sensor:036]: ‘Hall Light’: Sending state ON
    [11:54:31][I][lvgl:000]: indev_proc_press: pressed at x:259 y:97 (in lv_indev.c line #818)
    [11:54:31][I][lvgl:000]: indev_proc_release: released (in lv_indev.c line #966)
    [11:54:31][D][binary_sensor:036]: ‘Hall Light’: Sending state OFF
    [11:54:35][D][main:494]: Touch 0 at (75, 86)
    [11:54:35][I][lvgl:000]: indev_proc_press: pressed at x:75 y:86 (in lv_indev.c line #818)
    [11:54:35][D][binary_sensor:036]: ‘Office Button’: Sending state ON
    [11:54:35][W][component:237]: Component lvgl took a long time for an operation (51 ms).
    [11:54:35][W][component:238]: Components should block for at most 30 ms.
    [11:54:35][I][lvgl:000]: indev_proc_press: pressed at x:75 y:86 (in lv_indev.c line #818)
    [11:54:35][I][lvgl:000]: indev_proc_release: released (in lv_indev.c line #966)
    [11:54:35][D][binary_sensor:036]: ‘Office Button’: Sending state OFF
    As you can see the app is loading and the Buttons seem to be functioning but the lights are not turning on and off. I have the lights set up in my Home Assistant project and they are a TP-Link smart plug that is the Office Lamp, and a TP-Link smart switch that is the Hall Light.
    Not sure I am giving you enough info to give me an answer as why the lights are not working but please let me know what else you would need to help me.
    Thanks,
    Danny

  3. Nice. Is this also possible with the Color Kit „Not Grande“

    1. Hi Thorsten
      I think it should work, but I have never tried it. I believe the ILI9341 should be supported by ESPHome, so should be the touch driver. However, the Color Kit Grande has several advantages over the older version: lipo battery support, nice enclosure available for 3D printing, power switch and capacitive touchscreen over the resistive.
      In case you get it to run, would you mind to share your yaml file?

Leave a Reply

Your email address will not be published. Required fields are marked *