mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-21 10:57:43 +00:00
Night mode override for Floorplan UI
This commit is contained in:
@@ -16,29 +16,34 @@ views:
|
|||||||
- type: picture-elements
|
- type: picture-elements
|
||||||
image: /local/images/floorplan/floorplan_night_transparent.png
|
image: /local/images/floorplan/floorplan_night_transparent.png
|
||||||
elements:
|
elements:
|
||||||
- type: image
|
- type: conditional
|
||||||
entity: sun.sun
|
conditions:
|
||||||
action: none
|
- entity: sun.sun
|
||||||
hold_action:
|
state: "above_horizon"
|
||||||
action: none
|
- entity: input_boolean.floorplan_night_mode
|
||||||
state_image:
|
state: "off"
|
||||||
above_horizon: /local/images/floorplan/floorplan_day.jpg
|
elements:
|
||||||
below_horizon: /local/images/floorplan/transparent.png
|
- type: image
|
||||||
style:
|
entity: sun.sun
|
||||||
height: 100%
|
action: none
|
||||||
left: 50%
|
hold_action:
|
||||||
top: 50%
|
action: none
|
||||||
width: 100%
|
image: /local/images/floorplan/floorplan_day.jpg
|
||||||
tap_action:
|
style:
|
||||||
action: none
|
height: 100%
|
||||||
|
left: 50%
|
||||||
|
top: 50%
|
||||||
|
width: 100%
|
||||||
|
tap_action:
|
||||||
|
action: none
|
||||||
|
|
||||||
# Lighting Overlays
|
# Lighting Overlays
|
||||||
|
|
||||||
# Living Room
|
# Living Room
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: sun.sun
|
- entity: binary_sensor.floorplan_night_mode
|
||||||
state: "below_horizon"
|
state: "on"
|
||||||
- entity: light.pc
|
- entity: light.pc
|
||||||
state: "on"
|
state: "on"
|
||||||
- entity: light.living_room_main_lights
|
- entity: light.living_room_main_lights
|
||||||
@@ -55,8 +60,8 @@ views:
|
|||||||
cursor: default
|
cursor: default
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: sun.sun
|
- entity: binary_sensor.floorplan_night_mode
|
||||||
state: "below_horizon"
|
state: "on"
|
||||||
- entity: light.pc
|
- entity: light.pc
|
||||||
state: "off"
|
state: "off"
|
||||||
- entity: light.living_room_main_lights
|
- entity: light.living_room_main_lights
|
||||||
@@ -73,8 +78,8 @@ views:
|
|||||||
cursor: default
|
cursor: default
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: sun.sun
|
- entity: binary_sensor.floorplan_night_mode
|
||||||
state: "below_horizon"
|
state: "on"
|
||||||
- entity: light.pc
|
- entity: light.pc
|
||||||
state: "on"
|
state: "on"
|
||||||
- entity: light.living_room_main_lights
|
- entity: light.living_room_main_lights
|
||||||
@@ -93,8 +98,8 @@ views:
|
|||||||
# Master Bedroom
|
# Master Bedroom
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: sun.sun
|
- entity: binary_sensor.floorplan_night_mode
|
||||||
state: "below_horizon"
|
state: "on"
|
||||||
- entity: light.bedside_light
|
- entity: light.bedside_light
|
||||||
state: "off"
|
state: "off"
|
||||||
- entity: light.master_bedroom_main_lights
|
- entity: light.master_bedroom_main_lights
|
||||||
@@ -111,8 +116,8 @@ views:
|
|||||||
cursor: default
|
cursor: default
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: sun.sun
|
- entity: binary_sensor.floorplan_night_mode
|
||||||
state: "below_horizon"
|
state: "on"
|
||||||
- entity: light.bedside_light
|
- entity: light.bedside_light
|
||||||
state: "on"
|
state: "on"
|
||||||
- entity: light.master_bedroom_main_lights
|
- entity: light.master_bedroom_main_lights
|
||||||
@@ -129,8 +134,8 @@ views:
|
|||||||
cursor: default
|
cursor: default
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: sun.sun
|
- entity: binary_sensor.floorplan_night_mode
|
||||||
state: "below_horizon"
|
state: "on"
|
||||||
- entity: light.master_bedroom_main_lights
|
- entity: light.master_bedroom_main_lights
|
||||||
state: "on"
|
state: "on"
|
||||||
- entity: light.bedside_light
|
- entity: light.bedside_light
|
||||||
@@ -148,8 +153,8 @@ views:
|
|||||||
|
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: sun.sun
|
- entity: binary_sensor.floorplan_night_mode
|
||||||
state: "below_horizon"
|
state: "on"
|
||||||
- entity: light.tuya_kitchen_main_lights
|
- entity: light.tuya_kitchen_main_lights
|
||||||
state: "on"
|
state: "on"
|
||||||
elements:
|
elements:
|
||||||
@@ -165,8 +170,8 @@ views:
|
|||||||
|
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: sun.sun
|
- entity: binary_sensor.floorplan_night_mode
|
||||||
state: "below_horizon"
|
state: "on"
|
||||||
- entity: light.tuya_hallway_entrance_lights
|
- entity: light.tuya_hallway_entrance_lights
|
||||||
state: "on"
|
state: "on"
|
||||||
- entity: light.tuya_hallway_main_lights
|
- entity: light.tuya_hallway_main_lights
|
||||||
@@ -184,8 +189,8 @@ views:
|
|||||||
|
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: sun.sun
|
- entity: binary_sensor.floorplan_night_mode
|
||||||
state: "below_horizon"
|
state: "on"
|
||||||
- entity: light.tuya_hallway_entrance_lights
|
- entity: light.tuya_hallway_entrance_lights
|
||||||
state: "off"
|
state: "off"
|
||||||
- entity: light.tuya_hallway_main_lights
|
- entity: light.tuya_hallway_main_lights
|
||||||
@@ -203,8 +208,8 @@ views:
|
|||||||
|
|
||||||
- type: conditional
|
- type: conditional
|
||||||
conditions:
|
conditions:
|
||||||
- entity: sun.sun
|
- entity: binary_sensor.floorplan_night_mode
|
||||||
state: "below_horizon"
|
state: "on"
|
||||||
- entity: light.tuya_hallway_entrance_lights
|
- entity: light.tuya_hallway_entrance_lights
|
||||||
state: "on"
|
state: "on"
|
||||||
- entity: light.tuya_hallway_main_lights
|
- entity: light.tuya_hallway_main_lights
|
||||||
@@ -358,3 +363,15 @@ views:
|
|||||||
background-color: "rgba(255, 255, 255, 0.6)"
|
background-color: "rgba(255, 255, 255, 0.6)"
|
||||||
font-size: 14px
|
font-size: 14px
|
||||||
font-weight: bold
|
font-weight: bold
|
||||||
|
|
||||||
|
|
||||||
|
# Dark mode override
|
||||||
|
- type: image
|
||||||
|
entity: input_boolean.floorplan_night_mode
|
||||||
|
tap_action:
|
||||||
|
action: toggle
|
||||||
|
image: /local/images/floorplan/transparent.png
|
||||||
|
style:
|
||||||
|
top: 1%
|
||||||
|
left: 1%
|
||||||
|
width: 10%
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
input_boolean:
|
||||||
|
floorplan_night_mode:
|
||||||
|
initial: off
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- platform: template
|
||||||
|
sensors:
|
||||||
|
floorplan_night_mode:
|
||||||
|
value_template: "{{ states('sun.sun') == 'below_horizon' or is_state('input_boolean.floorplan_night_mode', 'on') }}"
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: time_date
|
- platform: time_date
|
||||||
display_options:
|
display_options:
|
||||||
|
|||||||
Reference in New Issue
Block a user