New "upstairs bathroom occupied" binary sensor

This commit is contained in:
2023-03-27 23:28:57 -04:00
parent e8f4e9c2c1
commit 41a5ede268
4 changed files with 18 additions and 27 deletions

View File

@ -996,25 +996,17 @@ script:
entity_id: input_boolean.shower_mode
state: 'off'
then:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.upstairs_bathroom_motion
state: 'on'
sequence:
- service: input_select.select_option
target:
entity_id: input_select.upstairs_bathroom_scenes
data:
option: Adaptive
- conditions:
- condition: template
value_template: "{{ is_state('binary_sensor.upstairs_bathroom_motion','off') and is_state('timer.upstairs_bathroom_motion_timer','active') }}"
sequence:
- service: timer.finish
target:
entity_id: timer.upstairs_bathroom_motion_timer
default:
- if:
- condition: state
entity_id: binary_sensor.upstairs_bathroom_occupied
state: 'on'
then:
- service: input_select.select_option
target:
entity_id: input_select.upstairs_bathroom_scenes
data:
option: Adaptive
else:
- if:
- condition: state
entity_id: binary_sensor.early_night_mode
@ -1309,9 +1301,7 @@ script:
entity_id: input_select.upstairs_bathroom_scenes
data:
option: >
{% if is_state('binary_sensor.upstairs_bathroom_motion','on') %}
Adaptive
{% elif is_state('timer.upstairs_bathroom_motion_timer','active') %}
{% if is_state('binary_sensor.upstairs_bathroom_occupied','on') %}
Adaptive
{% else %}
Nightlight
@ -1366,9 +1356,7 @@ script:
entity_id: input_select.upstairs_bathroom_scenes
data:
option: >
{% if is_state('binary_sensor.upstairs_bathroom_motion','on') %}
Adaptive
{% elif is_state('timer.upstairs_bathroom_motion_timer','active') %}
{% if is_state('binary_sensor.upstairs_bathroom_occupied','on') %}
Adaptive
{% else %}
Nightlight