mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-10 02:50:12 -04:00
blue_room to boys_room
This commit is contained in:
@@ -75,39 +75,39 @@ blueprint:
|
||||
mode: single
|
||||
max_exceeded: silent
|
||||
variables:
|
||||
device_id: !input 'ge_jasco'
|
||||
device_id: !input "ge_jasco"
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: zwave_js_value_notification
|
||||
condition: '{{ trigger.event.data.device_id == device_id }}'
|
||||
- platform: event
|
||||
event_type: zwave_js_value_notification
|
||||
condition: "{{ trigger.event.data.device_id == device_id }}"
|
||||
action:
|
||||
- variables:
|
||||
property_key_name: '{{ trigger.event.data.property_key_name }}'
|
||||
label: '{{ trigger.event.data.label }}'
|
||||
command_class_name: '{{ trigger.event.data.command_class_name }}'
|
||||
value: '{{ trigger.event.data.value }}'
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: 'Z-Wave JS'
|
||||
message: 'received event: {{ command_class_name }} - {{ value }} - {{ label }}'
|
||||
- choose:
|
||||
- conditions: '{{ property_key_name == ''001'' and value == ''KeyPressed'' }}'
|
||||
sequence: !input 'tap_1x_up'
|
||||
- conditions: '{{ property_key_name == ''002'' and value == ''KeyPressed'' }}'
|
||||
sequence: !input 'tap_1x_dn'
|
||||
- conditions: '{{ property_key_name == ''001'' and value == ''KeyPressed2x'' }}'
|
||||
sequence: !input 'tap_2x_up'
|
||||
- conditions: '{{ property_key_name == ''002'' and value == ''KeyPressed2x'' }}'
|
||||
sequence: !input 'tap_2x_dn'
|
||||
- conditions: '{{ property_key_name == ''001'' and value == ''KeyPressed3x'' }}'
|
||||
sequence: !input 'tap_3x_up'
|
||||
- conditions: '{{ property_key_name == ''002'' and value == ''KeyPressed3x'' }}'
|
||||
sequence: !input 'tap_3x_dn'
|
||||
- conditions: '{{ property_key_name == ''001'' and value == ''KeyHeldDown'' }}'
|
||||
sequence: !input 'up_btn_hld'
|
||||
- conditions: '{{ property_key_name == ''001'' and value == ''KeyReleased'' }}'
|
||||
sequence: !input 'up_btn_rel'
|
||||
- conditions: '{{ property_key_name == ''002'' and value == ''KeyHeldDown'' }}'
|
||||
sequence: !input 'dn_btn_hld'
|
||||
- conditions: '{{ property_key_name == ''002'' and value == ''KeyReleased'' }}'
|
||||
sequence: !input 'dn_btn_rel'
|
||||
- variables:
|
||||
property_key_name: "{{ trigger.event.data.property_key_name }}"
|
||||
label: "{{ trigger.event.data.label }}"
|
||||
command_class_name: "{{ trigger.event.data.command_class_name }}"
|
||||
value: "{{ trigger.event.data.value }}"
|
||||
- action: logbook.log
|
||||
data:
|
||||
name: "Z-Wave JS"
|
||||
message: "received event: {{ command_class_name }} - {{ value }} - {{ label }}"
|
||||
- choose:
|
||||
- conditions: "{{ property_key_name == '001' and value == 'KeyPressed' }}"
|
||||
sequence: !input "tap_1x_up"
|
||||
- conditions: "{{ property_key_name == '002' and value == 'KeyPressed' }}"
|
||||
sequence: !input "tap_1x_dn"
|
||||
- conditions: "{{ property_key_name == '001' and value == 'KeyPressed2x' }}"
|
||||
sequence: !input "tap_2x_up"
|
||||
- conditions: "{{ property_key_name == '002' and value == 'KeyPressed2x' }}"
|
||||
sequence: !input "tap_2x_dn"
|
||||
- conditions: "{{ property_key_name == '001' and value == 'KeyPressed3x' }}"
|
||||
sequence: !input "tap_3x_up"
|
||||
- conditions: "{{ property_key_name == '002' and value == 'KeyPressed3x' }}"
|
||||
sequence: !input "tap_3x_dn"
|
||||
- conditions: "{{ property_key_name == '001' and value == 'KeyHeldDown' }}"
|
||||
sequence: !input "up_btn_hld"
|
||||
- conditions: "{{ property_key_name == '001' and value == 'KeyReleased' }}"
|
||||
sequence: !input "up_btn_rel"
|
||||
- conditions: "{{ property_key_name == '002' and value == 'KeyHeldDown' }}"
|
||||
sequence: !input "dn_btn_hld"
|
||||
- conditions: "{{ property_key_name == '002' and value == 'KeyReleased' }}"
|
||||
sequence: !input "dn_btn_rel"
|
||||
|
||||
@@ -32,7 +32,7 @@ blueprint:
|
||||
off_option:
|
||||
name: Off Option
|
||||
description: The Input_Select option that implies the room is forcefully Off.
|
||||
default: 'Off'
|
||||
default: "Off"
|
||||
selector:
|
||||
text:
|
||||
|
||||
@@ -91,7 +91,7 @@ trigger:
|
||||
|
||||
- platform: state
|
||||
entity_id: !input room_occupied
|
||||
to: 'off'
|
||||
to: "off"
|
||||
|
||||
- platform: state
|
||||
entity_id: !input light_level_sensor
|
||||
@@ -107,45 +107,45 @@ condition:
|
||||
state: !input off_option
|
||||
- condition: state
|
||||
entity_id: !input room_occupied
|
||||
state: 'off'
|
||||
state: "off"
|
||||
- "{{ states(light_level_sensor) | float(default=0) >= states(light_level_trigger) | float(default=0) }}"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: and
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: !input lighting_automations
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: !input room_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: !input room_mode
|
||||
state: !input manual_option
|
||||
- "{{ states(light_level_sensor) | float(default=0) >= states(light_level_trigger) | float(default=0) }}"
|
||||
sequence:
|
||||
- alias: Turn off lights
|
||||
service: light.turn_off
|
||||
target:
|
||||
entity_id: !input target_light
|
||||
- choose:
|
||||
- conditions:
|
||||
- "{{ manual_switch is defined }}"
|
||||
- "{{ guest_mode is defined }}"
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: !input guest_mode
|
||||
state: 'on'
|
||||
sequence:
|
||||
- alias: "Turn off the switch since all lights are off"
|
||||
service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: !input manual_switch
|
||||
entity_id: !input lighting_automations
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: !input room_occupied
|
||||
state: "off"
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: !input room_mode
|
||||
state: !input manual_option
|
||||
- "{{ states(light_level_sensor) | float(default=0) >= states(light_level_trigger) | float(default=0) }}"
|
||||
sequence:
|
||||
- alias: Turn off lights
|
||||
action: light.turn_off
|
||||
target:
|
||||
entity_id: !input target_light
|
||||
- choose:
|
||||
- conditions:
|
||||
- "{{ manual_switch is defined }}"
|
||||
- "{{ guest_mode is defined }}"
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: !input guest_mode
|
||||
state: "on"
|
||||
sequence:
|
||||
- alias: "Turn off the switch since all lights are off"
|
||||
action: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: !input manual_switch
|
||||
|
||||
@@ -31,7 +31,7 @@ blueprint:
|
||||
off_option:
|
||||
name: Off Option
|
||||
description: The Input_Select option that implies the room is forcefully Off.
|
||||
default: 'Off'
|
||||
default: "Off"
|
||||
selector:
|
||||
text:
|
||||
|
||||
@@ -175,7 +175,6 @@ condition:
|
||||
- alias: "Check if light should turn on"
|
||||
condition: or
|
||||
conditions:
|
||||
|
||||
- alias: "Guest mode is on"
|
||||
condition: state
|
||||
entity_id: !input guest_mode
|
||||
@@ -184,7 +183,6 @@ condition:
|
||||
- alias: "Motion or occupancy were detected in a dim room"
|
||||
condition: and
|
||||
conditions:
|
||||
|
||||
- alias: "Light level below trigger amount"
|
||||
condition: numeric_state
|
||||
entity_id: !input light_level_sensor
|
||||
@@ -212,54 +210,54 @@ condition:
|
||||
|
||||
action:
|
||||
- alias: "Make sure the switch is turned on"
|
||||
service: homeassistant.turn_on
|
||||
action: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: !input manual_switch
|
||||
- choose:
|
||||
- alias: "If the room is set to manual, just turn the lights on"
|
||||
conditions:
|
||||
- "{{is_state(room_mode,manual_option)}}"
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: "{{light_entity}}"
|
||||
- alias: "If the room is set to manual, just turn the lights on"
|
||||
conditions:
|
||||
- "{{is_state(room_mode,manual_option)}}"
|
||||
sequence:
|
||||
- action: light.turn_on
|
||||
target:
|
||||
entity_id: "{{light_entity}}"
|
||||
|
||||
- alias: "If the room is set to auto and the lights are on, change to the Automatic Light Profile scene with a transition"
|
||||
conditions:
|
||||
- "{{is_state(room_mode,auto_option)}}"
|
||||
- "{{is_state(light_entity,'on')}}"
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: "{{ states(light_scene_transition) }}"
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(automatic_profile).lower().replace(' ','_')}}"
|
||||
- alias: "If the room is set to auto and the lights are on, change to the Automatic Light Profile scene with a transition"
|
||||
conditions:
|
||||
- "{{is_state(room_mode,auto_option)}}"
|
||||
- "{{is_state(light_entity,'on')}}"
|
||||
sequence:
|
||||
- action: scene.turn_on
|
||||
data:
|
||||
transition: "{{ states(light_scene_transition) }}"
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(automatic_profile).lower().replace(' ','_')}}"
|
||||
|
||||
- alias: "If the room is set to auto and the lights are off, change to the Automatic Light Profile scene without a transition"
|
||||
conditions:
|
||||
- "{{is_state(room_mode,auto_option)}}"
|
||||
- "{{is_state(light_entity,'off')}}"
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(automatic_profile).lower().replace(' ','_')}}"
|
||||
- alias: "If the room is set to auto and the lights are off, change to the Automatic Light Profile scene without a transition"
|
||||
conditions:
|
||||
- "{{is_state(room_mode,auto_option)}}"
|
||||
- "{{is_state(light_entity,'off')}}"
|
||||
sequence:
|
||||
- action: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(automatic_profile).lower().replace(' ','_')}}"
|
||||
|
||||
- alias: "If the room is not set to auto and the lights are on, change to the room mode scene with a transition"
|
||||
conditions:
|
||||
- "{{is_state(light_entity,'on')}}"
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: "{{ states(light_scene_transition) }}"
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
- alias: "If the room is not set to auto and the lights are on, change to the room mode scene with a transition"
|
||||
conditions:
|
||||
- "{{is_state(light_entity,'on')}}"
|
||||
sequence:
|
||||
- action: scene.turn_on
|
||||
data:
|
||||
transition: "{{ states(light_scene_transition) }}"
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
- alias: "If the room is not set to auto and the lights are on, change to the room scene without a transition"
|
||||
conditions:
|
||||
- "{{is_state(light_entity,'off')}}"
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
- alias: "If the room is not set to auto and the lights are on, change to the room scene without a transition"
|
||||
conditions:
|
||||
- "{{is_state(light_entity,'off')}}"
|
||||
sequence:
|
||||
- action: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
- delay: 1
|
||||
- delay: 1
|
||||
|
||||
@@ -59,26 +59,26 @@ mode: restart
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: !input home_occupied
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
from: "on"
|
||||
to: "off"
|
||||
|
||||
- platform: state
|
||||
id: room_occupied
|
||||
entity_id: !input binary_sensor
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
from: "off"
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: 'not_occupied'
|
||||
id: "not_occupied"
|
||||
entity_id:
|
||||
- !input home_occupied
|
||||
- !input binary_sensor
|
||||
to: 'off'
|
||||
to: "off"
|
||||
for:
|
||||
seconds: !input delay_seconds
|
||||
|
||||
- platform: time_pattern
|
||||
id: 'time_pattern'
|
||||
id: "time_pattern"
|
||||
minutes: "/5"
|
||||
|
||||
condition:
|
||||
@@ -87,7 +87,7 @@ condition:
|
||||
- alias: "Home not occupied"
|
||||
condition: state
|
||||
entity_id: !input home_occupied
|
||||
state: 'off'
|
||||
state: "off"
|
||||
|
||||
- alias: "Room just occupied"
|
||||
condition: trigger
|
||||
@@ -98,56 +98,56 @@ condition:
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: !input room_occupied
|
||||
state: 'on'
|
||||
state: "on"
|
||||
|
||||
- condition: state
|
||||
entity_id: !input binary_sensor
|
||||
state: 'off'
|
||||
state: "off"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- alias: "Home not occupied"
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: !input home_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: !input room_occupied
|
||||
|
||||
- alias: "Room not occupied"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: not_occupied
|
||||
- condition: not
|
||||
- alias: "Home not occupied"
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: !input house_mode
|
||||
state: !input manual_option
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: !input room_occupied
|
||||
- condition: state
|
||||
entity_id: !input home_occupied
|
||||
state: "off"
|
||||
sequence:
|
||||
- action: homeassistant.turn_off
|
||||
entity_id: !input room_occupied
|
||||
|
||||
- alias: "Room occupied"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: room_occupied
|
||||
sequence:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: !input room_occupied
|
||||
- alias: "Room not occupied"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: not_occupied
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: !input house_mode
|
||||
state: !input manual_option
|
||||
sequence:
|
||||
- action: homeassistant.turn_off
|
||||
entity_id: !input room_occupied
|
||||
|
||||
- alias: "Time pattern"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: time_pattern
|
||||
- condition: state
|
||||
entity_id: !input room_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: !input binary_sensor
|
||||
state: 'off'
|
||||
for:
|
||||
seconds: !input delay_seconds
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: !input room_occupied
|
||||
- alias: "Room occupied"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: room_occupied
|
||||
sequence:
|
||||
- action: homeassistant.turn_on
|
||||
entity_id: !input room_occupied
|
||||
|
||||
- alias: "Time pattern"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: time_pattern
|
||||
- condition: state
|
||||
entity_id: !input room_occupied
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: !input binary_sensor
|
||||
state: "off"
|
||||
for:
|
||||
seconds: !input delay_seconds
|
||||
sequence:
|
||||
- action: homeassistant.turn_off
|
||||
entity_id: !input room_occupied
|
||||
|
||||
Reference in New Issue
Block a user