WIP dual motion not working
This commit is contained in:
@@ -1,23 +1,3 @@
|
|||||||
- id: '1709401667410'
|
|
||||||
alias: Luce Scala Taverna (sensore alto)
|
|
||||||
description: Attiva Luce Scala Taverna su presenza
|
|
||||||
use_blueprint:
|
|
||||||
path: homeassistant/motion_light.yaml
|
|
||||||
input:
|
|
||||||
motion_entity: binary_sensor.presenza_alta_scala_taverna_occupancy
|
|
||||||
light_target:
|
|
||||||
device_id: 226779fb30bd68c5a2784ccd762d90e9
|
|
||||||
no_motion_wait: 20
|
|
||||||
- id: '1728486287191'
|
|
||||||
alias: Luce Scala Taverna (sensore basso)
|
|
||||||
description: Attiva Luce Scala Taverna su presenza
|
|
||||||
use_blueprint:
|
|
||||||
path: homeassistant/motion_light.yaml
|
|
||||||
input:
|
|
||||||
motion_entity: binary_sensor.presenza_bassa_scala_taverna_occupancy
|
|
||||||
light_target:
|
|
||||||
device_id: 226779fb30bd68c5a2784ccd762d90e9
|
|
||||||
no_motion_wait: 20
|
|
||||||
- id: '1728594248560'
|
- id: '1728594248560'
|
||||||
alias: Luce Scala Mansarda (sensore alto)
|
alias: Luce Scala Mansarda (sensore alto)
|
||||||
description: Attiva Luce Scala Mansarda su presenza
|
description: Attiva Luce Scala Mansarda su presenza
|
||||||
@@ -28,16 +8,6 @@
|
|||||||
light_target:
|
light_target:
|
||||||
device_id: 702137a6f2c17b89fdb0598f7003743c
|
device_id: 702137a6f2c17b89fdb0598f7003743c
|
||||||
no_motion_wait: 20
|
no_motion_wait: 20
|
||||||
- id: '1728594117428'
|
|
||||||
alias: Luce Scala Mansarda (sensore basso)
|
|
||||||
description: Attiva Luce Scala Mansarda su presenza
|
|
||||||
use_blueprint:
|
|
||||||
path: homeassistant/motion_light_custom.yaml
|
|
||||||
input:
|
|
||||||
motion_entity: binary_sensor.presenza_bassa_scala_mansarda_occupancy
|
|
||||||
light_target:
|
|
||||||
device_id: 702137a6f2c17b89fdb0598f7003743c
|
|
||||||
no_motion_wait: 20
|
|
||||||
- id: '1729875991469'
|
- id: '1729875991469'
|
||||||
alias: BagnoOvest-save-energy
|
alias: BagnoOvest-save-energy
|
||||||
description: Thermostat will close upon window open
|
description: Thermostat will close upon window open
|
||||||
@@ -64,13 +34,55 @@
|
|||||||
window_sensor: binary_sensor.soggiornopt_finestrasud_contact
|
window_sensor: binary_sensor.soggiornopt_finestrasud_contact
|
||||||
climate_target: climate.soggiornopt_termosifonesud
|
climate_target: climate.soggiornopt_termosifonesud
|
||||||
ext_temp_limit: 17
|
ext_temp_limit: 17
|
||||||
- id: '1730504030103'
|
- id: '1730726143088'
|
||||||
alias: test-dual-motion
|
alias: Luce Automatica Scala Taverna
|
||||||
|
description: ''
|
||||||
|
use_blueprint:
|
||||||
|
path: homeassistant/motion_light_dual_no_sun.yaml
|
||||||
|
input:
|
||||||
|
motion_entity_down: binary_sensor.presenza_bassa_scala_taverna_occupancy
|
||||||
|
motion_entity_up: binary_sensor.presenza_alta_scala_taverna_occupancy
|
||||||
|
light_target:
|
||||||
|
device_id: 226779fb30bd68c5a2784ccd762d90e9
|
||||||
|
no_motion_wait: 20
|
||||||
|
- id: '1730726243854'
|
||||||
|
alias: Luce Automatica Scala Mansarda
|
||||||
description: ''
|
description: ''
|
||||||
use_blueprint:
|
use_blueprint:
|
||||||
path: homeassistant/motion_light_dual.yaml
|
path: homeassistant/motion_light_dual.yaml
|
||||||
input:
|
input:
|
||||||
light_target:
|
|
||||||
device_id: 702137a6f2c17b89fdb0598f7003743c
|
|
||||||
motion_entity_down: binary_sensor.presenza_bassa_scala_mansarda_occupancy
|
motion_entity_down: binary_sensor.presenza_bassa_scala_mansarda_occupancy
|
||||||
motion_entity_up: binary_sensor.presenza_alta_scala_mansarda_occupancy
|
motion_entity_up: binary_sensor.presenza_alta_scala_mansarda_occupancy
|
||||||
|
light_target:
|
||||||
|
device_id: 702137a6f2c17b89fdb0598f7003743c
|
||||||
|
no_motion_wait: 20
|
||||||
|
- id: '1730750325096'
|
||||||
|
alias: Luce Scala Mansarda (sensore basso)
|
||||||
|
description: Attiva Luce Scala Mansarda su presenza
|
||||||
|
use_blueprint:
|
||||||
|
path: homeassistant/motion_light_custom.yaml
|
||||||
|
input:
|
||||||
|
motion_entity: binary_sensor.presenza_bassa_scala_mansarda_occupancy
|
||||||
|
light_target:
|
||||||
|
device_id: 702137a6f2c17b89fdb0598f7003743c
|
||||||
|
no_motion_wait: 20
|
||||||
|
- id: '1730750447496'
|
||||||
|
alias: Luce Scala Taverna (sensore alto)
|
||||||
|
description: Attiva Luce Scala Mansarda su presenza
|
||||||
|
use_blueprint:
|
||||||
|
path: homeassistant/motion_light_custom.yaml
|
||||||
|
input:
|
||||||
|
motion_entity: binary_sensor.presenza_alta_scala_taverna_occupancy
|
||||||
|
light_target:
|
||||||
|
device_id: 226779fb30bd68c5a2784ccd762d90e9
|
||||||
|
no_motion_wait: 20
|
||||||
|
- id: '1730750486844'
|
||||||
|
alias: Luce Scala Taverna (sensore basso)
|
||||||
|
description: Attiva Luce Scala Mansarda su presenza
|
||||||
|
use_blueprint:
|
||||||
|
path: homeassistant/motion_light_custom.yaml
|
||||||
|
input:
|
||||||
|
motion_entity: binary_sensor.presenza_bassa_scala_taverna_occupancy
|
||||||
|
light_target:
|
||||||
|
device_id: 226779fb30bd68c5a2784ccd762d90e9
|
||||||
|
no_motion_wait: 20
|
||||||
|
|||||||
@@ -36,13 +36,35 @@ blueprint:
|
|||||||
no_motion_wait:
|
no_motion_wait:
|
||||||
name: Wait time
|
name: Wait time
|
||||||
description: Time to leave the light on after last motion is detected.
|
description: Time to leave the light on after last motion is detected.
|
||||||
default: 120
|
default: 30
|
||||||
selector:
|
selector:
|
||||||
number:
|
number:
|
||||||
min: 0
|
min: 10
|
||||||
max: 3600
|
max: 120
|
||||||
unit_of_measurement: seconds
|
unit_of_measurement: seconds
|
||||||
|
|
||||||
|
trigger_variables:
|
||||||
|
use_sun: !input sun_condition
|
||||||
|
# local_condition:
|
||||||
|
# mode: single
|
||||||
|
# sequence:
|
||||||
|
# - choose:
|
||||||
|
# - conditions:
|
||||||
|
# - condition: template
|
||||||
|
# value_template: "{{ use_sun }}"
|
||||||
|
# sequence:
|
||||||
|
# data: >
|
||||||
|
# - condition: sun
|
||||||
|
# after: sunset
|
||||||
|
# after_offset: "-01:00:00"
|
||||||
|
# before: sunrise
|
||||||
|
# before_offset: "+01:00:00"
|
||||||
|
# - conditions:
|
||||||
|
# - condition: template
|
||||||
|
# value_template: "{{ not use_sun }}"
|
||||||
|
# sequence:
|
||||||
|
# data: []
|
||||||
|
|
||||||
# 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
|
||||||
@@ -58,13 +80,16 @@ triggers:
|
|||||||
from: "off"
|
from: "off"
|
||||||
to: "on"
|
to: "on"
|
||||||
|
|
||||||
|
# {% if states( use_sun ) %}
|
||||||
conditions:
|
conditions:
|
||||||
# {% if %}
|
|
||||||
- condition: sun
|
- condition: sun
|
||||||
after: sunset
|
after: sunset
|
||||||
after_offset: "-01:00:00"
|
after_offset: "-01:00:00"
|
||||||
before: sunrise
|
before: sunrise
|
||||||
before_offset: "+01:00:00"
|
before_offset: "+01:00:00"
|
||||||
|
# {% endif %}
|
||||||
|
|
||||||
|
# conditions: "{{ local_conditions }}"
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
- alias: "Turn on the light"
|
- alias: "Turn on the light"
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
blueprint:
|
||||||
|
name: Dual Sensor Motion-activated Light Customised temporary no sun condition
|
||||||
|
description: Turn on a light when motion is detected.
|
||||||
|
domain: automation
|
||||||
|
# source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
|
||||||
|
author: Home Assistant Rewised by Tiziano Trabattoni
|
||||||
|
input:
|
||||||
|
motion_entity_down:
|
||||||
|
name: Motion Sensor (Sensore Basso)
|
||||||
|
description: Sensore parte bassa della scala
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
filter:
|
||||||
|
device_class: motion
|
||||||
|
domain: binary_sensor
|
||||||
|
motion_entity_up:
|
||||||
|
name: Motion Sensor (Sensore Alto)
|
||||||
|
description: Sensore parte alta della scala
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
filter:
|
||||||
|
device_class: motion
|
||||||
|
domain: binary_sensor
|
||||||
|
light_target:
|
||||||
|
name: Light`
|
||||||
|
selector:
|
||||||
|
target:
|
||||||
|
entity:
|
||||||
|
domain: light
|
||||||
|
sun_condition:
|
||||||
|
name: Sun_driven
|
||||||
|
description: Controlled by sunrise and sunset
|
||||||
|
default: on
|
||||||
|
selector:
|
||||||
|
boolean:
|
||||||
|
no_motion_wait:
|
||||||
|
name: Wait time
|
||||||
|
description: Time to leave the light on after last motion is detected.
|
||||||
|
default: 30
|
||||||
|
selector:
|
||||||
|
number:
|
||||||
|
min: 10
|
||||||
|
max: 120
|
||||||
|
unit_of_measurement: seconds
|
||||||
|
|
||||||
|
trigger_variables:
|
||||||
|
use_sun: !input sun_condition
|
||||||
|
|
||||||
|
# If motion is detected within the delay,
|
||||||
|
# we restart the script.
|
||||||
|
mode: restart
|
||||||
|
max_exceeded: silent
|
||||||
|
|
||||||
|
triggers:
|
||||||
|
- trigger: state
|
||||||
|
entity_id: !input motion_entity_down
|
||||||
|
from: "off"
|
||||||
|
to: "on"
|
||||||
|
- trigger: state
|
||||||
|
entity_id: !input motion_entity_up
|
||||||
|
from: "off"
|
||||||
|
to: "on"
|
||||||
|
|
||||||
|
# Temporary no condition for scala taverna
|
||||||
|
conditions: []
|
||||||
|
# Unable to set different condition based on sun condition flag
|
||||||
|
|
||||||
|
actions:
|
||||||
|
- alias: "Turn on the light"
|
||||||
|
action: light.turn_on
|
||||||
|
target: !input light_target
|
||||||
|
- alias: "Wait until there is no motion from up device"
|
||||||
|
wait_for_trigger:
|
||||||
|
trigger: state
|
||||||
|
entity_id: !input motion_entity_up
|
||||||
|
# from: "on"
|
||||||
|
to: "off"
|
||||||
|
- alias: "Wait until there is no motion from down device"
|
||||||
|
wait_for_trigger:
|
||||||
|
trigger: state
|
||||||
|
entity_id: !input motion_entity_down
|
||||||
|
# from: "on"
|
||||||
|
to: "off"
|
||||||
|
- alias: "Wait the number of seconds that has been set"
|
||||||
|
delay: !input no_motion_wait
|
||||||
|
- alias: "Turn off the light"
|
||||||
|
action: light.turn_off
|
||||||
|
target: !input light_target
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
- platform: template
|
- platform: template
|
||||||
sensors:
|
sensors:
|
||||||
scala_taverna_motion:
|
scala_taverna_motion:
|
||||||
|
unique_id: scala_taverna_motion
|
||||||
friendly_name: Scala Taverna Motion Sensor
|
friendly_name: Scala Taverna Motion Sensor
|
||||||
value_template: >-
|
value_template: >-
|
||||||
{% if states('binary_sensor.presenza_bassa_scala_taverna_occupancy') == 'on' or states('binary_sensor.presenza_alta_scala_taverna_occupancy') == 'on' %}
|
{% if states('binary_sensor.presenza_bassa_scala_taverna_occupancy') == 'on' or states('binary_sensor.presenza_alta_scala_taverna_occupancy') == 'on' %}
|
||||||
|
|||||||
Reference in New Issue
Block a user