Move logic to script with short delay (#324)
fixes dry contact input toggle problem
This commit is contained in:
parent
2b0ae200f6
commit
a50d6014f7
38
base.yaml
38
base.yaml
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue