WIP motion light with three sensor for Taverna lights
This commit is contained in:
@@ -1 +1 @@
|
|||||||
2024.10.4
|
2024.11.2
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
- 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
|
||||||
use_blueprint:
|
use_blueprint:
|
||||||
@@ -6,27 +6,27 @@
|
|||||||
input:
|
input:
|
||||||
window_sensor: binary_sensor.bagnoovest_finestra_contact
|
window_sensor: binary_sensor.bagnoovest_finestra_contact
|
||||||
climate_target: climate.bagnoovest_termosifone
|
climate_target: climate.bagnoovest_termosifone
|
||||||
- id: '1729887529602'
|
- id: "1729887529602"
|
||||||
alias: BagnoPT-save-energy
|
alias: BagnoPT-save-energy
|
||||||
description: ''
|
description: ""
|
||||||
use_blueprint:
|
use_blueprint:
|
||||||
path: homeassistant/heat_save.yaml
|
path: homeassistant/heat_save.yaml
|
||||||
input:
|
input:
|
||||||
window_sensor: binary_sensor.bagnopt_finestra_contact
|
window_sensor: binary_sensor.bagnopt_finestra_contact
|
||||||
climate_target: climate.bagnopt_termosifone
|
climate_target: climate.bagnopt_termosifone
|
||||||
ext_temp_limit: 17
|
ext_temp_limit: 17
|
||||||
- id: '1729887632269'
|
- id: "1729887632269"
|
||||||
alias: SoggiornoPT-save-energy
|
alias: SoggiornoPT-save-energy
|
||||||
description: ''
|
description: ""
|
||||||
use_blueprint:
|
use_blueprint:
|
||||||
path: homeassistant/heat_save.yaml
|
path: homeassistant/heat_save.yaml
|
||||||
input:
|
input:
|
||||||
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: '1731410549094'
|
- id: "1731410549094"
|
||||||
alias: EVcharge_front_charging
|
alias: EVcharge_front_charging
|
||||||
description: ''
|
description: ""
|
||||||
triggers:
|
triggers:
|
||||||
- trigger: state
|
- trigger: state
|
||||||
entity_id:
|
entity_id:
|
||||||
@@ -52,9 +52,9 @@
|
|||||||
entity_id: c1f2a5e1b3bc7807a8b291b6fd6dbb31
|
entity_id: c1f2a5e1b3bc7807a8b291b6fd6dbb31
|
||||||
domain: switch
|
domain: switch
|
||||||
mode: single
|
mode: single
|
||||||
- id: '1731705145404'
|
- id: "1731705145404"
|
||||||
alias: Luce Automatica Scala Mansarda
|
alias: Luce Automatica Scala Mansarda
|
||||||
description: ''
|
description: ""
|
||||||
use_blueprint:
|
use_blueprint:
|
||||||
path: homeassistant/motion_light_dual_lux.yaml
|
path: homeassistant/motion_light_dual_lux.yaml
|
||||||
input:
|
input:
|
||||||
@@ -62,9 +62,9 @@
|
|||||||
motion_entity_up: binary_sensor.presenza_alta_scala_mansarda_occupancy
|
motion_entity_up: binary_sensor.presenza_alta_scala_mansarda_occupancy
|
||||||
light_target:
|
light_target:
|
||||||
device_id: 702137a6f2c17b89fdb0598f7003743c
|
device_id: 702137a6f2c17b89fdb0598f7003743c
|
||||||
- id: '1731705400752'
|
- id: "1731705400752"
|
||||||
alias: Luce Automatica Scala Taverna
|
alias: Luce Automatica Scala Taverna
|
||||||
description: ''
|
description: ""
|
||||||
use_blueprint:
|
use_blueprint:
|
||||||
path: homeassistant/motion_light_dual_lux.yaml
|
path: homeassistant/motion_light_dual_lux.yaml
|
||||||
input:
|
input:
|
||||||
@@ -73,3 +73,41 @@
|
|||||||
light_target:
|
light_target:
|
||||||
device_id: 226779fb30bd68c5a2784ccd762d90e9
|
device_id: 226779fb30bd68c5a2784ccd762d90e9
|
||||||
sun_condition: false
|
sun_condition: false
|
||||||
|
- id: "1731953745814"
|
||||||
|
alias: EVcharge-front-program
|
||||||
|
description: ""
|
||||||
|
triggers:
|
||||||
|
- trigger: state
|
||||||
|
entity_id:
|
||||||
|
- input_boolean.evcharge_front_start
|
||||||
|
from: "off"
|
||||||
|
to: "on"
|
||||||
|
conditions:
|
||||||
|
- condition: time
|
||||||
|
after: input_datetime.evcharge_good_time_start
|
||||||
|
before: input_datetime.evcharge_good_time_end
|
||||||
|
weekday:
|
||||||
|
- sun
|
||||||
|
- mon
|
||||||
|
- tue
|
||||||
|
- wed
|
||||||
|
- thu
|
||||||
|
- fri
|
||||||
|
- sat
|
||||||
|
actions:
|
||||||
|
- action: switch.turn_on
|
||||||
|
metadata: {}
|
||||||
|
data: {}
|
||||||
|
target:
|
||||||
|
device_id: 62352ecf274ff68e3ddfbc979406d49d
|
||||||
|
- wait_template:
|
||||||
|
"{{ states('sensor.presa_smart_1_power') < states('input_number.evcharge_no_charge_threshold')
|
||||||
|
}}"
|
||||||
|
continue_on_timeout: true
|
||||||
|
timeout: 00:30:00
|
||||||
|
- action: switch.turn_off
|
||||||
|
metadata: {}
|
||||||
|
data: {}
|
||||||
|
target:
|
||||||
|
device_id: 62352ecf274ff68e3ddfbc979406d49d
|
||||||
|
mode: single
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ actions:
|
|||||||
hvac_mode: "off"
|
hvac_mode: "off"
|
||||||
target:
|
target:
|
||||||
entity_id: !input climate_target
|
entity_id: !input climate_target
|
||||||
- action: notify.mobile_app_ttrabatt_iphone15pro
|
- action: notify.mobile_app_ttrabatt_iphone15
|
||||||
metadata: {}
|
metadata: {}
|
||||||
data:
|
data:
|
||||||
message: >
|
message: >
|
||||||
@@ -72,7 +72,7 @@ actions:
|
|||||||
hvac_mode: "heat"
|
hvac_mode: "heat"
|
||||||
target:
|
target:
|
||||||
entity_id: !input climate_target
|
entity_id: !input climate_target
|
||||||
- action: notify.mobile_app_ttrabatt_iphone15pro
|
- action: notify.mobile_app_ttrabatt_iphone15
|
||||||
metadata: {}
|
metadata: {}
|
||||||
data:
|
data:
|
||||||
message: >
|
message: >
|
||||||
@@ -81,7 +81,7 @@ actions:
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
sequence:
|
sequence:
|
||||||
- action: notify.mobile_app_ttrabatt_iphone15pro
|
- action: notify.mobile_app_ttrabatt_iphone15
|
||||||
metadata: {}
|
metadata: {}
|
||||||
data:
|
data:
|
||||||
title: HA template 'heat_save' ERROR
|
title: HA template 'heat_save' ERROR
|
||||||
|
|||||||
134
blueprints/automation/homeassistant/motion_light_tris_lux.yaml
Normal file
134
blueprints/automation/homeassistant/motion_light_tris_lux.yaml
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
blueprint:
|
||||||
|
name: Tris Sensor Sunset and Luminescence Motion-activated Light
|
||||||
|
description: Turn on a light when motion is detected (with Sunrise / Sunset / Luminance).
|
||||||
|
domain: automation
|
||||||
|
# source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
|
||||||
|
author: Tiziano Trabattoni
|
||||||
|
input:
|
||||||
|
motion_entity_uno:
|
||||||
|
name: Motion Sensor (Sensore Uno)
|
||||||
|
description: Sensore Uno
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
filter:
|
||||||
|
device_class: motion
|
||||||
|
domain: binary_sensor
|
||||||
|
motion_entity_due:
|
||||||
|
name: Motion Sensor (Sensore Due)
|
||||||
|
description: Sensore Due
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
filter:
|
||||||
|
device_class: motion
|
||||||
|
domain: binary_sensor
|
||||||
|
motion_entity_tre:
|
||||||
|
name: Motion Sensor (Sensore Tre)
|
||||||
|
description: Sensore tre
|
||||||
|
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
|
||||||
|
|
||||||
|
triggers:
|
||||||
|
- trigger: state
|
||||||
|
entity_id:
|
||||||
|
- !input motion_entity_uno
|
||||||
|
- !input motion_entity_due
|
||||||
|
- !input motion_entity_tre
|
||||||
|
to: "on"
|
||||||
|
id: motion-detected
|
||||||
|
- trigger: state
|
||||||
|
entity_id:
|
||||||
|
- !input motion_entity_uno
|
||||||
|
- !input motion_entity_due
|
||||||
|
- !input motion_entity_tre
|
||||||
|
to: "off"
|
||||||
|
for:
|
||||||
|
hours: 0
|
||||||
|
minutes: 0
|
||||||
|
seconds: !input no_motion_wait
|
||||||
|
|
||||||
|
conditions: []
|
||||||
|
|
||||||
|
actions:
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ use_sun }}"
|
||||||
|
sequence:
|
||||||
|
# we need to use either external luminescence or sunrise and sunset conditions
|
||||||
|
- if:
|
||||||
|
- or:
|
||||||
|
# external light is LOW (below Helper daylight_luminescence set value)
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ ( states('sensor.esterno_luminosita_illuminance_lux') | int ) < ( states('input_number.daylight_luminescence') | int ) }}"
|
||||||
|
# after sunrise and before sunset
|
||||||
|
- condition: sun
|
||||||
|
after: sunset
|
||||||
|
after_offset: "-01:00:00"
|
||||||
|
before: sunrise
|
||||||
|
before_offset: "+01:00:00"
|
||||||
|
then:
|
||||||
|
- if:
|
||||||
|
- condition: trigger
|
||||||
|
id:
|
||||||
|
- motion-detected
|
||||||
|
then:
|
||||||
|
- sequence:
|
||||||
|
- action: light.brightness = 254
|
||||||
|
target: !input light_target
|
||||||
|
data: {}
|
||||||
|
- action: light.turn_on
|
||||||
|
target: !input light_target
|
||||||
|
data: {}
|
||||||
|
else:
|
||||||
|
- action: light.turn_off
|
||||||
|
metadata: {}
|
||||||
|
data:
|
||||||
|
transition: 10
|
||||||
|
target: !input light_target
|
||||||
|
default:
|
||||||
|
# the motion light is always active
|
||||||
|
- if:
|
||||||
|
- condition: trigger
|
||||||
|
id:
|
||||||
|
- motion-detected
|
||||||
|
then:
|
||||||
|
- action: light.turn_on
|
||||||
|
target: !input light_target
|
||||||
|
data: {}
|
||||||
|
else:
|
||||||
|
- sequence:
|
||||||
|
- action: light.brightness = 254
|
||||||
|
target: !input light_target
|
||||||
|
data: {}
|
||||||
|
- action: light.turn_on
|
||||||
|
target: !input light_target
|
||||||
|
data: {}
|
||||||
|
|
||||||
|
mode: single
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
blueprint:
|
||||||
|
name: Invert a binary sensor
|
||||||
|
description: Creates a binary_sensor which holds the inverted value of a reference binary_sensor
|
||||||
|
domain: template
|
||||||
|
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/template/blueprints/inverted_binary_sensor.yaml
|
||||||
|
input:
|
||||||
|
reference_entity:
|
||||||
|
name: Binary sensor to be inverted
|
||||||
|
description: The binary_sensor which needs to have its value inverted
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
domain: binary_sensor
|
||||||
|
variables:
|
||||||
|
reference_entity: !input reference_entity
|
||||||
|
binary_sensor:
|
||||||
|
state: >
|
||||||
|
{% if states(reference_entity) == 'on' %}
|
||||||
|
off
|
||||||
|
{% elif states(reference_entity) == 'off' %}
|
||||||
|
on
|
||||||
|
{% else %}
|
||||||
|
{{ states(reference_entity) }}
|
||||||
|
{% endif %}
|
||||||
|
# delay_on: not_used in this example
|
||||||
|
# delay_off: not_used in this example
|
||||||
|
# auto_off: not_used in this example
|
||||||
|
availability: "{{ states(reference_entity) not in ('unknown', 'unavailable') }}"
|
||||||
Reference in New Issue
Block a user