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:
|
filters:
|
||||||
- delayed_on_off: 500ms
|
- delayed_on_off: 500ms
|
||||||
on_press:
|
on_press:
|
||||||
- if:
|
|
||||||
condition:
|
|
||||||
binary_sensor.is_off: ${id_prefix}_dry_contact_close
|
|
||||||
then:
|
then:
|
||||||
- cover.open: ${id_prefix}_garage_door
|
script.execute: "${id_prefix}_dry_contact_door_control"
|
||||||
else:
|
|
||||||
- cover.toggle: ${id_prefix}_garage_door
|
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
id: "${id_prefix}_dry_contact_close"
|
id: "${id_prefix}_dry_contact_close"
|
||||||
pin:
|
pin:
|
||||||
|
@ -164,11 +159,8 @@ binary_sensor:
|
||||||
filters:
|
filters:
|
||||||
- delayed_on_off: 500ms
|
- delayed_on_off: 500ms
|
||||||
on_press:
|
on_press:
|
||||||
- if:
|
|
||||||
condition:
|
|
||||||
binary_sensor.is_off: ${id_prefix}_dry_contact_open
|
|
||||||
then:
|
then:
|
||||||
- cover.close: ${id_prefix}_garage_door
|
script.execute: "${id_prefix}_dry_contact_door_control"
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
id: "${id_prefix}_dry_contact_light"
|
id: "${id_prefix}_dry_contact_light"
|
||||||
pin:
|
pin:
|
||||||
|
@ -184,6 +176,32 @@ binary_sensor:
|
||||||
on_press:
|
on_press:
|
||||||
- light.toggle: ${id_prefix}_light
|
- 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:
|
number:
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_rolling_code_counter
|
id: ${id_prefix}_rolling_code_counter
|
||||||
|
|
|
@ -96,13 +96,8 @@ binary_sensor:
|
||||||
filters:
|
filters:
|
||||||
- delayed_on_off: 500ms
|
- delayed_on_off: 500ms
|
||||||
on_press:
|
on_press:
|
||||||
- if:
|
|
||||||
condition:
|
|
||||||
binary_sensor.is_off: ${id_prefix}_dry_contact_close
|
|
||||||
then:
|
then:
|
||||||
- cover.open: ${id_prefix}_garage_door
|
script.execute: "${id_prefix}_dry_contact_door_control"
|
||||||
else:
|
|
||||||
- cover.toggle: ${id_prefix}_garage_door
|
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
id: "${id_prefix}_dry_contact_close"
|
id: "${id_prefix}_dry_contact_close"
|
||||||
pin:
|
pin:
|
||||||
|
@ -116,11 +111,8 @@ binary_sensor:
|
||||||
filters:
|
filters:
|
||||||
- delayed_on_off: 500ms
|
- delayed_on_off: 500ms
|
||||||
on_press:
|
on_press:
|
||||||
- if:
|
|
||||||
condition:
|
|
||||||
binary_sensor.is_off: ${id_prefix}_dry_contact_open
|
|
||||||
then:
|
then:
|
||||||
- cover.close: ${id_prefix}_garage_door
|
script.execute: "${id_prefix}_dry_contact_door_control"
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
id: "${id_prefix}_dry_contact_light"
|
id: "${id_prefix}_dry_contact_light"
|
||||||
pin:
|
pin:
|
||||||
|
@ -136,6 +128,32 @@ binary_sensor:
|
||||||
on_press:
|
on_press:
|
||||||
- light.toggle: ${id_prefix}_light
|
- 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:
|
number:
|
||||||
- platform: ratgdo
|
- platform: ratgdo
|
||||||
id: ${id_prefix}_rolling_code_counter
|
id: ${id_prefix}_rolling_code_counter
|
||||||
|
|
Loading…
Reference in New Issue