AS
Size: a a a
AS
AS
V
light:
- platform: template
lights:
light_night:
friendly_name: Люстра ночь
icon_template: mdi:weather-night
value_template: >
{% if is_state('input_select.light_mode','moonlight') %}
true
{% elif is_state('input_select.light_mode','unavailable') %}
unavailable
{% else %}
false
{% endif %}
turn_on:
- service: yeelight.set_mode
entity_id: light.light
data:
mode: 'moonlight'
- service: input_select.select_option
data:
entity_id: input_select.light_mode
option: 'moonlight'
turn_off:
- service: light.turn_off
entity_id: light.light
- service: input_select.select_option
data:
entity_id: input_select.light_mode
option: 'off'
V
V
AS
V
input_select:
light_mode: # Режим люстры
name: Режим
options:
- "normal"
- "moonlight"
- "off"
V
V
AS
## Kitchen motion ceiling moonlight on from 2am to 6am
- alias: kitchen_motion_ceiling_moonlight_on_from_2_to_6
initial_state: true
trigger:
platform: event
event_type: xiaomi_aqara.motion
event_data:
entity_id: binary_sensor.motion_sensor_158d000165feaa
condition:
# - condition: numeric_state
# entity_id: sensor.illumination_158d000165feaa
# below: 40
- condition: time
after: '02:00:00'
before: '06:00:00'
action:
- service: yeelight.set_mode
data_template:
entity_id: light.yeelight_kitchen_ceiling
mode: moonlight
AS
AS
AS
V
## Kitchen motion ceiling moonlight on from 2am to 6am
- alias: kitchen_motion_ceiling_moonlight_on_from_2_to_6
initial_state: true
trigger:
platform: event
event_type: xiaomi_aqara.motion
event_data:
entity_id: binary_sensor.motion_sensor_158d000165feaa
condition:
# - condition: numeric_state
# entity_id: sensor.illumination_158d000165feaa
# below: 40
- condition: time
after: '02:00:00'
before: '06:00:00'
action:
- service: yeelight.set_mode
data_template:
entity_id: light.yeelight_kitchen_ceiling
mode: moonlight
AS
V
AS
AS
V
AS