Move logic to script with short delay (#324)

fixes dry contact input toggle problem
This commit is contained in:
Paul Wieland 2024-09-28 11:36:07 -07:00 committed by GitHub
parent 2b0ae200f6
commit a50d6014f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 60 additions and 24 deletions

View File

@ -144,13 +144,8 @@ binary_sensor:
filters:
- delayed_on_off: 500ms
on_press:
- if:
condition:
binary_sensor.is_off: ${id_prefix}_dry_contact_close
then:
- cover.open: ${id_prefix}_garage_door
else:
- cover.toggle: ${id_prefix}_garage_door
script.execute: "${id_prefix}_dry_contact_door_control"
- platform: gpio
id: "${id_prefix}_dry_contact_close"
pin:
@ -164,11 +159,8 @@ binary_sensor:
filters:
- delayed_on_off: 500ms
on_press:
- if:
condition:
binary_sensor.is_off: ${id_prefix}_dry_contact_open
then:
- cover.close: ${id_prefix}_garage_door
script.execute: "${id_prefix}_dry_contact_door_control"
- platform: gpio
id: "${id_prefix}_dry_contact_light"
pin:
@ -184,6 +176,32 @@ binary_sensor:
on_press:
- light.toggle: ${id_prefix}_light
script:
- id: "${id_prefix}_dry_contact_door_control"
then:
- delay: 0.1s
- if:
condition:
and:
- binary_sensor.is_on: ${id_prefix}_dry_contact_close
- binary_sensor.is_on: ${id_prefix}_dry_contact_open
then:
- cover.toggle: ${id_prefix}_garage_door
- if:
condition:
and:
- binary_sensor.is_off: ${id_prefix}_dry_contact_close
- binary_sensor.is_on: ${id_prefix}_dry_contact_open
then:
- cover.open: ${id_prefix}_garage_door
- if:
condition:
and:
- binary_sensor.is_on: ${id_prefix}_dry_contact_close
- binary_sensor.is_off: ${id_prefix}_dry_contact_open
then:
- cover.close: ${id_prefix}_garage_door
number:
- platform: ratgdo
id: ${id_prefix}_rolling_code_counter

View File

@ -96,13 +96,8 @@ binary_sensor:
filters:
- delayed_on_off: 500ms
on_press:
- if:
condition:
binary_sensor.is_off: ${id_prefix}_dry_contact_close
then:
- cover.open: ${id_prefix}_garage_door
else:
- cover.toggle: ${id_prefix}_garage_door
script.execute: "${id_prefix}_dry_contact_door_control"
- platform: gpio
id: "${id_prefix}_dry_contact_close"
pin:
@ -116,11 +111,8 @@ binary_sensor:
filters:
- delayed_on_off: 500ms
on_press:
- if:
condition:
binary_sensor.is_off: ${id_prefix}_dry_contact_open
then:
- cover.close: ${id_prefix}_garage_door
script.execute: "${id_prefix}_dry_contact_door_control"
- platform: gpio
id: "${id_prefix}_dry_contact_light"
pin:
@ -136,6 +128,32 @@ binary_sensor:
on_press:
- light.toggle: ${id_prefix}_light
script:
- id: "${id_prefix}_dry_contact_door_control"
then:
- delay: 0.1s
- if:
condition:
and:
- binary_sensor.is_on: ${id_prefix}_dry_contact_close
- binary_sensor.is_on: ${id_prefix}_dry_contact_open
then:
- cover.toggle: ${id_prefix}_garage_door
- if:
condition:
and:
- binary_sensor.is_off: ${id_prefix}_dry_contact_close
- binary_sensor.is_on: ${id_prefix}_dry_contact_open
then:
- cover.open: ${id_prefix}_garage_door
- if:
condition:
and:
- binary_sensor.is_on: ${id_prefix}_dry_contact_close
- binary_sensor.is_off: ${id_prefix}_dry_contact_open
then:
- cover.close: ${id_prefix}_garage_door
number:
- platform: ratgdo
id: ${id_prefix}_rolling_code_counter