AutomationDataset/rohankapoorcom/rohankapoorcom_automations....

2138 lines
72 KiB
YAML

- id: activate_amars_bathroom_fan_timer
alias: Activate Amar's Bathroom Fan Timer
triggers:
- trigger: state
entity_id: switch.amar_bathroom_fan
to: 'on'
actions:
- action: timer.start
entity_id: timer.amar_bathroom_fan_timer
data:
duration: 1200
- id: deactivate_amars_bathroom_fan_timer
alias: Deactivate Amar's Bathroom Fan Timer
triggers:
- trigger: state
entity_id: switch.amar_bathroom_fan
to: 'off'
actions:
- action: timer.cancel
entity_id: timer.amar_bathroom_fan_timer
- id: deactivate_amars_bathroom_fan_when_timer_finishes
alias: Deactivate Amar's Bathroom Fan when Timer Finishes
triggers:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.amar_bathroom_fan_timer
actions:
- action: switch.turn_off
entity_id: switch.amar_bathroom_fan
- id: activate_guest_bathroom_fan_timer
alias: Activate Guest Bathroom Fan Timer
triggers:
- trigger: state
entity_id: switch.guest_bathroom_fan
to: 'on'
actions:
- action: timer.start
entity_id: timer.guest_bathroom_fan_timer
data:
duration: 1200
- id: deactivate_guest_bathroom_fan_timer
alias: Deactivate Guest Bathroom Fan Timer
triggers:
- trigger: state
entity_id: switch.guest_bathroom_fan
to: 'off'
actions:
- action: timer.cancel
entity_id: timer.guest_bathroom_fan_timer
- id: deactivate_guest_bathroom_fan_when_timer_finishes
alias: Deactivate Guest Bathroom Fan when Timer Finishes
triggers:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.guest_bathroom_fan_timer
actions:
- action: switch.turn_off
entity_id: switch.guest_bathroom_fan
- id: increment_amars_roof_extraction_fan_users
alias: Increment Amar's Roof Extraction Fan Users
triggers:
- trigger: state
entity_id:
- switch.amar_bathroom_fan
- switch.guest_bathroom_fan
to: 'on'
actions:
- action: input_number.set_value
data_template:
entity_id: input_number.amar_roof_extraction_fan_users
value: "{% if states('input_number.amar_roof_extraction_fan_users') | int\n\
\ < state_attr('input_number.amar_roof_extraction_fan_users', 'max') %}\n\
\ {{ (states('input_number.amar_roof_extraction_fan_users') | int) + 1 }}\n\
{% else %}\n {{ states('input_number.amar_roof_extraction_fan_users') | int\
\ }}\n{% endif %}\n"
- id: decrement_amars_roof_extraction_fan_users
alias: Decrement Amar's Roof Extraction Fan Users
triggers:
- trigger: state
entity_id:
- switch.amar_bathroom_fan
- switch.guest_bathroom_fan
to: 'off'
actions:
- action: input_number.set_value
data_template:
entity_id: input_number.amar_roof_extraction_fan_users
value: "{% if states('input_number.amar_roof_extraction_fan_users') | int\n\
\ > state_attr('input_number.amar_roof_extraction_fan_users', 'min') %}\n\
\ {{ (states('input_number.amar_roof_extraction_fan_users') | int) - 1 }}\n\
{% else %}\n {{ states('input_number.amar_roof_extraction_fan_users') | int\
\ }}\n{% endif %}\n"
- id: activate_amars_roof_extraction_fan
alias: Activate Amar's Roof Extraction Fan
triggers:
- trigger: state
entity_id: input_number.amar_roof_extraction_fan_users
actions:
- action: switch.turn_on
entity_id: switch.amar_roof_extraction_fan
conditions:
- condition: numeric_state
entity_id: input_number.amar_roof_extraction_fan_users
value_template: '{{ states(''input_number.amar_roof_extraction_fan_users'') |
int }}'
above: 0
- id: deactivate_amars_roof_extraction_fan
alias: Deactivate Amar's Roof Extraction Fan
triggers:
- trigger: state
entity_id: input_number.amar_roof_extraction_fan_users
actions:
- action: switch.turn_off
entity_id: switch.amar_roof_extraction_fan
conditions:
- condition: numeric_state
entity_id: input_number.amar_roof_extraction_fan_users
value_template: '{{ states(''input_number.amar_roof_extraction_fan_users'') |
int }}'
below: 1
- id: 28dd9f30-e3e5-4071-900c-3a15a30fc16f
alias: Manage the Family Room Roller Shades
description: Automatically open/close the Family Room Roller Shades based on the
Sun Position
triggers:
- trigger: sun
event: sunset
- trigger: sun
event: sunrise
offset: '+4:00:00'
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
actions:
- choose:
- alias: If it's after sunset or before sunrise, then close the shades.
conditions:
- condition: or
conditions:
- condition: sun
after: sunset
- condition: sun
before: sunrise
before_offset: '+1:30:00'
sequence:
- action: cover.close_cover
target:
entity_id: cover.family_room_shades
- alias: If it's 4 hours after sunrise, then open the shade.
conditions:
- condition: sun
after: sunrise
after_offset: '+4:00:00'
sequence:
- action: cover.open_cover
target:
entity_id: cover.family_room_shades
mode: single
- id: 9b1748d1-7cf1-4459-bb17-2936820e333f
alias: Print Left Label
triggers:
- trigger: state
entity_id: input_button.print_left_label
actions:
- action: shell_command.print_left_label
data:
content: "{{ states('input_text.label_text_first') }} {%- if states('input_text.label_text_second')\
\ != \"\" -%}\n \\n{{ states('input_text.label_text_second') }}\n{%- endif\
\ -%} {%- if states('input_text.label_text_third') != \"\" -%}\n \\n{{ states('input_text.label_text_third')\
\ }}\n{%- endif -%}\n"
copies: '{{ states(''input_number.label_copies'') | round(0) }}'
- id: e94111fb-6aa4-463a-9ac6-5e6020ecdfe5
alias: Print Right Label
triggers:
- trigger: state
entity_id: input_button.print_right_label
actions:
- action: shell_command.print_right_label
data:
content: "{{ states('input_text.label_text_first') }} {%- if states('input_text.label_text_second')\
\ != \"\" -%}\n \\n{{ states('input_text.label_text_second') }}\n{%- endif\
\ -%} {%- if states('input_text.label_text_third') != \"\" -%}\n \\n{{ states('input_text.label_text_third')\
\ }}\n{%- endif -%}\n"
copies: '{{ states(''input_number.label_copies'') | round(0) }}'
- id: activate_master_bathroom_wc_fan_timer
alias: Activate Master Bathroom WC Fan Timer
triggers:
- trigger: state
entity_id: switch.master_bathroom_wc_fan
to: 'on'
actions:
- action: timer.start
entity_id: timer.master_bathroom_wc_fan_timer
data:
duration: 1200
- id: deactivate_master_bathroom_wc_fan_timer
alias: Deactivate Master Bathroom WC Fan Timer
triggers:
- trigger: state
entity_id: switch.master_bathroom_wc_fan
to: 'off'
actions:
- action: timer.cancel
entity_id: timer.master_bathroom_wc_fan_timer
- id: deactivate_master_bathroom_wc_fan_when_timer_finishes
alias: Deactivate Master Bathroom WC Fan when Timer Finishes
triggers:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.master_bathroom_wc_fan_timer
actions:
- action: switch.turn_off
entity_id: switch.master_bathroom_wc_fan
- id: activate_master_bathroom_shower_fan_timer
alias: Activate Master Bathroom Shower Fan Timer
triggers:
- trigger: state
entity_id: switch.master_bathroom_shower_fan
to: 'on'
actions:
- action: timer.start
entity_id: timer.master_bathroom_shower_fan_timer
data:
duration: 1200
- id: deactivate_master_bathroom_shower_fan_timer
alias: Deactivate Master Bathroom Shower Fan Timer
triggers:
- trigger: state
entity_id: switch.master_bathroom_shower_fan
to: 'off'
actions:
- action: timer.cancel
entity_id: timer.master_bathroom_shower_fan_timer
- id: deactivate_master_bathroom_shower_fan_when_timer_finishes
alias: Deactivate Master Bathroom Shower Fan when Timer Finishes
triggers:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.master_bathroom_shower_fan_timer
actions:
- action: switch.turn_off
entity_id: switch.master_bathroom_shower_fan
- id: increment_master_bathroom_roof_extraction_fan_users
alias: Increment Master Bathroom Roof Extraction Fan Users
triggers:
- trigger: state
entity_id:
- switch.master_bathroom_wc_fan
- switch.master_bathroom_shower_fan
to: 'on'
actions:
- action: input_number.set_value
data_template:
entity_id: input_number.master_bathroom_roof_extraction_fan_users
value: "{% if states('input_number.master_bathroom_roof_extraction_fan_users')\
\ | int\n < state_attr('input_number.master_bathroom_roof_extraction_fan_users',\
\ 'max') %}\n {{ (states('input_number.master_bathroom_roof_extraction_fan_users')\
\ | int) + 1 }}\n{% else %}\n {{ states('input_number.master_bathroom_roof_extraction_fan_users')\
\ | int }}\n{% endif %}\n"
- id: decrement_master_bathroom_roof_extraction_fan_users
alias: Decrement Master Bathroom Roof Extraction Fan Users
triggers:
- trigger: state
entity_id:
- switch.master_bathroom_wc_fan
- switch.master_bathroom_shower_fan
to: 'off'
actions:
- action: input_number.set_value
data_template:
entity_id: input_number.master_bathroom_roof_extraction_fan_users
value: "{% if states('input_number.master_bathroom_roof_extraction_fan_users')\
\ | int\n > state_attr('input_number.master_bathroom_roof_extraction_fan_users',\
\ 'min') %}\n {{ (states('input_number.master_bathroom_roof_extraction_fan_users')\
\ | int) - 1 }}\n{% else %}\n {{ states('input_number.master_bathroom_roof_extraction_fan_users')\
\ | int }}\n{% endif %}\n"
- id: activate_master_bathroom_roof_extraction_fan
alias: Activate Master Bathroom Roof Extraction Fan
triggers:
- trigger: state
entity_id: input_number.master_bathroom_roof_extraction_fan_users
actions:
- action: switch.turn_on
entity_id: switch.master_bathroom_roof_extraction_fan
conditions:
- condition: numeric_state
entity_id: input_number.master_bathroom_roof_extraction_fan_users
value_template: '{{ states(''input_number.master_bathroom_roof_extraction_fan_users'')
| int }}'
above: 0
- id: deactivate_master_bathroom_roof_extraction_fan
alias: Deactivate Master Bathroom Roof Extraction Fan
triggers:
- trigger: state
entity_id: input_number.master_bathroom_roof_extraction_fan_users
actions:
- action: switch.turn_off
entity_id: switch.master_bathroom_roof_extraction_fan
conditions:
- condition: numeric_state
entity_id: input_number.master_bathroom_roof_extraction_fan_users
value_template: '{{ states(''input_number.master_bathroom_roof_extraction_fan_users'')
| int }}'
below: 1
- id: eb962a09-eb64-4a54-bd9f-a8ee12e1493c
alias: Manage the Garage Exterior Lights
triggers:
- trigger: state
entity_id: sun.sun
to: below_horizon
- trigger: state
entity_id: sun.sun
to: above_horizon
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
actions:
- choose:
- alias: If it's after sunset or before sunrise, then turn on the lights.
conditions:
- condition: or
conditions:
- condition: sun
after: sunset
after_offset: -0:15:00
- condition: sun
before: sunrise
sequence:
- action: light.turn_on
target:
entity_id: light.garage_exterior_lights
- alias: If it's after sunrise, then turn off the lights.
conditions:
- condition: sun
after: sunrise
sequence:
- action: light.turn_off
target:
entity_id: light.garage_exterior_lights
- id: 2453b77a-30be-441b-a355-74a77268b768
alias: Manage the Front Door Exterior Lights
triggers:
- trigger: state
entity_id: sun.sun
to: below_horizon
- trigger: state
entity_id: sun.sun
to: above_horizon
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
actions:
- choose:
- alias: If it's after sunset or before sunrise, then turn on the lights.
conditions:
- condition: or
conditions:
- condition: sun
after: sunset
after_offset: -0:15:00
- condition: sun
before: sunrise
sequence:
- action: light.turn_on
target:
entity_id: light.front_door_exterior_lights
- alias: If it's after sunrise, then turn off the lights.
conditions:
- condition: sun
after: sunrise
sequence:
- action: light.turn_off
target:
entity_id: light.front_door_exterior_lights
- id: ec2ae516-1e3d-4134-9f2a-6d67c12d7de9
alias: Manage the Garden Exterior Lights
triggers:
- trigger: state
entity_id: sun.sun
to: below_horizon
- trigger: state
entity_id: sun.sun
to: above_horizon
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
actions:
- choose:
- alias: If it's after sunset or before sunrise, then turn on the lights.
conditions:
- condition: or
conditions:
- condition: sun
after: sunset
after_offset: -0:15:00
- condition: sun
before: sunrise
sequence:
- action: light.turn_on
target:
entity_id:
- light.exterior_lights_cherry_tree
- light.exterior_lights_maple_tree
- light.exterior_lights_driveway_end
- light.exterior_lights_walkway_lights
- light.exterior_lights_bay_window_conifers
- light.exterior_lights_forsythia_bed
- light.exterior_lights_back_woods
- alias: If it's after sunrise, then turn off the lights.
conditions:
- condition: sun
after: sunrise
sequence:
- action: light.turn_off
target:
entity_id:
- light.exterior_lights_cherry_tree
- light.exterior_lights_maple_tree
- light.exterior_lights_driveway_end
- light.exterior_lights_walkway_lights
- light.exterior_lights_bay_window_conifers
- light.exterior_lights_forsythia_bed
- light.exterior_lights_back_woods
- id: c1789adb-ff1e-424d-8b85-65f307bf995d
alias: Control the Garage Lights
mode: restart
max_exceeded: silent
triggers:
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
- trigger: state
entity_id: cover.anu_garage_door
from: closed
to: open
- trigger: state
entity_id: cover.rakesh_garage_door
from: closed
to: open
action:
- choose:
- alias: If either garage door is open, then turn on the lights.
conditions:
- condition: or
conditions:
- condition: state
entity_id: cover.anu_garage_door
state: open
- condition: state
entity_id: cover.rakesh_garage_door
state: open
sequence:
- action: light.turn_on
target:
entity_id:
- light.garage_lights
- wait_for_trigger:
- platform: template
value_template: '{{ is_state(''cover.anu_garage_door'', ''closed'') and
is_state(''cover.rakesh_garage_door'', ''closed'') }}
'
continue_on_timeout: false
- delay:
minutes: 10
- service: light.turn_off
target:
entity_id:
- light.garage_lights
default:
- service: light.turn_off
entity_id:
- light.garage_lights
- id: 304cad1d-c405-4479-9177-2beb93c46cae
alias: Control the Front Door Lights
mode: restart
max_exceeded: silent
triggers:
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
- trigger: state
entity_id: binary_sensor.front_door_motion_sensor
from: 'off'
to: 'on'
actions:
- choose:
- alias: If it's dark and there is motion, then turn on the lights.
conditions:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.front_door_motion_sensor
state: 'on'
- condition: numeric_state
entity_id: sensor.garage_entry_motion_sensor_illuminance
below: 100
sequence:
- action: light.turn_on
target:
entity_id: light.front_door_lights
- wait_for_trigger:
- trigger: template
value_template: '{{ is_state(''binary_sensor.front_door_motion_sensor'',
''off'') }}
'
continue_on_timeout: false
- delay:
minutes: 1
- action: light.turn_off
target:
entity_id: light.front_door_lights
default:
- action: light.turn_off
entity_id: light.front_door_lights
- alias: keymaster_turn_on_access_limit_LOCKNAME_TEMPLATENUM
id: keymaster_turn_on_access_limit_LOCKNAME_TEMPLATENUM
trigger:
platform: state
entity_id: input_number.accesscount_LOCKNAME_TEMPLATENUM
condition:
- condition: template
value_template: '{{ (states(''input_number.accesscount_LOCKNAME_TEMPLATENUM'')
| int > 0) }}'
action:
service: input_boolean.turn_on
target:
entity_id: input_boolean.accesslimit_LOCKNAME_TEMPLATENUM
- alias: keymaster_synchronize_codeslot_LOCKNAME_TEMPLATENUM
id: keymaster_synchronize_codeslot_LOCKNAME_TEMPLATENUM
initial_state: true
mode: single
max_exceeded: silent
trigger:
- platform: state
entity_id: binary_sensor.pin_synched_LOCKNAME_TEMPLATENUM
from: 'on'
to: 'off'
condition:
- condition: template
value_template: '{{ states("sensor.LOCKNAME_code_slot_TEMPLATENUM") != "unavailable"
}}'
action:
- choose:
- conditions:
- condition: template
value_template: '{{ is_state(''binary_sensor.active_LOCKNAME_TEMPLATENUM'',''on'')
}}'
sequence:
- service: keymaster.add_code
data_template:
entity_id: LOCKENTITYNAME
code_slot: '{{ TEMPLATENUM }}'
usercode: '{{ states(''input_text.LOCKNAME_pin_TEMPLATENUM'').strip() }}'
- conditions:
- condition: template
value_template: '{{ is_state(''binary_sensor.active_LOCKNAME_TEMPLATENUM'',''off'')
}}'
sequence:
- service: keymaster.clear_code
data_template:
entity_id: LOCKENTITYNAME
code_slot: '{{ TEMPLATENUM }}'
- alias: keymaster_turn_on_access_limit_LOCKNAME_TEMPLATENUM
id: keymaster_turn_on_access_limit_LOCKNAME_TEMPLATENUM
trigger:
platform: state
entity_id: input_number.accesscount_LOCKNAME_TEMPLATENUM
condition:
- condition: template
value_template: '{{ (states(''input_number.accesscount_LOCKNAME_TEMPLATENUM'')
| int > 0) }}'
action:
service: input_boolean.turn_on
target:
entity_id: input_boolean.accesslimit_LOCKNAME_TEMPLATENUM
- alias: keymaster_synchronize_codeslot_LOCKNAME_TEMPLATENUM
id: keymaster_synchronize_codeslot_LOCKNAME_TEMPLATENUM
initial_state: true
mode: single
max_exceeded: silent
trigger:
- platform: state
entity_id: binary_sensor.pin_synched_LOCKNAME_TEMPLATENUM
from: 'on'
to: 'off'
condition:
- condition: template
value_template: '{{ states("sensor.LOCKNAME_code_slot_TEMPLATENUM") != "unavailable"
}}'
action:
- choose:
- conditions:
- condition: template
value_template: '{{ is_state(''binary_sensor.active_LOCKNAME_TEMPLATENUM'',''on'')
}}'
sequence:
- service: keymaster.add_code
data_template:
entity_id: LOCKENTITYNAME
code_slot: '{{ TEMPLATENUM }}'
usercode: '{{ states(''input_text.LOCKNAME_pin_TEMPLATENUM'').strip() }}'
- conditions:
- condition: template
value_template: '{{ is_state(''binary_sensor.active_LOCKNAME_TEMPLATENUM'',''off'')
}}'
sequence:
- service: keymaster.clear_code
data_template:
entity_id: LOCKENTITYNAME
code_slot: '{{ TEMPLATENUM }}'
- alias: keymaster_override_parent_LOCKNAME_TEMPLATENUM_state_change
id: keymaster_override_parent_LOCKNAME_TEMPLATENUM_state_change
trigger:
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
platform: state
to: 'off'
action:
- service: script.keymaster_LOCKNAME_copy_from_parent_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_name_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_name_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_text.PARENTLOCK_name_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_text.set_value
target:
entity_id: input_text.LOCKNAME_name_TEMPLATENUM
data:
value: '{{ states(''input_text.PARENTLOCK_name_TEMPLATENUM'') }}'
- alias: keymaster_copy_PARENTLOCK_pin_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_pin_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_text.PARENTLOCK_pin_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_text.set_value
target:
entity_id: input_text.LOCKNAME_pin_TEMPLATENUM
data:
value: '{{ states(''input_text.PARENTLOCK_pin_TEMPLATENUM'') }}'
- alias: keymaster_copy_PARENTLOCK_enabled_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_enabled_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.enabled_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.enabled_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.enabled_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_notify_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_notify_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.notify_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.notify_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.notify_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_reset_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_reset_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.reset_codeslot_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.reset_codeslot_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.reset_codeslot_PARENTLOCK_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_accesslimit_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_accesslimit_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.accesslimit_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.accesslimit_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.accesslimit_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_accesscount_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_accesscount_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_number.accesscount_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_number.set_value
entity_id: input_number.accesscount_LOCKNAME_TEMPLATENUM
data_template:
value: '{{ states.input_number.accesscount_PARENTLOCK_TEMPLATENUM.state | int
}}'
- alias: keymaster_copy_PARENTLOCK_daterange_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_daterange_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.daterange_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.daterange_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.daterange_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_start_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_start_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.start_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.start_date_LOCKNAME_TEMPLATENUM
data:
datetime: '{{ states.input_datetime.start_date_PARENTLOCK_TEMPLATENUM.state
}}'
- alias: keymaster_copy_PARENTLOCK_end_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_end_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.end_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.end_date_LOCKNAME_TEMPLATENUM
data:
datetime: '{{ states.input_datetime.end_date_PARENTLOCK_TEMPLATENUM.state }}'
- alias: keymaster_copy_PARENTLOCK_sun_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_sun_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.sun_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.sun_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.sun_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_sun_inc_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_sun_inc_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.sun_inc_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.sun_inc_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.sun_inc_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_sun_start_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_sun_start_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.sun_start_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.sun_start_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.sun_start_date_PARENTLOCK_TEMPLATENUM.state
}}'
- alias: keymaster_copy_PARENTLOCK_sun_end_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_sun_end_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.sun_end_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.sun_end_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.sun_end_date_PARENTLOCK_TEMPLATENUM.state }}'
- alias: keymaster_copy_PARENTLOCK_mon_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_mon_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.mon_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.mon_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.mon_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_mon_inc_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_mon_inc_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.mon_inc_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.mon_inc_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.mon_inc_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_mon_start_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_mon_start_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.mon_start_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.mon_start_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.mon_start_date_PARENTLOCK_TEMPLATENUM.state
}}'
- alias: keymaster_copy_PARENTLOCK_mon_end_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_mon_end_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.mon_end_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.mon_end_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.mon_end_date_PARENTLOCK_TEMPLATENUM.state }}'
- alias: keymaster_copy_PARENTLOCK_tue_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_tue_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.tue_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.tue_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.tue_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_tue_inc_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_tue_inc_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.tue_inc_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.tue_inc_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.tue_inc_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_tue_start_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_tue_start_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.tue_start_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tue_start_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.tue_start_date_PARENTLOCK_TEMPLATENUM.state
}}'
- alias: keymaster_copy_PARENTLOCK_tue_end_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_tue_end_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.tue_end_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tue_end_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.tue_end_date_PARENTLOCK_TEMPLATENUM.state }}'
- alias: keymaster_copy_PARENTLOCK_wed_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_wed_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.wed_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.wed_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.wed_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_wed_inc_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_wed_inc_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.wed_inc_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.wed_inc_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.wed_inc_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_wed_start_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_wed_start_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.wed_start_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.wed_start_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.wed_start_date_PARENTLOCK_TEMPLATENUM.state
}}'
- alias: keymaster_copy_PARENTLOCK_wed_end_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_wed_end_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.wed_end_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.wed_end_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.wed_end_date_PARENTLOCK_TEMPLATENUM.state }}'
- alias: keymaster_copy_PARENTLOCK_thu_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_thu_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.thu_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.thu_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.thu_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_thu_inc_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_thu_inc_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.thu_inc_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.thu_inc_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.thu_inc_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_thu_start_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_thu_start_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.thu_start_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.thu_start_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.thu_start_date_PARENTLOCK_TEMPLATENUM.state
}}'
- alias: keymaster_copy_PARENTLOCK_thu_end_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_thu_end_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.thu_end_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.thu_end_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.thu_end_date_PARENTLOCK_TEMPLATENUM.state }}'
- alias: keymaster_copy_PARENTLOCK_fri_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_fri_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.fri_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.fri_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.fri_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_fri_inc_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_fri_inc_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.fri_inc_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.fri_inc_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.fri_inc_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_fri_start_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_fri_start_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.fri_start_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.fri_start_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.fri_start_date_PARENTLOCK_TEMPLATENUM.state
}}'
- alias: keymaster_copy_PARENTLOCK_fri_end_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_fri_end_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.fri_end_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.fri_end_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.fri_end_date_PARENTLOCK_TEMPLATENUM.state }}'
- alias: keymaster_copy_PARENTLOCK_sat_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_sat_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.sat_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.sat_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.sat_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_sat_inc_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_sat_inc_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_boolean.sat_inc_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service_template: "{% if (states.input_boolean.sat_inc_PARENTLOCK_TEMPLATENUM.state\
\ == 'on') %}\n input_boolean.turn_on\n{% else %}\n input_boolean.turn_off\n\
{% endif %}\n"
entity_id: input_boolean.sat_inc_LOCKNAME_TEMPLATENUM
- alias: keymaster_copy_PARENTLOCK_sat_start_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_sat_start_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.sat_start_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.sat_start_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.sat_start_date_PARENTLOCK_TEMPLATENUM.state
}}'
- alias: keymaster_copy_PARENTLOCK_sat_end_date_LOCKNAME_TEMPLATENUM
id: keymaster_copy_PARENTLOCK_sat_end_date_LOCKNAME_TEMPLATENUM
trigger:
entity_id: input_datetime.sat_end_date_PARENTLOCK_TEMPLATENUM
platform: state
condition:
- condition: state
entity_id: input_boolean.override_parent_LOCKNAME_TEMPLATENUM
state: 'off'
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.sat_end_date_LOCKNAME_TEMPLATENUM
data:
time: '{{ states.input_datetime.sat_end_date_PARENTLOCK_TEMPLATENUM.state }}'
- alias: keymaster_CASE_LOCK_NAME Reset Code Slot
id: keymaster_CASE_LOCK_NAME Reset Code Slot
trigger:
entity_id: INPUT_RESET_CODE_SLOT_HEADER
platform: state
to: 'on'
action:
- service: script.keymaster_LOCKNAME_reset_codeslot
data_template:
code_slot: '{{ trigger.entity_id.split(''_'')[-1] }}'
- alias: keymaster_CASE_LOCK_NAME Lock Notifications
id: keymaster_CASE_LOCK_NAME Lock Notifications
trigger:
platform: event
event_type: keymaster_lock_state_changed
event_data:
lockname: LOCKNAME
condition:
- condition: state
entity_id: input_boolean.LOCKNAME_lock_notifications
state: 'on'
action:
- service: script.keymaster_LOCKNAME_manual_notify
data_template:
title: CASE_LOCK_NAME
message: '{{ trigger.event.data.action_text }} {% if trigger.event.data.code_slot
> 0 %}({{ trigger.event.data.code_slot_name }}){% endif %}'
- alias: keymaster_CASE_LOCK_NAME User Notifications
id: keymaster_CASE_LOCK_NAME User Notifications
trigger:
platform: event
event_type: keymaster_lock_state_changed
event_data:
lockname: LOCKNAME
condition:
- condition: template
value_template: '{{ trigger.event.data.code_slot > 0 }}'
- condition: template
value_template: '{{ is_state(''input_boolean.notify_LOCKNAME_'' + trigger.event.data.code_slot
| string, ''on'') }}'
- condition: state
entity_id: input_boolean.LOCKNAME_lock_notifications
state: 'off'
action:
- service: script.keymaster_LOCKNAME_manual_notify
data_template:
title: CASE_LOCK_NAME
message: '{{ trigger.event.data.action_text }} ({{ trigger.event.data.code_slot_name
}})'
- alias: keymaster_CASE_LOCK_NAME Door Open and Close
id: keymaster_CASE_LOCK_NAME Door Open and Close
trigger:
entity_id: DOORSENSORENTITYNAME
platform: state
condition:
- condition: state
entity_id: input_boolean.LOCKNAME_dooraccess_notifications
state: 'on'
- condition: template
value_template: '{{ trigger.from_state.state in (''on'', ''off'') and trigger.to_state.state
in (''on'', ''off'') }}'
action:
- service: script.keymaster_LOCKNAME_manual_notify
data_template:
title: CASE_LOCK_NAME
message: '{% if trigger.to_state.state == ''on'' %}Door Opened{% else %}Door
Closed{% endif %}'
- alias: keymaster_CASE_LOCK_NAME Changed Code
id: keymaster_CASE_LOCK_NAME Changed Code
trigger:
entity_id: INPUTLOCKPINHEADER
platform: state
condition:
- condition: template
value_template: "{{\n is_state('input_boolean.enabled_LOCKNAME_' + trigger.entity_id.split('_')[-1],\
\ 'on')\n and\n (trigger.from_state.state != trigger.to_state.state)\n}}"
action:
- service: persistent_notification.create
data_template:
title: CASE_LOCK_NAME LOCK MANAGER
message: '{{ ''You changed the PIN for CASE_LOCK_NAME code slot '' + trigger.entity_id.split(''_'')[-1]
+ ''. Please enable it in order to make it active.''}}'
- service: input_boolean.turn_off
data_template:
entity_id: '{{ ''input_boolean.enabled_LOCKNAME_'' + trigger.entity_id.split(''_'')[-1]
}}'
- alias: keymaster_CASE_LOCK_NAME Reset
id: keymaster_CASE_LOCK_NAME Reset
trigger:
entity_id: input_boolean.LOCKNAME_reset_lock
platform: state
from: 'off'
to: 'on'
action:
- service: script.keymaster_LOCKNAME_reset_lock
- service: input_boolean.turn_off
entity_id: input_boolean.LOCKNAME_reset_lock
- alias: keymaster_CASE_LOCK_NAME Decrement Access Count
id: keymaster_CASE_LOCK_NAME Decrement Access Count
trigger:
platform: event
event_type: keymaster_lock_state_changed
event_data:
lockname: LOCKNAME
condition:
- condition: template
value_template: '{{ is_state(''input_boolean.accesslimit_LOCKNAME_'' + trigger.event.data.code_slot
| string, ''on'') }}'
- condition: template
value_template: "{{\n trigger.event.data.code_slot > 0\n and\n (trigger.event.data.action_code\
\ is undefined or trigger.event.data.action_code in (6, 19))\n}}"
action:
- service: input_number.decrement
data_template:
entity_id: '{{ ''input_number.accesscount_LOCKNAME_'' + trigger.event.data.code_slot
| string }}'
- alias: keymaster_LOCKNAME_locked
id: keymaster_LOCKNAME_locked
trigger:
entity_id: LOCKENTITYNAME
platform: state
to: locked
action:
- service: timer.cancel
entity_id: timer.keymaster_LOCKNAME_autolock
- alias: keymaster_turn_off_retry_LOCKNAME
id: keymaster_turn_off_retry_LOCKNAME
trigger:
entity_id: LOCKENTITYNAME
platform: state
to: locked
action:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.keymaster_LOCKNAME_retry
- alias: keymaster_retry_bolt_closed_LOCKNAME
id: keymaster_retry_bolt_closed_LOCKNAME
trigger:
platform: state
entity_id: DOORSENSORENTITYNAME
to: 'off'
condition:
- condition: state
entity_id: input_boolean.keymaster_LOCKNAME_retry
state: 'on'
- condition: state
entity_id: input_boolean.keymaster_LOCKNAME_autolock
state: 'on'
action:
- service: persistent_notification.create
data_template:
title: LOCKNAME is closed
message: '{{ ''The LOCKNAME sensor indicates the door has been closed, re-attempting
to lock.''}}'
- service: lock.lock
entity_id: lock.boltchecked_LOCKNAME
- alias: keymaster_LOCKNAME_opened
id: keymaster_LOCKNAME_opened
trigger:
platform: state
entity_id: DOORSENSORENTITYNAME
to: 'on'
condition:
- condition: state
entity_id: input_boolean.keymaster_LOCKNAME_autolock
state: 'on'
action:
- service: timer.start
data_template:
entity_id: timer.keymaster_LOCKNAME_autolock
duration: "{% if (((as_timestamp(states.sun.sun.attributes.next_dusk)) > (as_timestamp(states.sun.sun.attributes.next_dawn))))\
\ %}\n {{ states('input_text.keymaster_LOCKNAME_autolock_door_time_night')}}\n\
{% else %}\n {{ states('input_text.keymaster_LOCKNAME_autolock_door_time_day')}}\n\
{% endif %}\n"
- alias: keymaster_LOCKNAME_unlocked_start_autolock
id: keymaster_LOCKNAME_unlocked_start_autolock
trigger:
entity_id: LOCKENTITYNAME
platform: state
to: unlocked
condition:
- condition: state
entity_id: input_boolean.keymaster_LOCKNAME_autolock
state: 'on'
action:
- service: script.turn_on
entity_id: script.keymaster_LOCKNAME_start_timer
- service: input_boolean.turn_off
target:
entity_id: input_boolean.keymaster_LOCKNAME_retry
- alias: keymaster_LOCKNAME_timer_finished
id: keymaster_LOCKNAME_timer_finished
condition:
- condition: state
entity_id: input_boolean.keymaster_LOCKNAME_autolock
state: 'on'
trigger:
platform: event
event_type: timer.finished
event_data:
entity_id: timer.keymaster_LOCKNAME_autolock
action:
- service: lock.lock
entity_id: lock.boltchecked_LOCKNAME
- alias: keymaster_LOCKNAME_timer_canceled
id: keymaster_LOCKNAME_timer_canceled
trigger:
platform: event
event_type: timer.cancelled
event_data:
entity_id: timer.keymaster_LOCKNAME_autolock
action:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.keymaster_LOCKNAME_retry
- alias: keymaster_LOCKNAME_disable_auto_lock
id: keymaster_LOCKNAME_disable_auto_lock
trigger:
entity_id: input_boolean.keymaster_LOCKNAME_autolock
platform: state
to: 'off'
action:
- service: timer.cancel
entity_id:
- timer.keymaster_LOCKNAME_autolock
- service: input_boolean.turn_off
target:
entity_id: input_boolean.keymaster_LOCKNAME_retry
- alias: keymaster_LOCKNAME_enable_auto_lock
id: keymaster_LOCKNAME_enable_auto_lock
trigger:
entity_id: input_boolean.keymaster_LOCKNAME_autolock
platform: state
to: 'on'
action:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.keymaster_LOCKNAME_retry
- service: timer.cancel
entity_id:
- timer.keymaster_LOCKNAME_autolock
- service: script.turn_on
entity_id: script.keymaster_LOCKNAME_start_timer
- alias: keymaster_LOCKNAME_initialize
id: keymaster_LOCKNAME_initialize
trigger:
platform: homeassistant
event: start
action:
- service: input_text.set_value
entity_id: input_text.keymaster_LOCKNAME_autolock_door_time_day
data:
value: '{%- set current_value=states(''input_text.keymaster_LOCKNAME_autolock_door_time_day'')
-%} {{ iif(current_value in ['''', ''unknown''], "02:00:00", current_value)}}
'
- service: input_text.set_value
entity_id: input_text.keymaster_LOCKNAME_autolock_door_time_night
data:
value: '{%- set current_value=states(''input_text.keymaster_LOCKNAME_autolock_door_time_night'')
-%} {{ iif(current_value in ['''', ''unknown''], "00:05:00", current_value)}}
'
- alias: keymaster_CASE_LOCK_NAME Reset Code Slot
id: keymaster_CASE_LOCK_NAME Reset Code Slot
trigger:
entity_id: INPUT_RESET_CODE_SLOT_HEADER
platform: state
to: 'on'
action:
- service: script.keymaster_LOCKNAME_reset_codeslot
data_template:
code_slot: '{{ trigger.entity_id.split(''_'')[-1] }}'
- alias: keymaster_CASE_LOCK_NAME Lock Notifications
id: keymaster_CASE_LOCK_NAME Lock Notifications
trigger:
platform: event
event_type: keymaster_lock_state_changed
event_data:
lockname: LOCKNAME
condition:
- condition: state
entity_id: input_boolean.LOCKNAME_lock_notifications
state: 'on'
action:
- service: script.keymaster_LOCKNAME_manual_notify
data_template:
title: CASE_LOCK_NAME
message: '{{ trigger.event.data.action_text }} {% if trigger.event.data.code_slot
> 0 %}({{ trigger.event.data.code_slot_name }}){% endif %}'
- alias: keymaster_CASE_LOCK_NAME User Notifications
id: keymaster_CASE_LOCK_NAME User Notifications
trigger:
platform: event
event_type: keymaster_lock_state_changed
event_data:
lockname: LOCKNAME
condition:
- condition: template
value_template: '{{ trigger.event.data.code_slot > 0 }}'
- condition: template
value_template: '{{ is_state(''input_boolean.notify_LOCKNAME_'' + trigger.event.data.code_slot
| string, ''on'') }}'
- condition: state
entity_id: input_boolean.LOCKNAME_lock_notifications
state: 'off'
action:
- service: script.keymaster_LOCKNAME_manual_notify
data_template:
title: CASE_LOCK_NAME
message: '{{ trigger.event.data.action_text }} ({{ trigger.event.data.code_slot_name
}})'
- alias: keymaster_CASE_LOCK_NAME Door Open and Close
id: keymaster_CASE_LOCK_NAME Door Open and Close
trigger:
entity_id: DOORSENSORENTITYNAME
platform: state
condition:
- condition: state
entity_id: input_boolean.LOCKNAME_dooraccess_notifications
state: 'on'
- condition: template
value_template: '{{ trigger.from_state.state in (''on'', ''off'') and trigger.to_state.state
in (''on'', ''off'') }}'
action:
- service: script.keymaster_LOCKNAME_manual_notify
data_template:
title: CASE_LOCK_NAME
message: '{% if trigger.to_state.state == ''on'' %}Door Opened{% else %}Door
Closed{% endif %}'
- alias: keymaster_CASE_LOCK_NAME Changed Code
id: keymaster_CASE_LOCK_NAME Changed Code
trigger:
entity_id: INPUTLOCKPINHEADER
platform: state
condition:
- condition: template
value_template: "{{\n is_state('input_boolean.enabled_LOCKNAME_' + trigger.entity_id.split('_')[-1],\
\ 'on')\n and\n (trigger.from_state.state != trigger.to_state.state)\n}}"
action:
- service: persistent_notification.create
data_template:
title: CASE_LOCK_NAME LOCK MANAGER
message: '{{ ''You changed the PIN for CASE_LOCK_NAME code slot '' + trigger.entity_id.split(''_'')[-1]
+ ''. Please enable it in order to make it active.''}}'
- service: input_boolean.turn_off
data_template:
entity_id: '{{ ''input_boolean.enabled_LOCKNAME_'' + trigger.entity_id.split(''_'')[-1]
}}'
- alias: keymaster_CASE_LOCK_NAME Reset
id: keymaster_CASE_LOCK_NAME Reset
trigger:
entity_id: input_boolean.LOCKNAME_reset_lock
platform: state
from: 'off'
to: 'on'
action:
- service: script.keymaster_LOCKNAME_reset_lock
- service: input_boolean.turn_off
entity_id: input_boolean.LOCKNAME_reset_lock
- alias: keymaster_CASE_LOCK_NAME Decrement Access Count
id: keymaster_CASE_LOCK_NAME Decrement Access Count
trigger:
platform: event
event_type: keymaster_lock_state_changed
event_data:
lockname: LOCKNAME
condition:
- condition: template
value_template: '{{ is_state(''input_boolean.accesslimit_LOCKNAME_'' + trigger.event.data.code_slot
| string, ''on'') }}'
- condition: template
value_template: "{{\n trigger.event.data.code_slot > 0\n and\n (trigger.event.data.action_code\
\ is undefined or trigger.event.data.action_code in (6, 19))\n}}"
action:
- service: input_number.decrement
data_template:
entity_id: '{{ ''input_number.accesscount_LOCKNAME_'' + trigger.event.data.code_slot
| string }}'
- alias: keymaster_LOCKNAME_locked
id: keymaster_LOCKNAME_locked
trigger:
entity_id: LOCKENTITYNAME
platform: state
to: locked
action:
- service: timer.cancel
entity_id: timer.keymaster_LOCKNAME_autolock
- alias: keymaster_turn_off_retry_LOCKNAME
id: keymaster_turn_off_retry_LOCKNAME
trigger:
entity_id: LOCKENTITYNAME
platform: state
to: locked
action:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.keymaster_LOCKNAME_retry
- alias: keymaster_retry_bolt_closed_LOCKNAME
id: keymaster_retry_bolt_closed_LOCKNAME
trigger:
platform: state
entity_id: DOORSENSORENTITYNAME
to: 'off'
condition:
- condition: state
entity_id: input_boolean.keymaster_LOCKNAME_retry
state: 'on'
- condition: state
entity_id: input_boolean.keymaster_LOCKNAME_autolock
state: 'on'
action:
- service: persistent_notification.create
data_template:
title: LOCKNAME is closed
message: '{{ ''The LOCKNAME sensor indicates the door has been closed, re-attempting
to lock.''}}'
- service: lock.lock
entity_id: lock.boltchecked_LOCKNAME
- alias: keymaster_LOCKNAME_opened
id: keymaster_LOCKNAME_opened
trigger:
platform: state
entity_id: DOORSENSORENTITYNAME
to: 'on'
condition:
- condition: state
entity_id: input_boolean.keymaster_LOCKNAME_autolock
state: 'on'
action:
- service: timer.start
data_template:
entity_id: timer.keymaster_LOCKNAME_autolock
duration: "{% if (((as_timestamp(states.sun.sun.attributes.next_dusk)) > (as_timestamp(states.sun.sun.attributes.next_dawn))))\
\ %}\n {{ states('input_text.keymaster_LOCKNAME_autolock_door_time_night')}}\n\
{% else %}\n {{ states('input_text.keymaster_LOCKNAME_autolock_door_time_day')}}\n\
{% endif %}\n"
- alias: keymaster_LOCKNAME_unlocked_start_autolock
id: keymaster_LOCKNAME_unlocked_ start_autolock
trigger:
entity_id: LOCKENTITYNAME
platform: state
to: unlocked
condition:
- condition: state
entity_id: input_boolean.keymaster_LOCKNAME_autolock
state: 'on'
action:
- service: script.turn_on
entity_id: script.keymaster_LOCKNAME_start_timer
- service: input_boolean.turn_off
target:
entity_id: input_boolean.keymaster_LOCKNAME_retry
- alias: keymaster_LOCKNAME_timer_finished
id: keymaster_LOCKNAME_timer_finished
condition:
- condition: state
entity_id: input_boolean.keymaster_LOCKNAME_autolock
state: 'on'
trigger:
platform: event
event_type: timer.finished
event_data:
entity_id: timer.keymaster_LOCKNAME_autolock
action:
- service: lock.lock
entity_id: lock.boltchecked_LOCKNAME
- alias: keymaster_LOCKNAME_timer_canceled
id: keymaster_LOCKNAME_timer_canceled
trigger:
platform: event
event_type: timer.cancelled
event_data:
entity_id: timer.keymaster_LOCKNAME_autolock
action:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.keymaster_LOCKNAME_retry
- alias: keymaster_LOCKNAME_disable_auto_lock
id: keymaster_LOCKNAME_disable_auto_lock
trigger:
entity_id: input_boolean.keymaster_LOCKNAME_autolock
platform: state
to: 'off'
action:
- service: timer.cancel
entity_id:
- timer.keymaster_LOCKNAME_autolock
- service: input_boolean.turn_off
target:
entity_id: input_boolean.keymaster_LOCKNAME_retry
- alias: keymaster_LOCKNAME_enable_auto_lock
id: keymaster_LOCKNAME_enable_auto_lock
trigger:
entity_id: input_boolean.keymaster_LOCKNAME_autolock
platform: state
to: 'on'
action:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.keymaster_LOCKNAME_retry
- service: timer.cancel
entity_id:
- timer.keymaster_LOCKNAME_autolock
- service: script.turn_on
entity_id: script.keymaster_LOCKNAME_start_timer
- alias: keymaster_LOCKNAME_initialize
id: keymaster_LOCKNAME_initialize
trigger:
platform: homeassistant
event: start
action:
- service: input_text.set_value
entity_id: input_text.keymaster_LOCKNAME_autolock_door_time_day
data:
value: '{%- set current_value=states(''input_text.keymaster_LOCKNAME_autolock_door_time_day'')
-%} {{ iif(current_value in ['''', ''unknown''], "02:00:00", current_value)}}
'
- service: input_text.set_value
entity_id: input_text.keymaster_LOCKNAME_autolock_door_time_night
data:
value: '{%- set current_value=states(''input_text.keymaster_LOCKNAME_autolock_door_time_night'')
-%} {{ iif(current_value in ['''', ''unknown''], "00:05:00", current_value)}}
'
- id: c4fdcb6b-1b34-4445-950e-122605812a25
alias: Print Kitchen Main Label
triggers:
- trigger: state
entity_id: input_button.print_main_label
actions:
- action: shell_command.print_kitchen_label
data:
content: "{{ states('input_text.label_text') }} {%- if is_state('input_boolean.print_date',\
\ 'on') -%}\n \\n{{ states('input_datetime.label_date') }}\n{%- endif -%}\n"
copies: '{{ states(''input_number.label_copies'') | round(0) }}'
- id: cc513eb7-2912-440d-baa9-9d4fd9fd056d
alias: Print Kitchen Tape Label
triggers:
- trigger: state
entity_id: input_button.print_tape_label
actions:
- action: shell_command.print_tape_label
data:
content: "{{ states('input_text.label_text') }} {%- if is_state('input_boolean.print_date',\
\ 'on') -%}\n \\n{{ states('input_datetime.label_date') }}\n{%- endif -%}\n"
copies: '{{ states(''input_number.label_copies'') | round(0) }}'
- id: 925e45b5-affc-46cd-921d-227d7777306e
alias: Print Office Label
triggers:
- trigger: state
entity_id: input_button.print_office_label
actions:
- action: shell_command.print_office_label
data:
content: "{{ states('input_text.label_text') }} {%- if is_state('input_boolean.print_date',\
\ 'on') -%}\n \\n{{ states('input_datetime.label_date') }}\n{%- endif -%}\n"
copies: '{{ states(''input_number.label_copies'') | round(0) }}'
- id: 828c11ac-62c2-49da-891c-7d6b99cd88c4
alias: Set Label Date to Today at Midnight
triggers:
- trigger: time
at: 00:00:00
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
actions:
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.label_date
data:
date: '{{ now().strftime(''%Y-%m-%d'') }}'
- id: faea6bc6-9c9b-439c-9f5a-ac65fbec8cdf
alias: Handle Shield Emulated Roku Harmony Commands
description: Executed commands on the Living Room Shield TV in response to Emulated
Roku events from the Harmony Hub
use_blueprint:
path: rohankapoorcom/emulated-roku.yaml
input:
emulated_roku_name: 4t8k7RAjE3TBcfheQvCATZ
up_action:
- action: media_player.select_source
target:
entity_id: media_player.living_room_shield_tv
data:
source: Netflix
right_action:
- action: media_player.select_source
target:
entity_id: media_player.living_room_shield_tv
data:
source: Plex
down_action:
- action: media_player.select_source
target:
entity_id: media_player.living_room_shield_tv
data:
source: YouTube
left_action:
- action: androidtv.adb_command
target:
entity_id: media_player.living_room_shield_tv
data:
command: am start -a android.intent.action.VIEW -d -n com.amazon.amazonvideo.livingroom/com.amazon.ignition.IgnitionActivity
home_action:
- action: media_player.select_source
target:
entity_id: media_player.living_room_shield_tv
data:
source: com.hbo.hbonow
search_action:
- action: androidtv.adb_command
target:
entity_id: media_player.living_room_shield_tv
data:
command: SEARCH
- id: c8ff656a-e0d6-4b26-9840-0da9863b1867
alias: Living Room Shield TV Notify Washer
triggers:
- trigger: state
entity_id: binary_sensor.washer_wash_completed
to: 'on'
actions:
- action: notify.living_room_shield_tv
data:
title: Washer Complete
message: The washer has finished it's cycle.
data:
duration: 10
position: top-right
transparency: 50%
- id: e2f38056-ce90-46ca-8138-51a9637e3e50
alias: Living Room Shield TV Notify Dryer
triggers:
- trigger: state
entity_id: binary_sensor.dryer_dry_completed
to: 'on'
actions:
- action: notify.living_room_shield_tv
data:
title: Dryer Complete
message: The dryer has finished it's cycle.
data:
duration: 10
position: top-right
transparency: 50%
- id: c34228e0-c6c9-431f-ad73-cef94537ca2c
alias: Living Room TV Notify Phone Call
triggers:
- trigger: state
entity_id: sensor.line_103_status
to: incoming
actions:
- action: notify.living_room_shield_tv
data_template:
title: Incoming Phone Call
message: '{{ states(''sensor.line_103_caller_name'')}} - {{states(''sensor.line_103_caller_number'')
}}
'
data:
duration: 25
position: top-right
transparency: 50%
- id: 6ed8bef7-8ed6-4278-b79f-fefa9bf2ab8b
alias: Control the Living Room TV Remote when Charging
description: Turn off the motion detection and screen when the Living Room TV Remote
is charging.
mode: single
triggers:
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
- trigger: state
entity_id: binary_sensor.living_room_tv_remote_plugged_in
actions:
- choose:
- alias: If the Living Room TV Remote is charging, turn off the motion detection
and screen
conditions:
- condition: state
entity_id: binary_sensor.living_room_tv_remote_plugged_in
state: 'on'
sequence:
- action: switch.turn_off
entity_id: switch.living_room_tv_remote_motion_detection
- action: switch.turn_off
entity_id: switch.living_room_tv_remote_screen
default:
- action: switch.turn_on
entity_id: switch.living_room_tv_remote_motion_detection
- action: switch.turn_on
entity_id: switch.living_room_tv_remote_screen
- id: 22220e6d-5b70-4718-8a3c-7080f270f928
alias: Turn on the Hot Water Pump when there is motion in any of the bathrooms
triggers:
- trigger: state
entity_id:
- binary_sensor.master_bathroom_motion
- binary_sensor.hallway_bathroom_motion
- binary_sensor.downstairs_bathroom_motion
- binary_sensor.kitchen_motion
from: 'off'
to: 'on'
actions:
- action: switch.turn_on
entity_id: switch.hot_water_pump
- id: '1701157132714'
alias: Update Server Rack Status Display
description: Display server rack climate controls status on the epaper displays
triggers:
- trigger: time_pattern
minutes: /10
actions:
- action: open_epaper_link.drawcustom
data:
background: white
rotate: 0
ttl: 300
dither: false
payload:
- type: line
fill: red
width: 5
x_start: 0
y_start: 40
x_end: 400
y_end: 40
- type: line
fill: red
width: 10
x_start: 200
y_start: 40
x_end: 200
y_end: 270
- type: line
fill: red
width: 5
x_start: 0
y_start: 270
x_end: 400
y_end: 270
- type: text
value: Server Rack
font: ppb.ttf
x: 200
y: 5
size: 40
color: red
anchor: mt
- type: text
value: Current
font: ppb.ttf
x: 100
y: 170
size: 40
color: red
anchor: mm
- type: icon
value: thermometer
x: 45
y: 85
size: 40
color: black
- type: text
value: '{{ states(''sensor.server_rack_exhaust_fan_temperature_1'') | round
}}°F'
font: ppb.ttf
x: 125
y: 105
size: 40
color: black
anchor: mm
- type: icon
value: water-percent
x: 50
y: 215
size: 40
color: black
- type: text
value: '{{ states(''sensor.server_rack_exhaust_fan_humidity_1'') | round }}%'
font: ppb.ttf
x: 125
y: 235
size: 40
color: black
anchor: mm
- type: text
value: Target
font: ppb.ttf
x: 300
y: 170
size: 40
color: red
anchor: mm
- type: icon
value: thermometer
x: 245
y: 85
size: 40
color: black
- type: text
value: '{{ state_attr(''climate.server_rack_exhaust_fan_fan_1_thermostat'',
''temperature'') | round }}°F'
font: ppb.ttf
x: 325
y: 105
size: 40
color: black
anchor: mm
- type: icon
value: fan
x: 240
y: 215
size: 40
color: black
- type: text
value: '{{ states(''sensor.server_rack_exhaust_fan_fan_1_speed'') | round
}}%'
font: ppb.ttf
x: 325
y: 235
size: 40
color: black
anchor: mm
- type: text
value: As of {{ now().strftime('%m/%d/%Y at %I:%M %p') }}
font: ppb.ttf
x: 200
y: 290
size: 15
color: black
anchor: mm
target:
device_id:
- a07813b027de345048bdf12eaf51eb10
mode: restart
- id: 2c8ca4d5-b0e5-48c9-9a6d-a3cd60d2a449
alias: Server Rack Battery Power Alert
description: Notifies when server rack switches to battery power for more than 10
minutes. Monitors server rack backup and UPS power source sensors.
mode: single
triggers:
- trigger: state
entity_id: sensor.server_rack_backup_power_source
to: Battery
for:
minutes: 10
- trigger: state
entity_id: sensor.ups_source
to: Battery
for:
minutes: 10
conditions:
- alias: 'Safety check: Verify at least one sensor is on battery power to prevent
false notifications'
condition: template
value_template: '{% set server_rack_battery = is_state(''sensor.server_rack_backup_power_source'',
''Battery'') %} {% set ups_battery = is_state(''sensor.ups_source'', ''Battery'')
%} {{ server_rack_battery or ups_battery }}'
actions:
- action: notify.rohan_kapoor
data:
title: Server Rack Battery Power Alert
message: "{% set server_rack_battery = is_state('sensor.server_rack_backup_power_source',\
\ 'Battery') %} {% set ups_battery = is_state('sensor.ups_source', 'Battery')\
\ %} {% if server_rack_battery and ups_battery %}\n ⚠️ BOTH Server Rack Backup\
\ AND UPS are on battery power for 10+ minutes\n{% elif server_rack_battery\
\ %}\n ⚠️ Server Rack Backup Power Source switched to battery for 10+ minutes\n\
{% elif ups_battery %}\n ⚠️ UPS switched to battery power for 10+ minutes\n\
{% endif %}\nCurrent Status: • Server Rack Backup: {{ states('sensor.server_rack_backup_power_source')\
\ }} • UPS Source: {{ states('sensor.ups_source') }}\nBattery Information:\
\ • UPS Battery Capacity: {{ states('sensor.ups_battery_capacity') }}% • UPS\
\ Runtime Remaining: {{ states('sensor.ups_runtime_remaining') }} minutes\n\
• Server Rack Backup Time Remaining: {{ states('sensor.server_rack_backup_time_remaining')\
\ }} minutes • Server Rack Main Battery: {{ states('sensor.server_rack_backup_main_battery')\
\ }}% • Server Rack Extra1 Battery: {{ states('sensor.server_rack_backup_extra1_battery')\
\ }}% • Server Rack Extra2 Battery: {{ states('sensor.server_rack_backup_extra2_battery')\
\ }}%\nTime: {{ now().strftime('%m/%d/%Y at %I:%M %p') }}\nPlease check power\
\ status and take appropriate action."
- id: f126138c-bb79-4a9c-957a-a727ab53f95f
alias: Restart Fully Kiosk Browsers
description: Restart all tablets once a day to make sure that they don't get stuck.
triggers:
- trigger: time
at: 03:00:00
actions:
- action: button.press
target:
entity_id: "{{\n expand(integration_entities('fullykiosk'))\n | selectattr('entity_id',\
\ 'search', '_restart_browser')\n | map(attribute='entity_id')\n | list\n\
}}\n"
mode: single
- id: '1702712886222'
alias: Update ePaper Weather Displays
description: Display external weather on the epaper displays by the exterior doors
triggers:
- trigger: time_pattern
minutes: /15
conditions:
- condition: time
after: 07:00:00
before: 02:00:00
actions:
- data:
background: white
rotate: 0
ttl: 300
dither: false
payload:
- type: icon
value: "weather- {%- set condition = states('weather.pirateweather') -%} {%-\
\ if condition == 'partlycloudy' -%}\n {%- set condition = 'partly-cloudy'\
\ -%}\n{%- endif -%} {%- if condition == 'clear-night' -%}\n {%- set condition\
\ = 'night' -%}\n{%- endif -%} {%- if states('sun.sun') == 'below_horizon'\
\ -%}\n {%- if condition == 'sunny' -%}\n night\n {%- elif condition\
\ == 'partly-cloudy' -%}\n night-partly-cloudy\n {%- else -%}\n {{\
\ condition }}\n {%- endif -%}\n{%- else -%}\n {{ condition }}\n{%- endif\
\ -%}\n"
x: 42
y: 5
size: 75
color: black
- type: text
value: '{{ states(''sensor.weather_station_outdoor_temperature'') | round
}}°F'
font: ppb.ttf
x: 76
y: 105
size: 60
color: red
anchor: mm
- type: text
value: 'Updated: {{ now().strftime(''%I:%M %p'') }}'
font: ppb.ttf
x: 76
y: 135
size: 15
color: black
anchor: mt
target:
device_id:
- 93185d71c897d23075b33b802ad98658
action: open_epaper_link.drawcustom
mode: restart