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, described below.
For our example, we will use boneio-8x10A_v0_1.yaml.
So let's begin. Here is the whole config file:
ssubstitutions:
name: boneio-8-s-01
friendly_name: 'BoneIO ESP 8x10A Switches'
serial_prefix: 'espm' #Don't change it.
esphome:
name: '${name}'
friendly_name: '${friendly_name}'
name_add_mac_suffix: true
project:
name: boneio.8_10-switches
version: '0.1'
esp32:
board: esp32dev
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-8x10A_v0_1.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/dimmer_i2c.yaml',
'devices_v0_7-v0_9/lm75b.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
mcp23017:
- id: 'mcp1'
address: 0x20
# Individual outputs
switch:
- platform: gpio
name: 'OUT 1'
id: out_01
pin:
mcp23xxx: mcp1
number: 8
mode:
output: true
inverted: false
- platform: gpio
name: 'OUT 2'
id: out_02
pin:
mcp23xxx: mcp1
number: 9
mode:
output: true
inverted: false
- platform: gpio
name: 'OUT 3'
id: out_03
pin:
mcp23xxx: mcp1
number: 10
mode:
output: true
inverted: false
- platform: gpio
name: 'OUT 4'
id: out_04
pin:
mcp23xxx: mcp1
number: 11
mode:
output: true
inverted: false
- platform: gpio
name: 'OUT 5'
id: out_05
pin:
mcp23xxx: mcp1
number: 12
mode:
output: true
inverted: false
- platform: gpio
name: 'OUT 6'
id: out_06
pin:
mcp23xxx: mcp1
number: 13
mode:
output: true
inverted: false
- platform: gpio
name: 'OUT 7'
id: out_07
pin:
mcp23xxx: mcp1
number: 14
mode:
output: true
inverted: false
- platform: gpio
name: 'OUT 8'
id: out_08
pin:
mcp23xxx: mcp1
number: 15
mode:
output: true
inverted: false
binary_sensor:
- platform: gpio
name: 'IN 01'
id: in_01
pin:
mcp23xxx: mcp1
number: 0
mode:
input: true
inverted: false
- platform: gpio
name: 'IN 02'
id: in_02
pin:
mcp23xxx: mcp1
number: 1
mode:
input: true
inverted: false
- platform: gpio
name: 'IN 03'
id: in_03
pin:
mcp23xxx: mcp1
number: 2
mode:
input: true
inverted: false
- platform: gpio
name: 'IN 04'
id: in_04
pin:
mcp23xxx: mcp1
number: 3
mode:
input: true
inverted: false
- platform: gpio
name: 'IN 05'
id: in_05
pin:
mcp23xxx: mcp1
number: 4
mode:
input: true
inverted: false
- platform: gpio
name: 'IN 06'
id: in_06
pin:
mcp23xxx: mcp1
number: 5
mode:
input: true
inverted: false
- platform: gpio
name: 'IN 07'
id: in_07
pin:
mcp23xxx: mcp1
number: 6
mode:
input: true
inverted: false
- platform: gpio
name: 'IN 08'
id: in_08
pin:
mcp23xxx: mcp1
number: 7
mode:
input: true
inverted: falsesubstitutions
ssubstitutions:
name: boneio-8-s-01
friendly_name: 'BoneIO ESP 8x10A Switches'
serial_prefix: 'espm' #Don't change it.This part is mainly responsible for the name of your controller.
You should focus on friendly_name. 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.8_10-switches
version: '0.1'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: esp32dev
framework:
type: esp-idfDefinition of the ESP32 board.
Ethernet
ethernet:
id: eth
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk:
pin: GPIO0
mode: CLK_EXT_IN
phy_addr: 1
power_pin: GPIO16This 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-8x10A_v0_1.yaml@latest
import_full_config: trueThis 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
ackages:
internals_packages:
url: https://github.com/boneIO-eu/esphome
ref: v1.7.1
files:
[
'devices/buzzer.yaml',
'devices/serial_no.yaml',
'devices/dimmer_i2c.yaml',
'devices_v0_7-v0_9/lm75b.yaml',
]Here are definitions of all packages used by boneIO, with the address to our GitHub.
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: 0sUse this setting to specify how long the controller should wait before rebooting after losing the connection to Home Assistant. Please enter a value appropriate for your setup.
For WiFi users, we advise against using zero. For wired (LAN) connections, disabling the reboot (setting it to 0) usually does not impact stability.
ota
ota:
- platform: esphome
- platform: web_serverPart responsible for Over The Air updates.
web_server
web_server:
port: 80
local: truePart responsible for enabling the web server of the controller.
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_modbusThis 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_modbusThen, please check our Modbus tutorial: Modbus with Esphome packages