Files
home-assistant/includes/packages/controls_light.yaml
T

1069 lines
38 KiB
YAML

controls_light:
###################################################################################
#диммер около кровати
ble_monitor:
devices:
- mac: 'F8:24:41:C5:DD:28'
name: 'dimmer_yeelight_room'
encryption_key: 'cfe177acf7c4b6b8ad9bdc7f'
reset_timer: 1
###################################################################################
#настройка времени суток || https://www.youtube.com/watch?v=oLxN0GHk_rk
#инпуты для ввода времени в интерфейсе
input_datetime:
#Основные
night_start:
name: INPT|night_start
has_date: false
has_time: true
night_stop:
name: INPT|night_stop
has_date: false
has_time: true
day_start:
name: INPT|day_start
has_date: false
has_time: true
day_stop:
name: INPT|day_stop
has_date: false
has_time: true
#дополнительные
night_lobby_start:
name: INPT|night_lobby_start
has_date: false
has_time: true
night_lobby_stop:
name: INPT|night_lobby_stop
has_date: false
has_time: true
day_lobby_start:
name: INPT|day_lobby_start
has_date: false
has_time: true
day_lobby_stop:
name: INPT|day_lobby_stop
has_date: false
has_time: true
#инпуты для ввода времени таймеров
bathroom_day_timer:
name: INPT|bathroom_day_timer
has_date: false
has_time: true
bathroom_night_timer:
name: INPT|bathroom_night_timer
has_date: false
has_time: true
lobby_day_timer:
name: INPT|lobby_day_timer
has_date: false
has_time: true
lobby_night_timer:
name: INPT|lobby_night_timer
has_date: false
has_time: true
room_day_timer:
name: INPT|room_day_timer
has_date: false
has_time: true
room_night_timer:
name: INPT|room_night_timer
has_date: false
has_time: true
kitchen_day_timer:
name: INPT|kitchen_day_timer
has_date: false
has_time: true
kitchen_night_timer:
name: INPT|kitchen_night_timer
has_date: false
has_time: true
#шаблонные сенсоры время суток
template:
- binary_sensor:
#основные
- name: night_time
unique_id: night_time
state: >
{% if states('input_datetime.night_start') < states('input_datetime.night_stop') %}
{{ states('input_datetime.night_start') <= now().strftime('%H:%M:%S') <= states('input_datetime.night_stop') }}
{% elif states('input_datetime.night_start') > states('input_datetime.night_stop') %}
{{states('input_datetime.night_start') <= now().strftime('%H:%M:%S') <= '23:59:59'
or '00:00:00' <= now().strftime('%H:%M:%S') <= states('input_datetime.night_stop')}}
{% endif %}
device_class: running
- name: day_time
unique_id: day_time
state: >
{% if states('input_datetime.day_start') < states('input_datetime.day_stop') %}
{{ states('input_datetime.day_start') <= now().strftime('%H:%M:%S') <= states('input_datetime.day_stop') }}
{% elif states('input_datetime.day_start') > states('input_datetime.day_stop') %}
{{states('input_datetime.day_start') <= now().strftime('%H:%M:%S') <= '23:59:59'
or '00:00:00' <= now().strftime('%H:%M:%S') <= states('input_datetime.day_stop')}}
{% endif %}
device_class: running
#дополнительные
- name: night_lobby_time
unique_id: night_lobby_time
state: >
{% if states('input_datetime.night_lobby_start') < states('input_datetime.night_lobby_stop') %}
{{ states('input_datetime.night_lobby_start') <= now().strftime('%H:%M:%S') <= states('input_datetime.night_lobby_stop') }}
{% elif states('input_datetime.night_lobby_start') > states('input_datetime.night_lobby_stop') %}
{{states('input_datetime.night_lobby_start') <= now().strftime('%H:%M:%S') <= '23:59:59'
or '00:00:00' <= now().strftime('%H:%M:%S') <= states('input_datetime.night_lobby_stop')}}
{% endif %}
device_class: running
- name: day_lobby_time
unique_id: day_lobby_time
state: >
{% if states('input_datetime.day_lobby_start') < states('input_datetime.day_lobby_stop') %}
{{ states('input_datetime.day_lobby_start') <= now().strftime('%H:%M:%S') <= states('input_datetime.day_lobby_stop') }}
{% elif states('input_datetime.day_lobby_start') > states('input_datetime.day_lobby_stop') %}
{{states('input_datetime.day_lobby_start') <= now().strftime('%H:%M:%S') <= '23:59:59'
or '00:00:00' <= now().strftime('%H:%M:%S') <= states('input_datetime.day_lobby_stop')}}
{% endif %}
device_class: running
###################################################################################
# Сенсоры включенного света в комнатах
# Сенсоры включенного света кухня
- default_entity_id: binary_sensor.lighton_kitchen
name: Сенсор вкл свет кухня
state: '{{ is_state(''light.yeelink_ceilc_ff3a_light'', ''on'') or is_state(''light.yeelink_ceilc_ff3a_ambient_light'',
''on'')}}'
# Сенсоры включенного света комната
- default_entity_id: binary_sensor.lighton_room
name: Сенсор вкл свет комната
state: '{{ is_state(''light.yeelink_ceiling19_d85c_light'', ''on'') or is_state(''light.yeelink_ceiling19_d85c_ambient_light'',
''on'')}}'
# Сенсоры включенного света ванна
- default_entity_id: binary_sensor.lighton_bathroom
name: Сенсор вкл света ванная
state: '{{ is_state(''light.yeelink_ceilc_cc51_light'', ''on'') or is_state(''light.yeelink_ceilc_cc51_ambient_light'',
''on'')}}'
###################################################################################
#комната
automation:
- alias: LGHT|Димер выкл весь свет
description: ""
trigger:
- platform: template
value_template: >-
{{(is_state('sensor.ble_dimmer_dimmer_yeelight_room', 'long press 6 steps'))}}
- platform: template
value_template: >-
{{(is_state('sensor.ble_dimmer_dimmer_yeelight_room', 'long press 8 steps'))}}
- platform: template
value_template: >-
{{(is_state('sensor.ble_dimmer_dimmer_yeelight_room', 'long press 10 steps'))}}
- platform: template
value_template: >-
{{(is_state('sensor.ble_dimmer_dimmer_yeelight_room', 'long press 11 steps'))}}
- platform: template
value_template: >-
{{(is_state('sensor.ble_dimmer_dimmer_yeelight_room', 'long press 12 steps'))}}
- platform: template
value_template: >-
{{(is_state('sensor.ble_dimmer_dimmer_yeelight_room', 'long press 13 steps'))}}
- platform: template
value_template: >-
{{(is_state('sensor.ble_dimmer_dimmer_yeelight_room', 'long press 14 steps'))}}
- platform: template
value_template: >-
{{(is_state('sensor.ble_dimmer_dimmer_yeelight_room', 'long press 15 steps'))}}
- platform: template
value_template: >-
{{(is_state('sensor.ble_dimmer_dimmer_yeelight_room', 'long press 16 steps'))}}
condition: []
action:
- service: scene.turn_on
target:
entity_id:
- scene.vannaia_vykl_svet
- scene.komnata_vykl_svet
- scene.kukhnia_vykl_svet
data: {}
- service: switch.turn_off
target:
entity_id:
- switch.glavnyi_vykliuchatel_prikhozhaia_left
- switch.glavnyi_vykliuchatel_prikhozhaia_right
- switch.rele_zerkalo_i_ventiliatsiia_l1
data: {}
mode: single
- alias: LGHT|btn_all_light_off
description: ""
mode: single
trigger:
- platform: state
entity_id: input_button.btn_vykliuchit_ves_svet
action:
- service: scene.turn_on
target:
entity_id:
- scene.vannaia_vykl_svet
- scene.komnata_vykl_svet
- scene.kukhnia_vykl_svet
data: {}
- service: switch.turn_off
target:
entity_id:
- switch.glavnyi_vykliuchatel_prikhozhaia_left
- switch.glavnyi_vykliuchatel_prikhozhaia_right
- switch.rele_zerkalo_i_ventiliatsiia_l1
data: {}
- alias: LGHT|mbchrg_off_gps_off
description: ""
mode: single
trigger:
- platform: state
entity_id:
- sensor.where_people
to: "False"
from: null
condition: []
action:
- service: switch.turn_off
target:
entity_id: switch.0xa4c138a1b1cd2be1
data: {}
- alias: LGHT|mbchrg_on_gps_on
description: ""
mode: single
trigger:
- platform: state
entity_id:
- sensor.where_people
from: null
to: "True"
condition: []
action:
- service: switch.turn_on
target:
entity_id: switch.0xa4c138a1b1cd2be1
data: {}
#стандартный свет комната
- alias: LGHT|room_std_on
description: ""
trigger:
- platform: device
domain: mqtt
device_id: 69804df32abfe4154281b2fc176ce519
type: action
subtype: double_left
discovery_id: 0x54ef44100017e9a7 action_double_left
condition: []
action:
- service: scene.turn_on
target:
entity_id: scene.komnata_osveshchenie_standart
- alias: LGHT|room_100
mode: single
trigger:
- platform: device
domain: mqtt
device_id: 69804df32abfe4154281b2fc176ce519
type: action
subtype: double_both
condition: []
action:
- service: scene.turn_on
metadata: {}
target:
entity_id: scene.lght_room_100
#красный свет вкл
- alias: LGHT|room_red_on
description: ""
trigger:
- platform: device
domain: mqtt
device_id: 69804df32abfe4154281b2fc176ce519
type: action
subtype: single_both
discovery_id: 0x54ef44100017e9a7 action_single_both
condition: []
action:
- service: scene.turn_on
target:
entity_id: scene.novaia_stsena
metadata: {}
mode: single
#синий свет вкл
- alias: LGHT|room_tv_on
description: ""
trigger:
- platform: device
domain: mqtt
device_id: 69804df32abfe4154281b2fc176ce519
type: action
subtype: double_right
discovery_id: 0x54ef44100017e9a7 action_double_right
condition: []
action:
- service: scene.turn_on
target:
entity_id: scene.komnata_ambilight_sinii
metadata: {}
- alias: LGHT|on\off_room_light
description: ""
trigger:
- platform: device
domain: mqtt
device_id: 69804df32abfe4154281b2fc176ce519
type: action
subtype: single_left
discovery_id: 0x54ef44100017e9a7 action_single_left
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: light.yeelight_ceiling19_0x159cb1c7
state: "off"
sequence:
- service: scene.turn_on
metadata: {}
target:
entity_id: scene.komnata_osveshchenie_standart
- conditions:
- condition: device
type: is_on
device_id: 4e045c09a0acc894d6fcf78850b92a5d
entity_id: 6062bbf1e0f2a8208bc4c2e288d19698
domain: light
sequence:
- service: scene.turn_on
metadata: {}
target:
entity_id: scene.komnata_vykl_svet
- alias: LGHT|on_room_night
description: ""
trigger:
- platform: device
domain: mqtt
device_id: 69804df32abfe4154281b2fc176ce519
type: action
subtype: single_right
discovery_id: 0x54ef44100017e9a7 action_single_right
condition: []
action:
- service: scene.turn_on
metadata: {}
target:
entity_id: scene.lght_room_night_on
# Таймер автоотключения комната
- alias: tmr|light_on_presencenone_room_on
initial_state: true
trigger:
# Условия для запуска таймера освещения
- platform: state
entity_id: binary_sensor.sensor_vkl_svet_bez_dvizheniia_komnata
to: 'on'
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.night_time
state: "on"
sequence:
- service: timer.start
entity_id: timer.timer_lighton_presencenone_room
data_template:
duration: "{{ states('input_datetime.room_night_timer') }}"
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.day_time
state: "on"
sequence:
- service: timer.start
entity_id: timer.timer_lighton_presencenone_room
data_template:
duration: "{{ states('input_datetime.room_day_timer') }}"
# отключения света по таймеру комната
- alias: LGHT|room_off_timer_light
trigger:
- platform: state
entity_id:
- timer.timer_lighton_presencenone_room
from: null
for:
hours: 0
minutes: 0
seconds: 0
to: idle
condition:
- condition: template
value_template: |-
{{ (is_state('binary_sensor.54ef44e45e59_motion', 'off')
and is_state('binary_sensor.54ef44e327ba_motion', 'off')
and is_state('binary_sensor.54ef44e32e91_motion', 'off'))}}
action:
- service: scene.turn_on
target:
entity_id: scene.komnata_vykl_svet
###################################################################################
#ванная
- alias: LGHT|Bathroom_on_standart_light
description: ""
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.datchik_prisutstviia_vannaia_presence
from: "off"
to: "on"
condition:
- condition: state
entity_id: light.yeelink_ceilc_cc51_light
state: "off"
- condition: state
entity_id: light.yeelink_ceilc_cc51_ambient_light
state: "off"
action:
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l1
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.day_time
state: "on"
sequence:
- service: scene.turn_on
target:
entity_id: scene.vannaia_standartnyi_svet
metadata: {}
enabled: true
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l1
enabled: false
- conditions:
- condition: or
conditions:
- condition: state
entity_id: light.yeelight_ceiling19_0x159cb1c7
state: "on"
- condition: state
entity_id: light.yeelight
state: "on"
- condition: state
entity_id: binary_sensor.night_time
state: "on"
sequence:
- service: scene.turn_on
target:
entity_id: scene.vannaia_standartnyi_svet
metadata: {}
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l1
enabled: false
- alias: LGHT|Bathroom_on_night_light
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.datchik_prisutstviia_vannaia_presence
from: "off"
to: "on"
condition:
- condition: state
entity_id: light.yeelink_ceilc_cc51_light
state: "off"
- condition: state
entity_id: light.yeelink_ceilc_cc51_ambient_light
state: "off"
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.night_time
state: "on"
- condition: state
entity_id: light.yeelight_ceiling19_0x159cb1c7
state: "off"
- condition: state
entity_id: light.yeelight
state: "off"
sequence:
- service: scene.turn_on
target:
entity_id: scene.vannaia_nochnik_1
metadata: {}
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l1
mode: single
- alias: LGHT|Bathroom_btn_on_light
description: ""
mode: single
triggers:
- domain: mqtt
device_id: bfa6bf0e6ae94405b731622e2a09cf6d
type: action
subtype: single_right
discovery_id: 0x54ef4410003abdb9 action_single_right
trigger: device
conditions:
- condition: state
entity_id: light.yeelink_ceilc_cc51_light
state: "off"
- condition: state
entity_id: light.yeelink_ceilc_cc51_ambient_light
state: "off"
actions:
- target:
entity_id: scene.vannaia_standartnyi_svet
metadata: {}
action: scene.turn_on
data: {}
- metadata: {}
data: {}
target:
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l1
action: switch.turn_on
- alias: LGHT|Bathroom_btn_off_light
description: ""
mode: single
triggers:
- domain: mqtt
device_id: bfa6bf0e6ae94405b731622e2a09cf6d
type: action
subtype: single_right
discovery_id: 0x54ef4410003abdb9 action_single_right
trigger: device
conditions:
- condition: or
conditions:
- condition: state
entity_id: light.yeelink_ceilc_cc51_light
state: "on"
- condition: state
entity_id: light.yeelink_ceilc_cc51_ambient_light
state: "off"
actions:
- target:
entity_id: scene.vannaia_vykl_svet
metadata: {}
action: scene.turn_on
data: {}
- metadata: {}
data: {}
target:
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l1
action: switch.turn_off
- alias: LGHT|Bathroom_dblclck_standart_light
description: ""
trigger:
- platform: device
domain: mqtt
device_id: bfa6bf0e6ae94405b731622e2a09cf6d
type: action
subtype: double_right
discovery_id: 0x54ef4410003abdb9 action_double_right
condition: []
action:
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l1
- service: scene.turn_on
target:
entity_id: scene.vannaia_standartnyi_svet
metadata: {}
mode: single
# Старт таймера автоотключения ванная
- alias: tmr|light_on_presencenone_bathroom_on
description: ""
trigger:
- platform: state
entity_id: binary_sensor.sensor_vkl_svet_bez_dvizheniia_vannaia
to: "on"
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.night_time
state: "on"
sequence:
- service: timer.start
entity_id: timer.timer_lighton_presencenone_bathroom
data_template:
duration: "{{ states('input_datetime.bathroom_night_timer') }}"
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.day_time
state: "on"
sequence:
- service: timer.start
entity_id: timer.timer_lighton_presencenone_bathroom
data_template:
duration: "{{ states('input_datetime.bathroom_day_timer') }}"
# отключения света по таймеру ванна
- alias: LGHT|Bathroom_off_timer_light
trigger:
- platform: state
entity_id:
- timer.timer_lighton_presencenone_bathroom
from: null
for:
hours: 0
minutes: 0
seconds: 0
to: idle
condition:
- condition: state
entity_id: binary_sensor.datchik_prisutstviia_vannaia_presence
state: "off"
action:
- service: switch.turn_off
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l1
- service: scene.turn_on
target:
entity_id: scene.vannaia_vykl_svet
###################################################################################
# Прихожая
- alias: LGHT|light_on_room_lobby_open_door
description: ""
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.e4aaec3747b2_contact
from: "off"
to: "on"
condition:
- condition: state
entity_id: binary_sensor.datchik_dvizheniia_prikhozhaia_occupancy
state: "off"
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.day_lobby_time
state: "on"
sequence:
- service: switch.turn_on
target:
entity_id: switch.glavnyi_vykliuchatel_prikhozhaia_right
data: {}
- if:
- condition: state
entity_id: binary_sensor.54ef44e45e59_light
state: "off"
- condition: state
entity_id: sensor.all_motion
state: "False"
for:
hours: 1
minutes: 0
seconds: 0
then:
- service: scene.turn_on
metadata: {}
target:
entity_id: scene.komnata_osveshchenie_standart
- conditions:
- condition: state
entity_id: binary_sensor.night_lobby_time
state: "on"
sequence:
- service: switch.turn_on
data: {}
target:
entity_id: switch.glavnyi_vykliuchatel_prikhozhaia_left
- alias: LGHT|btn_lobby_light_on/off_night
description: ""
trigger:
- platform: device
domain: mqtt
device_id: 975fb5853727f1fa4279bac09fd7fb6b
type: action
subtype: double_left
discovery_id: 0x00158d0006c6bca8 action_double_left
condition: []
action:
- service: switch.toggle
metadata: {}
data: {}
target:
entity_id: switch.glavnyi_vykliuchatel_prikhozhaia_left
mode: single
- alias: LGHT|btn_lobby_light_on/off_day
description: ""
trigger:
- platform: device
domain: mqtt
device_id: 975fb5853727f1fa4279bac09fd7fb6b
type: action
subtype: single_left
discovery_id: 0x00158d0006c6bca8 action_single_left
condition: []
action:
- service: switch.toggle
metadata: {}
data: {}
target:
entity_id: switch.glavnyi_vykliuchatel_prikhozhaia_right
mode: single
- alias: LGHT|lobby_light_on_day_motion
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.datchik_dvizheniia_prikhozhaia_occupancy
to: "on"
condition:
- condition: state
entity_id: binary_sensor.day_lobby_time
state: "on"
action:
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.glavnyi_vykliuchatel_prikhozhaia_right
mode: single
- alias: LGHT|lobby_light_on_night_motion
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.datchik_dvizheniia_prikhozhaia_occupancy
to: "on"
condition:
- condition: state
entity_id: binary_sensor.night_lobby_time
state: "on"
action:
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.glavnyi_vykliuchatel_prikhozhaia_left
mode: single
- alias: LGHT|lobby_clck_all_light_off
mode: single
trigger:
- platform: device
domain: mqtt
device_id: 975fb5853727f1fa4279bac09fd7fb6b
type: action
subtype: single_right
condition: []
action:
- service: scene.turn_on
target:
entity_id:
- scene.komnata_vykl_svet
data: {}
- service: switch.turn_off
target:
entity_id:
- switch.glavnyi_vykliuchatel_prikhozhaia_left
- switch.glavnyi_vykliuchatel_prikhozhaia_right
data: {}
# отключения света по таймеру коридор
- alias: LGHT|lobby_off_timer_light
description: ""
mode: single
trigger:
- platform: state
entity_id:
- timer.timer_lighton_presencenone_lobby
from: null
for:
hours: 0
minutes: 0
seconds: 0
to: idle
condition:
- condition: state
entity_id: binary_sensor.datchik_dvizheniia_prikhozhaia_occupancy
state: "off"
action:
- service: switch.turn_off
metadata: {}
data: {}
target:
entity_id:
- switch.glavnyi_vykliuchatel_prikhozhaia_left
- switch.glavnyi_vykliuchatel_prikhozhaia_right
- alias: LGHT|btn_left_wifi_on_light_room
description: ""
mode: single
triggers:
- domain: mqtt
device_id: 975fb5853727f1fa4279bac09fd7fb6b
type: action
subtype: hold_left
discovery_id: 0x00158d0006c6bca8 action_hold_left
trigger: device
conditions: []
actions:
- target:
entity_id: scene.komnata_osveshchenie_standart
metadata: {}
action: scene.turn_on
# Таймер автоотключения коридор
- alias: tmr|light_on_presencenone_lobby_on
initial_state: true
trigger:
# Условия для запуска таймера освещения
- platform: state
entity_id: binary_sensor.sensor_vkl_svet_bez_dvizheniia_koridor
to: 'on'
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.night_lobby_time
state: "on"
sequence:
- service: timer.start
entity_id: timer.timer_lighton_presencenone_lobby
data_template:
duration: "{{ states('input_datetime.lobby_night_timer') }}"
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.day_lobby_time
state: "on"
sequence:
- service: timer.start
entity_id: timer.timer_lighton_presencenone_lobby
data_template:
duration: "{{ states('input_datetime.lobby_day_timer') }}"
#========================================================================================
#Кухня
- alias: LGHT|on_btnclc_kitchen
description: ""
trigger:
- platform: device
domain: mqtt
device_id: 3477021b47adcf79dc87c91f73cc9183
type: action
subtype: single
discovery_id: 0x54ef4410000f268c action_single
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: light.yeelink_ceilc_ff3a_light
state: "off"
- condition: state
entity_id: light.yeelink_ceilc_ff3a_ambient_light
state: "off"
sequence:
- service: scene.turn_on
target:
entity_id: scene.svet_v_kukhne_100
metadata: {}
- conditions:
- condition: or
conditions:
- condition: state
entity_id: light.yeelink_ceilc_ff3a_light
state: "on"
- condition: state
entity_id: light.yeelink_ceilc_ff3a_ambient_light
state: "on"
sequence:
- service: scene.turn_on
metadata: {}
target:
entity_id: scene.kukhnia_vykl_svet
- alias: LGHT|kitchen_on_lght<50
description: ""
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.datchik_prisutstviia_kukhnia_presence
from: "off"
to: "on"
condition:
- condition: numeric_state
entity_id: sensor.datchik_osveshcheniia_illuminance
below: 60
- condition: state
entity_id: light.yeelink_ceilc_ff3a_light
state: "off"
- condition: state
entity_id: light.yeelink_ceilc_ff3a_ambient_light
state: "off"
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.day_time
state: "on"
- condition: state
entity_id: light.yeelink_ceilc_ff3a_light
state: "off"
- condition: state
entity_id: light.yeelink_ceilc_ff3a_ambient_light
state: "off"
sequence:
- service: scene.turn_on
target:
entity_id: scene.svet_v_kukhne_100
metadata: {}
enabled: true
- conditions:
- condition: state
entity_id: binary_sensor.night_time
state: "on"
- condition: state
entity_id: light.yeelink_ceilc_ff3a_light
state: "off"
- condition: state
entity_id: light.yeelink_ceilc_ff3a_ambient_light
state: "off"
- condition: or
conditions:
- condition: state
entity_id: light.yeelight_ceiling19_0x159cb1c7
state: "on"
- condition: state
entity_id: light.yeelight_ceilc_0x19f138fc
state: "on"
sequence:
- service: scene.turn_on
target:
entity_id: scene.svet_v_kukhne_100
metadata: {}
- conditions:
- condition: state
entity_id: binary_sensor.night_time
state: "on"
- condition: state
entity_id: light.yeelight_ceiling19_0x159cb1c7
state: "off"
- condition: state
entity_id: light.yeelight_ceilc_0x19f138fc
state: "off"
sequence:
- service: scene.turn_on
metadata: {}
target:
entity_id: scene.kukhnia_noch
# Таймер автоотключения кухня
- alias: tmr|light_on_presencenone_kitchen_on
initial_state: true
trigger:
# Условия для запуска таймера освещения
- platform: state
entity_id: binary_sensor.sensor_vkl_svet_bez_dvizheniia_kukhnia
to: 'on'
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.night_time
state: "on"
sequence:
- service: timer.start
entity_id: timer.timer_lighton_presencenone_kitchen
data_template:
duration: "{{ states('input_datetime.kitchen_night_timer') }}"
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.day_time
state: "on"
sequence:
- service: timer.start
entity_id: timer.timer_lighton_presencenone_kitchen
data_template:
duration: "{{ states('input_datetime.kitchen_day_timer') }}"
# отключения света по таймеру кухня
- alias: LGHT|kitchen_off_timer_light
trigger:
- platform: state
entity_id:
- timer.timer_lighton_presencenone_kitchen
from: null
for:
hours: 0
minutes: 0
seconds: 0
to: idle
condition:
- condition: state
entity_id: binary_sensor.datchik_prisutstviia_kukhnia_presence
state: "off"
action:
- service: scene.turn_on
target:
entity_id: scene.kukhnia_vykl_svet