In Esphome covers doesn’t have tilt functions.
For covers we prepared output file (which is bundled in new configurations). We use switch component for covers as only those support interlock.
switch:
- platform: gpio
id: cover_open_01_out01
pin:
pcf8574: pcf_left
number: 15
mode:
output: true
inverted: true
interlock: &cover_interlock_01 [cover_open_01_out01, cover_close_01_out02]
interlock_wait_time: 5ms
restore_mode: always off
User don’t need to edit that unless you want to edit interlock_wait_time
.
Naming for outputs are:
You have to install Cover (or Cover Mix) configuration from our website and adopt device in Esphome addon to get it working properly:
Always have cover fully open when configuring first time!
Put some safe long time to open and close your cover (do it carefully! We’re not responsible for any damage made by you).
Let’s say 60 seconds
cover:
- platform: time_based
name: 'Cover 01'
id: cover_01
open_action:
- switch.turn_on: cover_open_01_out01
open_duration: 60s
close_action:
- switch.turn_on: cover_close_01_out02
close_duration: 60s
stop_action:
- switch.turn_off: cover_open_01_out01
- switch.turn_off: cover_close_01_out02
As you can see I edited open_duration: 60s
and close_duration: 60s
to 60seconds.
Compile your firmware and upload it.
This config is provided by default in our firmware.
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
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:
- lambda: |
auto call = id(cover_01).make_call();
if (id(cover_01).current_operation == COVER_OPERATION_IDLE){
call.set_command_open();
}else{
call.set_command_stop();
}
call.perform();
- platform: gpio
name: 'IN_02'
id: in_02
pin:
pcf8574: pcf_inputs_1to14
number: 1
mode:
input: true
inverted: true
on_press:
then:
- lambda: |
auto call = id(cover_01).make_call();
if (id(cover_01).current_operation == COVER_OPERATION_IDLE){
call.set_command_close();
}else{
call.set_command_stop();
}
call.perform();
binary_sensor:
- platform: gpio
name: 'IN_01'
id: in_01
pin:
pcf8574: pcf_inputs_1to14
number: 0
mode:
input: true
inverted: true
on_click:
then:
- cover.toggle: cover_01