AboutBlogContact
ProductsESP CoverController Setup

Edit config file

Everything you need to know about the configuration file for the boneIO ESP Cover.

The Configuration File

The configuration file might seem large and complicated, but it's actually quite straightforward. The file is divided into sections, which we will describe below. As an example, we will use boneio-cover_v0_7.yaml.

Here is the complete configuration file:

substitutions:
  name: boneio-c-07
  friendly_name: 'BoneIO ESP Cover'
  serial_prefix: 'esp' #Don't change it.

esphome:
  name: '${name}'
  friendly_name: '${friendly_name}'
  name_add_mac_suffix: true
  project:
    name: boneio.32x10-cover
    version: '0.7'

esp32:
  board: nodemcu-32s
  framework:                                                                            
    type: esp-idf

ethernet:
  id: eth
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk:
    pin: GPIO0
    mode: CLK_EXT_IN
  phy_addr: 1
  power_pin: GPIO16

dashboard_import:
  package_import_url: github://boneIO-eu/esphome/boneio-cover_v0_7.yaml@latest
  import_full_config: true

packages:
  internals_packages:
    url: https://github.com/boneIO-eu/esphome
    ref: v1.7.1
    files: [
        'devices/buzzer.yaml',
        'devices/serial_no.yaml',
        'devices_v0_7/display.yaml',
        'devices_v0_7/i2c.yaml',
        'devices_v0_7-v0_9/ina219.yaml',
        'devices_v0_7-v0_9/lm75b.yaml',
        'devices_v0_7-v0_9/pcf.yaml',
        'boards/cover/out01_02.yaml',
        'boards/cover/out03_04.yaml',
        'boards/cover/out05_06.yaml',
        'boards/cover/out07_08.yaml',
        'boards/cover/out09_10.yaml',
        'boards/cover/out11_12.yaml',
        'boards/cover/out13_14.yaml',
        'boards/cover/out15_16.yaml',
        'boards/cover/out17_18.yaml',
        'boards/cover/out19_20.yaml',
        'boards/cover/out21_22.yaml',
        'boards/cover/out23_24.yaml',
        'boards/cover/out25_26.yaml',
        'boards/cover/out27_28.yaml',
        'boards/cover/out29_30.yaml',
        'boards/cover/out31_32.yaml',
        # 'devices_v0_7-v0_9/one_wire.yaml',
      ]

logger:
api:
  reboot_timeout: 0s
ota:
  - platform: esphome
  - platform: web_server

web_server:
  port: 80
  local: true

time:
  - platform: homeassistant
    timezone: Europe/Warsaw
    id: homeassistant_time

cover:
  - platform: time_based
    name: 'Cover 01'
    id: cover_01
    open_action:
      - switch.turn_on: cover_open_01_out01
    open_duration: 10s
    close_action:
      - switch.turn_on: cover_close_01_out02
    close_duration: 10s
    stop_action:
      - switch.turn_off: cover_open_01_out01
      - switch.turn_off: cover_close_01_out02

  # ... (configurations for Cover 02 to Cover 16 are similar)

binary_sensor:
  - platform: gpio
    name: 'IN_01'
    id: in_01
    pin:
      pcf8574: pcf_inputs_1to14
      number: 0
      mode:
        input: true
      inverted: true
    on_press:
      then:
        - cover.open: cover_01
    on_release:
      then:
        - cover.stop: cover_01

  - platform: gpio
    name: 'IN_02'
    id: in_02
    pin:
      pcf8574: pcf_inputs_1to14
      number: 1
      mode:
        input: true
      inverted: true
    on_press:
      then:
        - cover.close: cover_01
    on_release:
      then:
        - cover.stop: cover_01

  # ... (configurations for inputs IN_03 to IN_32 are similar)

######################
### MODBUS SECTION ###
######################
# UNCOMMENT BELOW TO USE MODBUS
# uart:
#   id: uart_pin14_15
#   rx_pin: GPIO14
#   tx_pin: GPIO15
#   baud_rate: 9600
#   stop_bits: 1

# modbus:
#   send_wait_time: 200ms
#   uart_id: uart_pin14_15
#   id: boneio_modbus

substitutions

This section is mainly for naming your controller. You should focus on friendly_name. Enter the exact name of your boneIO here. The name depends on your needs. It could be "boneIO ESP Cover" if you have one, or for example, "boneIO Cover 1st floor".

esphome

This contains definitions for your controller. You shouldn't change name or friendly_name. The name_add_mac_suffix: line will add a MAC suffix to the controller's name, which is useful for identification. project: is where you define the type and version of your controller.

ethernet

This section describes your controller's Ethernet port—you shouldn't change anything here.

packages

This section defines all the packages used by boneIO, along with the address to our GitHub. One thing that might interest you is uncommenting the # 'devices_v0_7-v0_9/one_wire.yaml' section if you want to use a one-wire sensor.

logger, api, ota, web_server, time

These are standard ESPHome sections. You can increase the log level in logger for troubleshooting, set a reboot timeout in api if the controller loses connection to HA, and set your timezone in time.

cover

This is the main section for configuring your roller shutters. Each cover entity is defined here.

  • platform: time_based: This means the cover's position is estimated based on the time it takes to open or close.
  • name: 'Cover 01': The friendly name that will appear in Home Assistant.
  • open_duration / close_duration: This is important! You must measure the time it takes for your shutter to fully open and close and enter the values here (e.g., 25s).
  • open_action / close_action / stop_action: These define which relays are activated to control the motor. This is pre-configured and should not be changed.

Advanced: Venetian Blinds with Tilt Control

Standard ESPHome covers do not support tilt control out of the box. To enable this functionality, we use a custom component created by bruxy70, which adds the venetian_blinds platform.

1. Add the Custom Component

First, you need to tell ESPHome where to download the custom component from. Add the following external_components block to the very top of your configuration file:

external_components:
  - source:
      type: git
      url: https://github.com/bruxy70/Venetian-Blinds-Control
      ref: master
    components: [venetian_blinds]

# ... rest of your configuration (substitutions, esphome, etc.)

2. Configure the Cover for Venetian Blinds

Next, find the cover you want to modify and make the following changes:

  • Change the platform from time_based to venetian_blinds.
  • Add the tilt_duration parameter. This is the time in milliseconds it takes for the slats to go from fully closed to fully open.
cover:
  - platform: venetian_blinds # Changed from time_based
    name: 'Blind 01'
    id: blind_01
    open_action:
      - switch.turn_on: cover_open_01_out01
    open_duration: 60s # Use a safe, long value for calibration
    close_action:
      - switch.turn_on: cover_close_01_out02
    close_duration: 60s # Use a safe, long value for calibration
    tilt_duration: 2000ms # Added for tilt control
    stop_action:
      - switch.turn_off: cover_open_01_out01
      - switch.turn_off: cover_close_01_out02

3. Calibrate Durations

For the tilt and position to work accurately, you must calibrate the open_duration, close_duration, and tilt_duration.

Always have the venetian blind fully open before you begin!

  1. Set open_duration and close_duration to a safe, long value (e.g., 60s) and compile the firmware.
  2. Measure Closing Time: Use a stopwatch and time how long it takes for the blind to go from fully open to fully closed. Note this value.
  3. Measure Opening and Tilt Time: Start the blind opening. Note the time it takes for the slats to tilt from closed to open (this is your tilt_duration). Then, let it continue and note the total time it takes to fully open (this is your open_duration).
  4. Update your configuration with the measured times, recompile, and upload. Your venetian blind is now calibrated!

binary_sensor

This section defines the physical inputs (e.g., wall switches). Each input is linked to a cover action.

  • on_press: Defines what happens when a button is pressed (e.g., cover.open: cover_01).
  • on_release: Defines what happens when the button is released (e.g., cover.stop: cover_01). This is useful for stopping the shutter at any position.

You can freely reassign which input controls which cover by changing the id in the on_press and on_release actions.

Modbus Section

This section is for Modbus. If you plan to use it, you should first uncomment it. Then, check out our Modbus tutorial: Modbus with Esphome packages