motion-light-new OK
This commit is contained in:
@@ -217,18 +217,7 @@
|
|||||||
payload: "double"
|
payload: "double"
|
||||||
value_template: "{{ value_json['action'] }}"
|
value_template: "{{ value_json['action'] }}"
|
||||||
id: Pulsante1-double
|
id: Pulsante1-double
|
||||||
# - domain: mqtt
|
|
||||||
# # device_id: 0b221729867cef10dcb428820c082f79
|
|
||||||
# type: action
|
|
||||||
# subtype: single
|
|
||||||
# trigger: device
|
|
||||||
# id: Pulsante1-single
|
|
||||||
# - domain: mqtt
|
|
||||||
# device_id: 0b221729867cef10dcb428820c082f79
|
|
||||||
# type: action
|
|
||||||
# subtype: double
|
|
||||||
# trigger: device
|
|
||||||
# id: Pulsante1-double
|
|
||||||
conditions: []
|
conditions: []
|
||||||
actions:
|
actions:
|
||||||
- choose:
|
- choose:
|
||||||
|
|||||||
@@ -35,13 +35,6 @@ blueprint:
|
|||||||
max: 300
|
max: 300
|
||||||
unit_of_measurement: seconds
|
unit_of_measurement: seconds
|
||||||
|
|
||||||
trigger_variables:
|
|
||||||
_light_target: !input light_target
|
|
||||||
# motion_entity1_var:
|
|
||||||
# entity_id: !input motion_entity1
|
|
||||||
# motion_entity2_var:
|
|
||||||
# entity_id: !input motion_entity2
|
|
||||||
#
|
|
||||||
# If motion is detected within the delay,
|
# If motion is detected within the delay,
|
||||||
# we restart the script.
|
# we restart the script.
|
||||||
mode: restart
|
mode: restart
|
||||||
@@ -69,8 +62,11 @@ triggers:
|
|||||||
to: "off"
|
to: "off"
|
||||||
id: motion_entity2_off
|
id: motion_entity2_off
|
||||||
|
|
||||||
# {% set light_target_var = 'light.test_lamp1' %}
|
variables:
|
||||||
# {{ is_state(light_target_var, 'on') }}
|
light_target_var: !input light_target
|
||||||
|
motion_entity1_var: !input motion_entity1
|
||||||
|
motion_entity2_var: !input motion_entity2
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
- choose:
|
- choose:
|
||||||
- conditions:
|
- conditions:
|
||||||
@@ -79,10 +75,15 @@ actions:
|
|||||||
- motion_entity1_on
|
- motion_entity1_on
|
||||||
- motion_entity2_on
|
- motion_entity2_on
|
||||||
sequence:
|
sequence:
|
||||||
- if:
|
# POSSIBILE baco, dovrebbe essere come di seguito ma la condizione dell'IF non funziona con le variabili qui ma e' ok nella validazione del templating
|
||||||
- condition: template
|
# - if:
|
||||||
value_template: "{{ states( 'light.test_lamp1' ) == 'off' }}"
|
# - condition: template
|
||||||
then:
|
# value_template: "{{ states( light_target_var) == 'off' }}"
|
||||||
|
# then:
|
||||||
|
# - alias: "Turn on the light"
|
||||||
|
# action: light.turn_on
|
||||||
|
# target: !input light_target
|
||||||
|
|
||||||
- alias: "Turn on the light"
|
- alias: "Turn on the light"
|
||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
target: !input light_target
|
target: !input light_target
|
||||||
@@ -97,16 +98,15 @@ actions:
|
|||||||
- alias: "None of motion sensor are detected"
|
- alias: "None of motion sensor are detected"
|
||||||
condition: not
|
condition: not
|
||||||
conditions:
|
conditions:
|
||||||
|
# - condition: template
|
||||||
|
# value_template: "{{ is_state('binary_sensor.presenza_alta_scala_mansarda_occupancy', 'on') }}"
|
||||||
|
# - condition: template
|
||||||
|
# value_template: "{{ is_state('binary_sensor.presenza_bassa_scala_mansarda_occupancy', 'on') }}"
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ is_state('binary_sensor.presenza_alta_scala_mansarda_occupancy', 'on') }}"
|
value_template: "{{ is_state(motion_entity1_var, 'on') }}"
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ is_state('binary_sensor.presenza_bassa_scala_mansarda_occupancy', 'on') }}"
|
value_template: "{{ is_state(motion_entity2_var, 'on') }}"
|
||||||
#- condition: state
|
|
||||||
# entity_id: !input motion_entity1
|
|
||||||
# state: true
|
|
||||||
#- condition: state
|
|
||||||
# entity_id: !input motion_entity2
|
|
||||||
# state: true
|
|
||||||
then:
|
then:
|
||||||
- alias: "Wait for delay set before turn off"
|
- alias: "Wait for delay set before turn off"
|
||||||
delay: !input no_motion_wait
|
delay: !input no_motion_wait
|
||||||
|
|||||||
Reference in New Issue
Block a user