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-dimmer_gen2_8ch-v0_1.yaml.
So let's begin. Here is the whole config file:
substitutions:
name: boneio-dr-gen2-8ch-01
friendly_name: 'BoneIO Dimmer Gen2'
serial_prefix: 'dim2' #Don't change it.
firmware_manifest: 'https://boneio.eu/fwesp/boneio-dr-gen2-8ch-01.json'
esphome:
name: '${name}'
friendly_name: '${friendly_name}'
name_add_mac_suffix: true
project:
name: boneio.dimmer-led-gen2
version: '0.1'
on_boot:
priority: -100
then:
- delay: 5s
- if:
condition:
lambda: 'return id(serial_no) != nullptr;'
then:
- component.update: serial_no
- logger.log: "Serial No updated on boot"
else:
- logger.log: "Serial No component not found"
esp32:
board: esp32-s3-devkitc-1
framework:
type: esp-idf
ethernet:
id: eth
type: W5500
clk_pin: GPIO13
mosi_pin: GPIO39
miso_pin: GPIO38
cs_pin: GPIO12
interrupt_pin: GPIO2
reset_pin: GPIO1
clock_speed: 25MHz
i2c:
sda: GPIO10
scl: GPIO11
scan: True
frequency: 400kHz
output:
- platform: ledc
pin: GPIO18
frequency: 1000Hz
inverted: false
id: chl01
- platform: ledc
pin: GPIO17
frequency: 1000Hz
inverted: false
id: chl02
- platform: ledc
pin: GPIO16
frequency: 1000Hz
inverted: false
id: chl03
- platform: ledc
pin: GPIO15
frequency: 1000Hz
inverted: false
id: chl04
- platform: ledc
pin: GPIO7
frequency: 1000Hz
inverted: false
id: chr01
- platform: ledc
pin: GPIO6
frequency: 1000Hz
inverted: false
id: chr02
- platform: ledc
pin: GPIO5
frequency: 1000Hz
inverted: false
id: chr03
- platform: ledc
pin: GPIO4
frequency: 1000Hz
inverted: false
id: chr04
# CAN gpio48 - tx, gpio47 rx, gpio35 stb
# uart:
# id: boneio_uart
# rx_pin: GPIO21
# tx_pin: GPIO14
# baud_rate: 9600
# stop_bits: 1
# modbus:
# send_wait_time: 80ms
# uart_id: boneio_uart
# id: boneio_modbus
packages:
internals_packages:
url: https://github.com/boneIO-eu/esphome
ref: v1.7.1
files: [
'devices/serial_no.yaml',
]
# boneiopackages:
# url: https://github.com/boneIO-eu/esphome_packages
# ref: main
# refresh: 1min
# files:
# - path: sdm630.yaml
dashboard_import:
package_import_url: github://boneIO-eu/esphome/boneio-dimmer_gen2_8ch-v0_1.yaml@main
import_full_config: true
pcf8574:
- id: 'pcf_inputs'
address: 0x38
logger:
hardware_uart: UART0
api:
reboot_timeout: 0s
ota:
- platform: esphome
- platform: web_server
web_server:
port: 80
version: 3
local: true
light:
- platform: monochromatic
output: chl01
name: 'CHL 01'
id: chl_01
default_transition_length: 2s
gamma_correct: 0
- platform: monochromatic
output: chl02
name: 'CHL 02'
id: chl_02
default_transition_length: 2s
gamma_correct: 0
- platform: monochromatic
output: chl03
name: 'CHL 03'
id: chl_03
default_transition_length: 2s
gamma_correct: 0
- platform: monochromatic
output: chl04
name: 'CHL 04'
id: chl_04
default_transition_length: 2s
gamma_correct: 0
- platform: monochromatic
output: chr01
name: 'CHR 01'
id: chr_01
default_transition_length: 2s
gamma_correct: 0
- platform: monochromatic
output: chr02
name: 'CHR 02'
id: chr_02
default_transition_length: 2s
gamma_correct: 0
- platform: monochromatic
output: chr03
name: 'CHR 03'
id: chr_03
default_transition_length: 2s
gamma_correct: 0
- platform: monochromatic
output: chr04
name: 'CHR 04'
id: chr_04
default_transition_length: 2s
gamma_correct: 0
debug:
update_interval: 15s
sensor:
- platform: debug
free:
name: "Heap Free"
block:
name: "Heap Max Block"
loop_time:
name: "Loop Time"
- platform: lm75b
id: boneIO_temp
name: 'Temperature'
update_interval: 30s
entity_category: diagnostic
on_value_range:
- above: 70.0
then:
- switch.turn_on: buzzer
- below: 70.0
then:
- switch.turn_off: buzzer
switch:
- platform: gpio
id: buzzer
name: 'Buzzer'
pin:
number: GPIO9
mode:
output: true
inverted: false
- platform: gpio
id: can_bus_switch
name: 'CAN Bus Switch'
pin:
number: GPIO35
mode:
output: true
inverted: false
binary_sensor:
- platform: gpio
name: 'IN_01'
id: in_01
pin:
pcf8574: pcf_inputs
number: 0
mode:
input: true
inverted: true
- platform: gpio
name: 'IN_02'
id: in_02
pin:
pcf8574: pcf_inputs
number: 1
mode:
input: true
inverted: true
- platform: gpio
name: 'IN_03'
id: in_03
pin:
pcf8574: pcf_inputs
number: 2
mode:
input: true
inverted: true
- platform: gpio
name: 'IN_04'
id: in_04
pin:
pcf8574: pcf_inputs
number: 3
mode:
input: true
inverted: true
- platform: gpio
name: 'IN_05'
id: in_05
pin:
pcf8574: pcf_inputs
number: 4
mode:
input: true
inverted: true
- platform: gpio
name: 'IN_06'
id: in_06
pin:
pcf8574: pcf_inputs
number: 5
mode:
input: true
inverted: true
- platform: gpio
name: 'IN_07'
id: in_07
pin:
pcf8574: pcf_inputs
number: 6
mode:
input: true
inverted: true
- platform: gpio
name: 'IN_08'
id: in_08
pin:
pcf8574: pcf_inputs
number: 7
mode:
input: true
inverted: truesubstitutions
substitutions:
name: boneio-dr-gen2-8ch-01
friendly_name: 'BoneIO Dimmer Gen2'
serial_prefix: 'dim2' #Don't change it.
firmware_manifest: 'https://boneio.eu/fwesp/boneio-dr-gen2-8ch-01.json'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 Dimmer-G2" if you have one boneIO controller, or for example, "boneIO Dimmer-G2 1st-floor".
esphome
esphome:
name: '${name}'
friendly_name: '${friendly_name}'
name_add_mac_suffix: true
project:
name: boneio.dimmer-led-gen2
version: '0.1'
on_boot:
priority: -100
then:
- delay: 5s
- if:
condition:
lambda: 'return id(serial_no) != nullptr;'
then:
- component.update: serial_no
- logger.log: "Serial No updated on boot"
else:
- logger.log: "Serial No component not found"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: esp32-s3-devkitc-1
framework:
type: esp-idfDefinition of the ESP32 board and the required framework.
Ethernet
ethernet:
id: eth
type: W5500
clk_pin: GPIO13
mosi_pin: GPIO39
miso_pin: GPIO38
cs_pin: GPIO12
interrupt_pin: GPIO2
reset_pin: GPIO1
clock_speed: 25MHzThis 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-dimmer_gen2_8ch-v0_1.yaml@main
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
packages:
internals_packages:
url: https://github.com/boneIO-eu/esphome
ref: v1.7.1
files: [
'devices/serial_no.yaml',
]
# boneiopackages:
# url: https://github.com/boneIO-eu/esphome_packages
# ref: main
# refresh: 1min
# files:
# - path: sdm630.yamlHere are definitions of all packages used by boneIO, with the address to our GitHub. You can also find there the definitions of modbus devices. In example there is configuration which will allow you to run SDM630 meter - you just need to uncomment it!
logger
logger:
hardware_uart: UART0In case of troubleshooting, you can increase the log level to INFO, WARN, or DEBUG. This can be very useful in some cases.
api
api:
reboot_timeout: 0sHere, 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
- platform: web_serverPart responsible for Over The Air updates. The web_server platform allows updating via the device's web panel.
web_server
web_server:
port: 80
local: true
version: 3Part responsible for enabling the web server of the controller.
Modbus
# CAN gpio48 - tx, gpio47 rx, gpio35 stb
# uart:
# id: boneio_uart
# rx_pin: GPIO21
# tx_pin: GPIO14
# baud_rate: 9600
# stop_bits: 1
# modbus:
# send_wait_time: 80ms
# uart_id: boneio_uart
# id: boneio_modbusThis section is responsible for Modbus. If you plan to use it, you should first uncomment it.
Then, please check our Modbus tutorial: Modbus with Esphome packages