mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-09-06 18:08:45 +00:00
Add bed_led light
This commit is contained in:
@@ -11,7 +11,11 @@ views:
|
|||||||
panel: true
|
panel: true
|
||||||
icon: mdi:floor-plan
|
icon: mdi:floor-plan
|
||||||
cards:
|
cards:
|
||||||
- type: picture-elements
|
- type: 'custom:config-template-card'
|
||||||
|
entities:
|
||||||
|
- light.bed_led
|
||||||
|
card:
|
||||||
|
type: picture-elements
|
||||||
image: /local/images/floorplan/floorplan_night_transparent.png
|
image: /local/images/floorplan/floorplan_night_transparent.png
|
||||||
style: |
|
style: |
|
||||||
height: 100%
|
height: 100%
|
||||||
|
|||||||
@@ -44,14 +44,24 @@ views:
|
|||||||
template: small
|
template: small
|
||||||
entity: light.living_room_main_lights
|
entity: light.living_room_main_lights
|
||||||
name: Living room
|
name: Living room
|
||||||
- type: custom:button-card
|
|
||||||
template: small
|
|
||||||
entity: light.master_bedroom_main_lights
|
|
||||||
name: M. Bedroom
|
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
template: small
|
template: small
|
||||||
entity: light.tuya_hallway_main_lights
|
entity: light.tuya_hallway_main_lights
|
||||||
name: Hallway
|
name: Hallway
|
||||||
|
- type: horizontal-stack
|
||||||
|
cards:
|
||||||
|
- type: custom:button-card
|
||||||
|
template: small
|
||||||
|
entity: light.master_bedroom_main_lights
|
||||||
|
name: "M. Bedroom"
|
||||||
|
- type: custom:button-card
|
||||||
|
template: small
|
||||||
|
entity: light.bedside_light
|
||||||
|
name: Bedside
|
||||||
|
- type: custom:button-card
|
||||||
|
template: small
|
||||||
|
entity: light.bed_led
|
||||||
|
name: Bed
|
||||||
- type: horizontal-stack
|
- type: horizontal-stack
|
||||||
cards:
|
cards:
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
@@ -61,10 +71,6 @@ views:
|
|||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
template: small
|
template: small
|
||||||
entity: light.pc
|
entity: light.pc
|
||||||
- type: custom:button-card
|
|
||||||
template: small
|
|
||||||
entity: light.bedside_light
|
|
||||||
name: Bedside
|
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
template: small
|
template: small
|
||||||
entity: light.tuya_hallway_entrance_lights
|
entity: light.tuya_hallway_entrance_lights
|
||||||
|
|||||||
@@ -26,6 +26,13 @@
|
|||||||
- top: 11.7%
|
- top: 11.7%
|
||||||
- left: 61.6%
|
- left: 61.6%
|
||||||
|
|
||||||
|
- type: custom:decluttering-card
|
||||||
|
template: floorplan_state_icon
|
||||||
|
variables:
|
||||||
|
- entity: light.bed_led
|
||||||
|
- top: 11%
|
||||||
|
- left: 67.5%
|
||||||
|
|
||||||
- type: custom:decluttering-card
|
- type: custom:decluttering-card
|
||||||
template: floorplan_state_icon
|
template: floorplan_state_icon
|
||||||
variables:
|
variables:
|
||||||
|
|||||||
@@ -167,3 +167,21 @@
|
|||||||
background-color: rgba(255,0,0,0.5)
|
background-color: rgba(255,0,0,0.5)
|
||||||
color: transparent
|
color: transparent
|
||||||
transform: perspective(2000px) rotateX(185.6deg) rotateY(73.1deg)
|
transform: perspective(2000px) rotateX(185.6deg) rotateY(73.1deg)
|
||||||
|
|
||||||
|
# Master bedroom LED Strip
|
||||||
|
- type: conditional
|
||||||
|
conditions:
|
||||||
|
- entity: light.bed_led
|
||||||
|
state: "on"
|
||||||
|
elements:
|
||||||
|
- type: state-label
|
||||||
|
entity: light.bed_led
|
||||||
|
style:
|
||||||
|
width: 9.9%
|
||||||
|
height: 0
|
||||||
|
top: 7.6%
|
||||||
|
left: 67.6%
|
||||||
|
background-color: '${ states[''light.bed_led''].attributes.rgb_color ? "rgb(" + states[''light.bed_led''].attributes.rgb_color[0] + "," + states[''light.bed_led''].attributes.rgb_color[1] + "," + states[''light.bed_led''].attributes.rgb_color[2] + ")" : "rgba(0, 0, 0, 0)" }'
|
||||||
|
|
||||||
|
color: transparent
|
||||||
|
box-shadow: '${ states[''light.bed_led''].attributes.rgb_color ? "0 0 10px 5px rgba(" + states[''light.bed_led''].attributes.rgb_color[0] + "," + states[''light.bed_led''].attributes.rgb_color[1] + "," + states[''light.bed_led''].attributes.rgb_color[2] + ",0.7)" : "none" }'
|
||||||
|
|||||||
@@ -35,14 +35,24 @@ cards:
|
|||||||
template: small
|
template: small
|
||||||
entity: light.living_room_main_lights
|
entity: light.living_room_main_lights
|
||||||
name: Living room
|
name: Living room
|
||||||
|
- type: custom:button-card
|
||||||
|
template: small
|
||||||
|
entity: light.tuya_hallway_main_lights
|
||||||
|
name: Hallway
|
||||||
|
- type: horizontal-stack
|
||||||
|
cards:
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
template: small
|
template: small
|
||||||
entity: light.master_bedroom_main_lights
|
entity: light.master_bedroom_main_lights
|
||||||
name: "M. Bedroom"
|
name: "M. Bedroom"
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
template: small
|
template: small
|
||||||
entity: light.tuya_hallway_main_lights
|
entity: light.bedside_light
|
||||||
name: Hallway
|
name: Bedside
|
||||||
|
- type: custom:button-card
|
||||||
|
template: small
|
||||||
|
entity: light.bed_led
|
||||||
|
name: Bed
|
||||||
- type: horizontal-stack
|
- type: horizontal-stack
|
||||||
cards:
|
cards:
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
@@ -52,10 +62,6 @@ cards:
|
|||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
template: small
|
template: small
|
||||||
entity: light.pc
|
entity: light.pc
|
||||||
- type: custom:button-card
|
|
||||||
template: small
|
|
||||||
entity: light.bedside_light
|
|
||||||
name: Bedside
|
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
template: small
|
template: small
|
||||||
entity: light.tuya_hallway_entrance_lights
|
entity: light.tuya_hallway_entrance_lights
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ cards:
|
|||||||
- fade: switch.light_le_4_fade
|
- fade: switch.light_le_4_fade
|
||||||
- wifi: sensor.light_le_4_wifi
|
- wifi: sensor.light_le_4_wifi
|
||||||
- light.bedside_light
|
- light.bedside_light
|
||||||
|
- light.bed_led
|
||||||
|
|
||||||
- type: custom:decluttering-card
|
- type: custom:decluttering-card
|
||||||
template: sonos_media_player
|
template: sonos_media_player
|
||||||
|
|||||||
@@ -117,8 +117,7 @@ cards:
|
|||||||
- automation.house_mode_set_to_day
|
- automation.house_mode_set_to_day
|
||||||
- automation.house_mode_set_to_bed
|
- automation.house_mode_set_to_bed
|
||||||
- automation.house_mode_set_to_night
|
- automation.house_mode_set_to_night
|
||||||
- automation.house_mode_set_to_night_on_bedside_switch_double_click
|
- automation.house_mode_toggle_on_bedside_switch_double_click
|
||||||
- automation.house_mode_set_to_bed_on_bedside_switch_hold
|
|
||||||
- automation.alarm_wake_up
|
- automation.alarm_wake_up
|
||||||
- automation.alarm_set_time
|
- automation.alarm_set_time
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ group:
|
|||||||
- automation.house_mode_set_to_night
|
- automation.house_mode_set_to_night
|
||||||
- automation.house_mode_set_to_bed
|
- automation.house_mode_set_to_bed
|
||||||
- automation.house_mode_set_to_day
|
- automation.house_mode_set_to_day
|
||||||
- automation.house_mode_set_to_night_on_bedside_switch_double_click
|
- automation.house_mode_toggle_on_bedside_switch_double_click
|
||||||
- automation.house_mode_set_to_bed_on_bedside_switch_hold
|
|
||||||
- automation.alarm_wake_up
|
- automation.alarm_wake_up
|
||||||
- automation.music_play_pause_on_magic_cube_knock
|
- automation.music_play_pause_on_magic_cube_knock
|
||||||
- automation.music_volume_down_on_magic_cube_rotate_left
|
- automation.music_volume_down_on_magic_cube_rotate_left
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ automation:
|
|||||||
action:
|
action:
|
||||||
- service: script.routine_good_night
|
- service: script.routine_good_night
|
||||||
|
|
||||||
- alias: House mode · Set to night on bedside switch double click
|
- alias: House mode · Toggle on bedside switch double click
|
||||||
trigger:
|
trigger:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
@@ -76,26 +76,14 @@ automation:
|
|||||||
data_template:
|
data_template:
|
||||||
option: >
|
option: >
|
||||||
|
|
||||||
{% if now().strftime('%H')|int > 20 or now().strftime('%H')|int < 6 %}
|
{% if is_state('input_select.house_mode', 'day') %}
|
||||||
|
bed
|
||||||
|
{% elif is_state('input_select.house_mode', 'bed') %}
|
||||||
night
|
night
|
||||||
{% else %}
|
{% else %}
|
||||||
day
|
day
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- alias: House mode · Set to bed on bedside switch hold
|
|
||||||
trigger:
|
|
||||||
- platform: event
|
|
||||||
event_type: zha_event
|
|
||||||
event_data:
|
|
||||||
device_ieee: !secret master_bedroom_bedside_switch_ieee
|
|
||||||
command: hold
|
|
||||||
action:
|
|
||||||
- service: input_select.select_option
|
|
||||||
entity_id: input_select.house_mode
|
|
||||||
data:
|
|
||||||
option: bed
|
|
||||||
|
|
||||||
|
|
||||||
- alias: Alarm · Wake up
|
- alias: Alarm · Wake up
|
||||||
trigger:
|
trigger:
|
||||||
platform: template
|
platform: template
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ light:
|
|||||||
entities:
|
entities:
|
||||||
- light.master_bedroom_main_lights
|
- light.master_bedroom_main_lights
|
||||||
- light.bedside_light
|
- light.bedside_light
|
||||||
|
- light.bed_led
|
||||||
|
|
||||||
- platform: group
|
- platform: group
|
||||||
name: Kitchen main lights
|
name: Kitchen main lights
|
||||||
|
|||||||
@@ -35,8 +35,17 @@ automation:
|
|||||||
|
|
||||||
{% if is_state('input_select.house_mode', 'day') %}
|
{% if is_state('input_select.house_mode', 'day') %}
|
||||||
light.master_bedroom_main_lights
|
light.master_bedroom_main_lights
|
||||||
|
{% elif is_state('input_select.house_mode', 'bed') %}
|
||||||
|
light.bedside_light, light.bed_led
|
||||||
|
{% elif is_state('input_select.house_mode', 'night') %}
|
||||||
|
light.bed_led
|
||||||
|
{% endif %}
|
||||||
|
brightness_pct: >-
|
||||||
|
|
||||||
|
{% if is_state('input_select.house_mode', 'night') %}
|
||||||
|
40
|
||||||
{% else %}
|
{% else %}
|
||||||
light.bedside_light
|
100
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- alias: Lighting · Living room · Turn all lights on on Magic Cube flip 90
|
- alias: Lighting · Living room · Turn all lights on on Magic Cube flip 90
|
||||||
@@ -103,7 +112,7 @@ automation:
|
|||||||
- light.light_le_6
|
- light.light_le_6
|
||||||
- light.light_le_8
|
- light.light_le_8
|
||||||
data:
|
data:
|
||||||
brightness_pct: 13
|
brightness_pct: 13 # this is the lowest it'll go ¯\_(ツ)_/¯
|
||||||
- delay: 00:10:00
|
- delay: 00:10:00
|
||||||
# reset brightness and turn off
|
# reset brightness and turn off
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
homeassistant:
|
||||||
|
customize:
|
||||||
|
light.bed_led:
|
||||||
|
friendly_name: Bed LED
|
||||||
|
icon: mdi:led-strip
|
||||||
@@ -5,6 +5,10 @@ script:
|
|||||||
# Set master bedroom state
|
# Set master bedroom state
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
entity_id: light.bedside_light
|
entity_id: light.bedside_light
|
||||||
|
- service: light.turn_on
|
||||||
|
entity_id: light.bed_led
|
||||||
|
data:
|
||||||
|
brightness_pct: 100
|
||||||
- service: fan.turn_on
|
- service: fan.turn_on
|
||||||
entity_id: fan.philips_airpurifier
|
entity_id: fan.philips_airpurifier
|
||||||
- service: light.turn_off
|
- service: light.turn_off
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ script:
|
|||||||
routine_good_night:
|
routine_good_night:
|
||||||
alias: Routine · Going to sleep
|
alias: Routine · Going to sleep
|
||||||
sequence:
|
sequence:
|
||||||
|
- service: light.turn_on
|
||||||
|
entity_id: light.bed_led
|
||||||
|
data:
|
||||||
|
brightness_pct: 40
|
||||||
|
color_temp: 500
|
||||||
- service: fan.turn_on
|
- service: fan.turn_on
|
||||||
entity_id: fan.philips_airpurifier
|
entity_id: fan.philips_airpurifier
|
||||||
- service: media_player.media_stop
|
- service: media_player.media_stop
|
||||||
@@ -16,3 +21,6 @@ script:
|
|||||||
- service: script.say_discretely
|
- service: script.say_discretely
|
||||||
data:
|
data:
|
||||||
message: "Entering night mode. Good night!"
|
message: "Entering night mode. Good night!"
|
||||||
|
|
||||||
|
- service: light.turn_off
|
||||||
|
entity_id: light.bed_led
|
||||||
|
|||||||
Reference in New Issue
Block a user