sensor_chek_lighton_presencenone: ################################################################################### template: # Сенсоры автоотключения света # Сенсор автоотключения света ванна - binary_sensor: - name: "Сенсор вкл свет без движения ванная" unique_id: lighton_presencenone_bathroom icon: >- {% if is_state("binary_sensor.lighton_presencenone_bathroom", "on") %} mdi:timer {% else %} mdi:timer-off {% endif %} state: >- {{ (is_state('light.yeelink_ceilc_cc51_light', 'on') or is_state('light.yeelink_ceilc_cc51_ambient_light', 'on') or is_state('switch.rele_zerkalo_i_ventiliatsiia_l1', 'on')) and is_state('binary_sensor.datchik_prisutstviia_vannaia_presence', 'off') }} # Сенсор автоотключения света кухня - name: "Сенсор вкл свет без движения кухня" unique_id: lighton_presencenone_kitchen icon: >- {% if is_state("binary_sensor.lighton_presencenone_kitchen", "on") %} mdi:timer {% else %} mdi:timer-off {% endif %} state: >- {{ (is_state('light.yeelink_ceilc_ff3a_light', 'on') or is_state('light.yeelink_ceilc_ff3a_ambient_light', 'on')) and is_state('binary_sensor.datchik_prisutstviia_kukhnia_presence', 'off') }} # Сенсор автоотключения света коридор - name: "Сенсор вкл свет без движения коридор" unique_id: lighton_presencenone_lobby icon: "{{ 'mdi:timer' if this.state == 'on' else 'mdi:timer-off' }}" state: >- {{ (is_state('switch.glavnyi_vykliuchatel_prikhozhaia_left', 'on') or is_state('switch.glavnyi_vykliuchatel_prikhozhaia_right', 'on')) and is_state('binary_sensor.datchik_dvizheniia_prikhozhaia_occupancy', 'off') }} # Сенсор автоотключения света комната - name: "Сенсор вкл свет без движения комната" unique_id: lighton_presencenone_room icon: >- {% if is_state("binary_sensor.lighton_presencenone_room", "on") %} mdi:timer {% else %} mdi:timer-off {% endif %} state: >- {{ is_state('light.yeelink_ceiling19_d85c_light', 'on') and is_state('binary_sensor.54ef44e327ba_motion', 'off') and is_state('binary_sensor.54ef44e45e59_motion', 'off') and is_state('binary_sensor.54ef44e32e91_motion', 'off') }} ################################################################################### timer: timer_lighton_presencenone_bathroom: name: "Таймер вкл свет без движения ванная" duration: '00:05:00' timer_lighton_presencenone_kitchen: name: "Таймер вкл свет без движения кухня" duration: '00:05:00' timer_lighton_presencenone_lobby: name: "Таймер вкл свет без движения коридор" duration: '00:10:00' timer_lighton_presencenone_room: name: "Таймер вкл свет без движения комната" duration: '01:00:00' ################################################################################### automation: # Таймер автоотключения \\ /homeassistant/includes/packages/controls_light.yaml ################################################################################### # Сброс таймера при выключении # Сброс таймера при выключении ванная - alias: timer_lighton_presencenone_bathroom_off initial_state: true trigger: - platform: state entity_id: binary_sensor.lighton_presencenone_bathroom to: 'off' action: - service: timer.cancel target: entity_id: timer.timer_lighton_presencenone_bathroom # Сброс таймера при выключении кухня - alias: timer_lighton_presencenone_kitchen_off initial_state: true trigger: - platform: state entity_id: binary_sensor.lighton_presencenone_kitchen to: 'off' action: - service: timer.cancel target: entity_id: timer.timer_lighton_presencenone_kitchen # Сброс таймера при выключении коридор - alias: timer_lighton_presencenone_lobby_off initial_state: true trigger: - platform: state entity_id: binary_sensor.sensor_vkl_svet_bez_dvizheniia_koridor to: 'off' action: - service: timer.cancel target: entity_id: timer.timer_lighton_presencenone_lobby # Сброс таймера при выключении комната - alias: timer_lighton_presencenone_room_off initial_state: true trigger: - platform: state entity_id: binary_sensor.lighton_presencenone_room to: 'off' action: - service: timer.cancel target: entity_id: timer.timer_lighton_presencenone_room ################################################################################### # Старт таймеров при старте системы # Старт таймеров при старте системы ванна - alias: Старт таймера ванная при старте системы trigger: - platform: homeassistant event: start condition: - condition: state entity_id: binary_sensor.datchik_prisutstviia_vannaia_presence state: "off" action: - service: timer.start target: entity_id: timer.timer_lighton_presencenone_bathroom data: {} # Старт таймеров при старте системы кухня - alias: Старт таймера кухня при старте системы trigger: - platform: homeassistant event: start condition: - condition: state entity_id: binary_sensor.datchik_prisutstviia_kukhnia_presence state: "off" action: - service: timer.start target: entity_id: timer.timer_lighton_presencenone_kitchen data: {} # Старт таймеров при старте системы коридор - alias: Старт таймера коридор при старте системы trigger: - platform: homeassistant event: start condition: - condition: state entity_id: binary_sensor.datchik_dvizheniia_prikhozhaia_occupancy state: "off" action: - service: timer.start target: entity_id: timer.timer_lighton_presencenone_lobby # Старт таймеров при старте системы комната - alias: Старт таймера комната при старте системы trigger: - platform: homeassistant event: start condition: - condition: state entity_id: binary_sensor.54ef44e327ba_motion state: "off" action: - service: timer.start target: entity_id: timer.timer_lighton_presencenone_room ################################################################################### # Автоматизация отключения света по таймеру \\ /homeassistant/includes/packages/controls_light.yaml