mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-15 09:12:57 +00:00
Add bed_led light
This commit is contained in:
@@ -11,8 +11,12 @@ views:
|
||||
panel: true
|
||||
icon: mdi:floor-plan
|
||||
cards:
|
||||
- type: picture-elements
|
||||
image: /local/images/floorplan/floorplan_night_transparent.png
|
||||
style: |
|
||||
height: 100%
|
||||
elements: !include_dir_merge_list lovelace/floorplan-dashboard/picture_elements
|
||||
- type: 'custom:config-template-card'
|
||||
entities:
|
||||
- light.bed_led
|
||||
card:
|
||||
type: picture-elements
|
||||
image: /local/images/floorplan/floorplan_night_transparent.png
|
||||
style: |
|
||||
height: 100%
|
||||
elements: !include_dir_merge_list lovelace/floorplan-dashboard/picture_elements
|
||||
|
||||
@@ -44,14 +44,24 @@ views:
|
||||
template: small
|
||||
entity: light.living_room_main_lights
|
||||
name: Living room
|
||||
- type: custom:button-card
|
||||
template: small
|
||||
entity: light.master_bedroom_main_lights
|
||||
name: M. Bedroom
|
||||
- type: custom:button-card
|
||||
template: small
|
||||
entity: light.tuya_hallway_main_lights
|
||||
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
|
||||
cards:
|
||||
- type: custom:button-card
|
||||
@@ -61,10 +71,6 @@ views:
|
||||
- type: custom:button-card
|
||||
template: small
|
||||
entity: light.pc
|
||||
- type: custom:button-card
|
||||
template: small
|
||||
entity: light.bedside_light
|
||||
name: Bedside
|
||||
- type: custom:button-card
|
||||
template: small
|
||||
entity: light.tuya_hallway_entrance_lights
|
||||
|
||||
@@ -26,6 +26,13 @@
|
||||
- top: 11.7%
|
||||
- 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
|
||||
template: floorplan_state_icon
|
||||
variables:
|
||||
|
||||
@@ -167,3 +167,21 @@
|
||||
background-color: rgba(255,0,0,0.5)
|
||||
color: transparent
|
||||
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
|
||||
entity: light.living_room_main_lights
|
||||
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
|
||||
template: small
|
||||
entity: light.master_bedroom_main_lights
|
||||
name: "M. Bedroom"
|
||||
- type: custom:button-card
|
||||
template: small
|
||||
entity: light.tuya_hallway_main_lights
|
||||
name: Hallway
|
||||
entity: light.bedside_light
|
||||
name: Bedside
|
||||
- type: custom:button-card
|
||||
template: small
|
||||
entity: light.bed_led
|
||||
name: Bed
|
||||
- type: horizontal-stack
|
||||
cards:
|
||||
- type: custom:button-card
|
||||
@@ -52,10 +62,6 @@ cards:
|
||||
- type: custom:button-card
|
||||
template: small
|
||||
entity: light.pc
|
||||
- type: custom:button-card
|
||||
template: small
|
||||
entity: light.bedside_light
|
||||
name: Bedside
|
||||
- type: custom:button-card
|
||||
template: small
|
||||
entity: light.tuya_hallway_entrance_lights
|
||||
|
||||
@@ -72,6 +72,7 @@ cards:
|
||||
- fade: switch.light_le_4_fade
|
||||
- wifi: sensor.light_le_4_wifi
|
||||
- light.bedside_light
|
||||
- light.bed_led
|
||||
|
||||
- type: custom:decluttering-card
|
||||
template: sonos_media_player
|
||||
|
||||
@@ -117,8 +117,7 @@ cards:
|
||||
- automation.house_mode_set_to_day
|
||||
- automation.house_mode_set_to_bed
|
||||
- automation.house_mode_set_to_night
|
||||
- automation.house_mode_set_to_night_on_bedside_switch_double_click
|
||||
- automation.house_mode_set_to_bed_on_bedside_switch_hold
|
||||
- automation.house_mode_toggle_on_bedside_switch_double_click
|
||||
- automation.alarm_wake_up
|
||||
- automation.alarm_set_time
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@ group:
|
||||
- automation.house_mode_set_to_night
|
||||
- automation.house_mode_set_to_bed
|
||||
- automation.house_mode_set_to_day
|
||||
- automation.house_mode_set_to_night_on_bedside_switch_double_click
|
||||
- automation.house_mode_set_to_bed_on_bedside_switch_hold
|
||||
- automation.house_mode_toggle_on_bedside_switch_double_click
|
||||
- automation.alarm_wake_up
|
||||
- automation.music_play_pause_on_magic_cube_knock
|
||||
- automation.music_volume_down_on_magic_cube_rotate_left
|
||||
|
||||
@@ -63,7 +63,7 @@ automation:
|
||||
action:
|
||||
- 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:
|
||||
- platform: event
|
||||
event_type: zha_event
|
||||
@@ -76,26 +76,14 @@ automation:
|
||||
data_template:
|
||||
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
|
||||
{% else %}
|
||||
day
|
||||
{% 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
|
||||
trigger:
|
||||
platform: template
|
||||
|
||||
@@ -26,6 +26,7 @@ light:
|
||||
entities:
|
||||
- light.master_bedroom_main_lights
|
||||
- light.bedside_light
|
||||
- light.bed_led
|
||||
|
||||
- platform: group
|
||||
name: Kitchen main lights
|
||||
|
||||
@@ -35,8 +35,17 @@ automation:
|
||||
|
||||
{% if is_state('input_select.house_mode', 'day') %}
|
||||
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 %}
|
||||
light.bedside_light
|
||||
100
|
||||
{% endif %}
|
||||
|
||||
- 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_8
|
||||
data:
|
||||
brightness_pct: 13
|
||||
brightness_pct: 13 # this is the lowest it'll go ¯\_(ツ)_/¯
|
||||
- delay: 00:10:00
|
||||
# reset brightness and turn off
|
||||
- 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
|
||||
- service: light.turn_on
|
||||
entity_id: light.bedside_light
|
||||
- service: light.turn_on
|
||||
entity_id: light.bed_led
|
||||
data:
|
||||
brightness_pct: 100
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: light.turn_off
|
||||
|
||||
@@ -2,6 +2,11 @@ script:
|
||||
routine_good_night:
|
||||
alias: Routine · Going to sleep
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
entity_id: light.bed_led
|
||||
data:
|
||||
brightness_pct: 40
|
||||
color_temp: 500
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: media_player.media_stop
|
||||
@@ -16,3 +21,6 @@ script:
|
||||
- service: script.say_discretely
|
||||
data:
|
||||
message: "Entering night mode. Good night!"
|
||||
|
||||
- service: light.turn_off
|
||||
entity_id: light.bed_led
|
||||
|
||||
Reference in New Issue
Block a user