AboutBlogContact

Edit config file

Everything what you should know about configuration file

Configuration file

The configuration file might look big and complicated, but it's really not. The file itself is separated into sections, which we will describe below. For our example, we will use boneio-32x10_lights_v0_7.yaml.

So let's begin. Here is the whole config file:

substitutions:
  name: boneio-32-l-07
  friendly_name: 'BoneIO ESP 32x10 Lights'
  serial_prefix: 'esp' #Don't change it.

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

esp32:
  board: nodemcu-32s

ethernet:
  id: eth
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO16

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

packages:
  internals_packages:
    url: https://github.com/boneIO-eu/esphome
    ref: v1.6.0
    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/output/out01_02.yaml',
        'boards/output/out03_04.yaml',
        'boards/output/out05_06.yaml',
        'boards/output/out07_08.yaml',
        'boards/output/out09_10.yaml',
        'boards/output/out11_12.yaml',
        'boards/output/out13_14.yaml',
        'boards/output/out15_16.yaml',
        'boards/output/out17_18.yaml',
        'boards/output/out19_20.yaml',
        'boards/output/out21_22.yaml',
        'boards/output/out23_24.yaml',
        'boards/output/out25_26.yaml',
        'boards/output/out27_28.yaml',
        'boards/output/out29_30.yaml',
        'boards/output/out31_32.yaml',
        # 'devices_v0_7-v0_9/one_wire.yaml',
      ]

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

web_server:
  port: 80
  local: true
  version: 3

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

light:
  - platform: binary
    name: 'Light 01'
    output: out_01
    id: light_01

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:
        - light.toggle: light_01

######################
### 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

# modbus_controller:
#   - id: YOURDEVICE ID
#     address: 0x09
#     modbus_id: mod_bus
#     setup_priority: -10
#     update_interval: 60s

substitutions

substitutions:
  name: boneio-32-l-07
  friendly_name: 'BoneIO ESP 32x10 Lights'
  serial_prefix: 'esp' #Don't change it.

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

esphome

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

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

esp32

esp32:
  board: nodemcu-32s

Definition of the ESP32 board.

Ethernet

ethernet:
  id: eth
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO16

This part is responsible for the description of your controller's Ethernet port - you shouldn't change anything here.

dashboard_import

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

This is the place where the address for our GitHub repository is defined. The config and all additional packages are downloaded from there. There is nothing to change here.

packages

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/output/out01_02.yaml',
        'boards/output/out03_04.yaml',
        'boards/output/out05_06.yaml',
        'boards/output/out07_08.yaml',
        'boards/output/out09_10.yaml',
        'boards/output/out11_12.yaml',
        'boards/output/out13_14.yaml',
        'boards/output/out15_16.yaml',
        'boards/output/out17_18.yaml',
        'boards/output/out19_20.yaml',
        'boards/output/out21_22.yaml',
        'boards/output/out23_24.yaml',
        'boards/output/out25_26.yaml',
        'boards/output/out27_28.yaml',
        'boards/output/out29_30.yaml',
        'boards/output/out31_32.yaml',
        # 'devices_v0_7-v0_9/one_wire.yaml',
      ]

Here are definitions of all packages used by boneIO, 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 would like to use a one-wire sensor.

logger

logger:

In case of troubleshooting, you can increase the log level to INFO or WARN or DEBUG. This can be very useful in some cases.

api

api:
  reboot_timeout: 0s

Here, the reboot timeout is defined for when the controller loses connection with HA. If you want your boneIO to restart after losing connection with Home Assistant, you should enter a value that suits you here. For WiFi connections, the value should not be zero. For LAN connections, not rebooting does not negatively affect the connection with Home Assistant in most cases.

ota

ota:
  - platform: esphome

Part responsible for Over The Air updates.

web_server

web_server:
  port: 80
  local: true
  version: 3

Part responsible for enabling the web server of the controller.

time

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

This section is responsible for selecting your controller's time zone. Adjust it to your location.

Modbus Section

######################
### 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

This section is responsible for Modbus. If you plan to use it, you should first uncomment it.

######################
### 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

Then, please check our Modbus tutorial: Modbus with Esphome packages