Move wife's desk light settings to sensor for ease of use elsewhere

This commit is contained in:
2023-08-11 22:00:11 -04:00
parent a3ba9a5e9f
commit f17a25988e

View File

@ -412,6 +412,25 @@ sensor:
value_template: "{{ states('input_number.basement_led_strip_resets') | int }}"
unit_of_measurement: 'resets'
icon_template: mdi:restore
tina_desk_scene:
friendly_name: Tina Desk Scene
unique_id: 0d94ba35-bc9d-40a2-aa77-776d26bc3538
value_template: >
{% if is_state('input_boolean.give_me_darkness','on') %}
Night Mode
{% elif is_state('binary_sensor.early_night_mode','on') and is_state('input_boolean.give_me_darkness','off') %}
Evening Mode
{% else %}
Day Mode
{% endif %}
icon_template: >
{% if is_state('input_boolean.give_me_darkness','on') %}
mdi:weather-night
{% elif is_state('binary_sensor.early_night_mode','on') and is_state('input_boolean.give_me_darkness','off') %}
mdi:lightbulb-night
{% else %}
mdi:lightbulb
{% endif %}
template:
- binary_sensor:
@ -702,41 +721,11 @@ automation:
- condition: trigger
id: computer-on
then:
- if:
- condition: state
entity_id: binary_sensor.early_night_mode
state: 'off'
then:
- service: input_select.select_option
target:
entity_id: input_select.tina_desk_scenes
data:
option: Day Mode
- if:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.early_night_mode
state: 'on'
- condition: state
entity_id: input_boolean.give_me_darkness
state: 'off'
then:
- service: input_select.select_option
target:
entity_id: input_select.tina_desk_scenes
data:
option: Evening Mode
- if:
- condition: state
entity_id: input_boolean.give_me_darkness
state: 'on'
then:
- service: input_select.select_option
target:
entity_id: input_select.tina_desk_scenes
data:
option: Night Mode
- service: input_select.select_option
target:
entity_id: input_select.tina_desk_scenes
data:
option: "{{ states('sensor.tina_desk_scene') }}"
- if:
- condition: trigger
id: toggle-off