Various improvements to automations and UI

This commit is contained in:
2021-05-18 18:59:10 +03:00
parent dbbda673f4
commit af18dffdb3
22 changed files with 338 additions and 192 deletions
@@ -0,0 +1,58 @@
blueprint:
name: Light on set temperature
domain: automation
input:
light:
day_temp:
default: 300
evening_temp:
default: 400
night_temp:
default: 500
trigger:
platform: state
entity_id: !input light
to: "on"
condition:
condition: state
entity_id: input_select.house_mode
state: "day"
action:
- choose:
- conditions:
- condition: sun
before: sunset
sequence:
- service: light.turn_on
entity_id: !input light
data:
color_temp: !input day_temp
- conditions:
condition: and
conditions:
- condition: sun
after: sunset
- condition: not
conditions:
- condition: sun
after: sunset
after_offset: "+03:00:00"
sequence:
- service: light.turn_on
entity_id: !input light
data:
color_temp: !input evening_temp
- conditions:
- condition: sun
after: sunset
after_offset: "+03:00:00"
sequence:
- service: light.turn_on
entity_id: !input light
data:
color_temp: !input night_temp
@@ -0,0 +1,23 @@
blueprint:
name: Light sun set temperature
domain: automation
input:
light:
temp:
after_offset:
default: "+00:00:00"
trigger:
platform: sun
event: sunset
offset: !input after_offset
condition:
- condition: state
entity_id: !input light
state: "on"
action:
- service: light.turn_on
entity_id: !input light
data:
color_temp: !input temp
+4 -3
View File
@@ -65,11 +65,12 @@ updater:
logger: logger:
default: warning default: warning
logs: logs:
homeassistant.components.scrape.sensor: fatal
homeassistant.components.waze_travel_time.sensor: error
homeassistant.components.shell_command: error
homeassistant.components.amcrest: error homeassistant.components.amcrest: error
homeassistant.components.camera: error
homeassistant.components.scrape.sensor: fatal
homeassistant.components.shell_command: error
homeassistant.components.switch.pihole_temp_disable: error homeassistant.components.switch.pihole_temp_disable: error
homeassistant.components.waze_travel_time.sensor: error
homeassistant.loader: error homeassistant.loader: error
zigpy.util: error zigpy.util: error
@@ -68,17 +68,33 @@ cards:
entities: entities:
- automation.lighting_turn_on_ceiling_lights_after_sunset - automation.lighting_turn_on_ceiling_lights_after_sunset
- automation.lighting_turn_off_all_lights_after_sunrise - automation.lighting_turn_off_all_lights_after_sunrise
# - type: divider
# - automation.lighting_temperature_adjust_based_on_time
- type: divider - type: divider
- automation.lighting_temperature_adjust_on_start - automation.lighting_living_room_temperature_adjust_on_start
- automation.lighting_temperature_adjust_based_on_time - automation.lighting_living_room_temperature_sunset
- automation.lighting_living_room_temperature_night
- type: divider
- automation.lighting_bedroom_door_open
- automation.lighting_bedroom_temperature_adjust_on_start
- automation.lighting_bedroom_temperature_sunset
- automation.lighting_bedroom_temperature_night
- type: divider - type: divider
- automation.lighting_kitchen_motion_on - automation.lighting_kitchen_motion_on
- automation.lighting_kitchen_motion_off - automation.lighting_kitchen_night_motion_off
- automation.lighting_kitchen_day_motion_off
- automation.lighting_kitchen_temperature_main_adjust_on_start
- automation.lighting_kitchen_temperature_secondary_adjust_on_start
- automation.lighting_kitchen_temperature_main_sunset
- automation.lighting_kitchen_temperature_secondary_sunset
- automation.lighting_kitchen_temperature_main_night
- automation.lighting_kitchen_temperature_secondary_night
- type: divider - type: divider
- automation.lighting_hallway_motion_on - automation.lighting_hallway_motion_on
- automation.lighting_hallway_motion_off - automation.lighting_hallway_motion_off
- type: divider - type: divider
- automation.lighting_sync_tasmota_states_on_start_up - automation.lighting_sync_tasmota_states_on_start_up
- automation.lighting_sync_zigbee_states_on_start_up
- type: divider - type: divider
- automation.trust_remote_dimming - automation.trust_remote_dimming
- automation.trust_remote_turn_on - automation.trust_remote_turn_on
@@ -151,7 +151,7 @@ cards:
entity: climate.kitchen_radiator_mode entity: climate.kitchen_radiator_mode
name: "Kitchen" name: "Kitchen"
- type: custom:button-card - type: custom:button-card
template: [small, with_state_background, cover] template: [with_state_background, cover, small]
entity: cover.living_room entity: cover.living_room
name: LR Cover name: LR Cover
tap_action: tap_action:
@@ -7,10 +7,9 @@ cards:
- type: custom:button-card - type: custom:button-card
template: [hallway_dashboard_mode] template: [hallway_dashboard_mode]
- type: custom:weather-card - type: custom:weather-card
current: true
details: true
entity: weather.dark_sky entity: weather.dark_sky
forecast: true - type: custom:sun-card
darkMode: true
- type: vertical-stack - type: vertical-stack
cards: cards:
- type: grid - type: grid
@@ -18,7 +17,7 @@ cards:
columns: 4 columns: 4
cards: cards:
- type: custom:button-card - type: custom:button-card
template: [small, with_state_background, cover] template: [with_state_background, cover, small]
entity: cover.living_room entity: cover.living_room
name: LR Cover name: LR Cover
tap_action: tap_action:
@@ -55,7 +55,11 @@
template: brita_water template: brita_water
- type: custom:button-card - type: custom:button-card
template: default template: default
entity: media_player.nvidia_shield entity: vacuum.vacuum
name: Vacuum
- type: custom:button-card
template: default
entity: media_player.living_room_tv
name: TV name: TV
icon: mdi:television icon: mdi:television
tap_action: tap_action:
@@ -76,12 +80,6 @@
styles: *on_styles styles: *on_styles
- value: 'idle' - value: 'idle'
styles: *on_styles styles: *on_styles
- type: custom:button-card
template: [default, with_state_indicator]
entity: switch.titanium
variables:
state_indicator_id: automation.titanium_turn_off_when_idle
- type: custom:decluttering-card - type: custom:decluttering-card
template: media_with_controls template: media_with_controls
variables: variables:
@@ -65,6 +65,20 @@
scene_color_1: rgb(254, 255, 209) scene_color_1: rgb(254, 255, 209)
- type: horizontal-stack - type: horizontal-stack
title: Devices title: Devices
cards:
- type: custom:button-card
template: [default, cover]
entity: cover.living_room
name: Cover
tap_action:
action: call-service
service: script.toggle_living_room_cover
- type: custom:button-card
template: radiator_button
entity: climate.living_room_radiator_mode
- type: custom:button-card
template: ac_button
- type: horizontal-stack
cards: cards:
- type: custom:button-card - type: custom:button-card
template: default template: default
@@ -99,13 +113,6 @@
entity: binary_sensor.pi_hole_enabled entity: binary_sensor.pi_hole_enabled
name: Pi-Hole name: Pi-Hole
icon: mdi:pi-hole icon: mdi:pi-hole
- type: horizontal-stack
cards:
- type: custom:button-card
template: radiator_button
entity: climate.living_room_radiator_mode
- type: custom:button-card
template: ac_button
- type: custom:button-card - type: custom:button-card
template: [regular, progress] template: [regular, progress]
entity: sensor.desk_outlet_power entity: sensor.desk_outlet_power
@@ -136,13 +143,6 @@
cards: cards:
- type: horizontal-stack - type: horizontal-stack
cards: cards:
- type: custom:button-card
template: [default, cover]
entity: cover.living_room
name: Cover
tap_action:
action: call-service
service: script.toggle_living_room_cover
- type: custom:button-card - type: custom:button-card
template: default template: default
entity: binary_sensor.living_room_right_window entity: binary_sensor.living_room_right_window
@@ -90,6 +90,13 @@
cards: cards:
- type: horizontal-stack - type: horizontal-stack
cards: cards:
- type: custom:button-card
template: [default, cover]
entity: cover.living_room
name: LR Cover
tap_action:
action: call-service
service: script.toggle_living_room_cover
- type: custom:button-card - type: custom:button-card
template: regular template: regular
entity: media_player.living_room_tv entity: media_player.living_room_tv
@@ -224,13 +231,6 @@
cards: cards:
- type: horizontal-stack - type: horizontal-stack
cards: cards:
- type: custom:button-card
template: [default, cover]
entity: cover.living_room
name: LR Cover
tap_action:
action: call-service
service: script.toggle_living_room_cover
- type: custom:button-card - type: custom:button-card
template: default template: default
entity: binary_sensor.multisensor_motion entity: binary_sensor.multisensor_motion
@@ -1,43 +0,0 @@
- type: custom:mod-card
style:
layout-card:
$:
.: |
#columns {
padding: 0 10px;
}
#columns .column {
padding: 0 10px;
}
card:
type: custom:layout-card
layout: horizontal
max_columns: 2
cards:
- type: custom:vacuum-card
entity: vacuum.vacuum
stats:
default:
- attribute: filter_left
unit: hours
subtitle: Filter
- attribute: side_brush_left
unit: hours
subtitle: Side brush
- attribute: main_brush_left
unit: hours
subtitle: Main brush
- attribute: sensor_dirty_left
unit: hours
subtitle: Sensors
cleaning:
- attribute: cleaned_area
unit: m2
subtitle: Cleaning area
- attribute: cleaning_time
unit: minutes
subtitle: Cleaning time
- type: custom:xiaomi-vacuum-map-card
entity: vacuum.vacuum
camera_calibration: true
map_camera: camera.xiaomi_cloud_map_extractor
+3
View File
@@ -58,6 +58,9 @@
url: /hacsfiles/lovelace-xiaomi-vacuum-map-card/xiaomi-vacuum-map-card.js url: /hacsfiles/lovelace-xiaomi-vacuum-map-card/xiaomi-vacuum-map-card.js
- type: module - type: module
url: /hacsfiles/zigbee2mqtt-networkmap/zigbee2mqtt-networkmap.js url: /hacsfiles/zigbee2mqtt-networkmap/zigbee2mqtt-networkmap.js
- type: module
url: /hacsfiles/home-assistant-sun-card/home-assistant-sun-card.js
- type: module - type: module
@@ -34,7 +34,6 @@ automation:
trigger: trigger:
platform: sun platform: sun
event: sunset event: sunset
offset: "+01:00:00"
action: action:
- service: cover.close_cover - service: cover.close_cover
entity_id: cover.living_room entity_id: cover.living_room
@@ -1,10 +0,0 @@
script:
dashboards_light_down:
alias: "Dashboards · Light down"
sequence:
- service: light.turn_on
entity_id:
- light.browser_kitchen
- light.browser_hallway
data:
brightness_pct: 1
@@ -89,3 +89,38 @@ scene:
state: "on" state: "on"
color_temp: 500 color_temp: 500
brightness: 255 brightness: 255
automation:
- alias: Lighting · Bedroom · Door open
trigger:
platform: state
entity_id: binary_sensor.bedroom_door
to: "on"
condition:
condition: sun
after: sunset
after_offset: "-02:00:00"
action:
- service: light.turn_on
entity_id: light.master_bedroom_main
- alias: Lighting · Bedroom · Temperature · Adjust on start
use_blueprint:
path: light_on_set_temperature.yaml
input:
light: light.master_bedroom_main
- alias: Lighting · Bedroom · Temperature · Sunset
use_blueprint:
path: light_sun_set_temperature.yaml
input:
light: light.master_bedroom_main
temp: 400
- alias: Lighting · Bedroom · Temperature · Night
use_blueprint:
path: light_sun_set_temperature.yaml
input:
light: light.master_bedroom_main
temp: 500
after_offset: "+03:00:00"
@@ -10,7 +10,7 @@ automation:
state: "on" state: "on"
action: action:
- choose: - choose:
# Day Mode # Turn on in Day Mode
- conditions: - conditions:
- condition: state - condition: state
entity_id: input_select.house_mode entity_id: input_select.house_mode
@@ -22,7 +22,7 @@ automation:
- light.browser_hallway - light.browser_hallway
data: data:
brightness_pct: 100 brightness_pct: 100
# Night Mode # Turn off in Night Mode
default: default:
- service: light.turn_on - service: light.turn_on
entity_id: entity_id:
@@ -39,7 +39,7 @@ automation:
to: "off" to: "off"
action: action:
- choose: - choose:
# Day Mode # Turn off in Day Mode
- conditions: - conditions:
condition: state condition: state
entity_id: input_select.house_mode entity_id: input_select.house_mode
@@ -51,7 +51,7 @@ automation:
entity_id: light.browser_hallway entity_id: light.browser_hallway
data: data:
brightness_pct: 1 brightness_pct: 1
# Night Mode # Turn off in Night Mode
default: default:
- service: light.turn_off - service: light.turn_off
entity_id: entity_id:
@@ -10,7 +10,7 @@ automation:
state: "on" state: "on"
action: action:
- choose: - choose:
# Day Mode # Turn on in Day Mode
- conditions: - conditions:
- condition: state - condition: state
entity_id: input_select.house_mode entity_id: input_select.house_mode
@@ -32,7 +32,7 @@ automation:
entity_id: light.kitchen entity_id: light.kitchen
data: data:
brightness_pct: 100 brightness_pct: 100
# Night Mode # Turn on in Night Mode
default: default:
- service: light.turn_on - service: light.turn_on
entity_id: entity_id:
@@ -42,29 +42,21 @@ automation:
data: data:
brightness_pct: 1 brightness_pct: 1
- alias: Lighting · Kitchen · Motion off - alias: Lighting · Kitchen · Night · Motion off
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.kitchen_motion_occupancy entity_id: binary_sensor.kitchen_motion_occupancy
to: "off" to: "off"
for: for:
minutes: 30 minutes: 5
action: condition:
- choose: condition: not
# Day Mode conditions:
- conditions:
- condition: state - condition: state
entity_id: input_select.house_mode entity_id: input_select.house_mode
state: 'day' state: 'day'
sequence: action:
- service: light.turn_off # Turn off in Night Mode
entity_id: light.kitchen
- service: light.turn_on
entity_id: light.browser_kitchen
data:
brightness_pct: 1
# Night Mode
default:
- service: light.turn_on - service: light.turn_on
entity_id: entity_id:
- light.ledvance_1 - light.ledvance_1
@@ -79,3 +71,64 @@ automation:
entity_id: light.browser_kitchen entity_id: light.browser_kitchen
data: data:
brightness_pct: 1 brightness_pct: 1
- alias: Lighting · Kitchen · Day · Motion off
trigger:
platform: state
entity_id: binary_sensor.kitchen_motion_occupancy
to: "off"
for:
minutes: 15
condition:
condition: state
entity_id: input_select.house_mode
state: 'day'
action:
# Turn off in Day Mode
- service: light.turn_off
entity_id: light.kitchen
- service: light.turn_on
entity_id: light.browser_kitchen
data:
brightness_pct: 1
- alias: Lighting · Kitchen · Temperature · Main · Adjust on start
use_blueprint:
path: light_on_set_temperature.yaml
input:
light: light.kitchen_main
- alias: Lighting · Kitchen · Temperature · Secondary · Adjust on start
use_blueprint:
path: light_on_set_temperature.yaml
input:
light: light.kitchen_secondary
- alias: Lighting · Kitchen · Temperature · Main · Sunset
use_blueprint:
path: light_sun_set_temperature.yaml
input:
light: light.kitchen_main
temp: 400
- alias: Lighting · Kitchen · Temperature · Secondary · Sunset
use_blueprint:
path: light_sun_set_temperature.yaml
input:
light: light.kitchen_secondary
temp: 400
- alias: Lighting · Kitchen · Temperature · Main · Night
use_blueprint:
path: light_sun_set_temperature.yaml
input:
light: light.kitchen_main
temp: 500
after_offset: "+03:00:00"
- alias: Lighting · Kitchen · Temperature · Secondary · Night
use_blueprint:
path: light_sun_set_temperature.yaml
input:
light: light.kitchen_secondary
temp: 500
@@ -21,3 +21,25 @@ scene:
state: "on" state: "on"
color_temp: 284 color_temp: 284
brightness_pct: 80 brightness_pct: 80
automation:
- alias: Lighting · Living Room · Temperature · Adjust on start
use_blueprint:
path: light_on_set_temperature.yaml
input:
light: light.living_room_main
- alias: Lighting · Living Room · Temperature · Sunset
use_blueprint:
path: light_sun_set_temperature.yaml
input:
light: light.living_room_main
temp: 400
- alias: Lighting · Living Room · Temperature · Night
use_blueprint:
path: light_sun_set_temperature.yaml
input:
light: light.living_room_main
temp: 500
after_offset: "+03:00:00"
@@ -1,42 +1,21 @@
automation: # automation:
- alias: Lighting · Temperature · Adjust on start # - alias: Lighting · Temperature · Adjust based on time
mode: parallel # trigger:
trigger: # platform: sun
platform: state # event: sunset
entity_id: # action:
- light.kitchen_main # - service: light.turn_on
- light.kitchen_secondary # data_template:
- light.master_bedroom_main # entity_id:
- light.living_room_main # - light.master_bedroom_main
to: "on" # - light.living_room_main
condition: # color_temp: "{{ 400 if is_state('sun.sun', 'above_horizon') else 500 }}"
- condition: state # - service: logbook.log
entity_id: input_select.house_mode # data_template:
state: 'day' # name: "💡 Lighting Module · "
action: # message: >-
- service: light.turn_on # Adjusting temperature - sun changed from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}
data_template: # domain: light
entity_id: "{{ trigger.entity_id }}"
color_temp: "{{ 400 if is_state('sun.sun', 'above_horizon') else 500 }}"
- alias: Lighting · Temperature · Adjust based on time
trigger:
platform: sun
event: sunset
action:
- service: light.turn_on
data_template:
entity_id:
- light.master_bedroom_main
- light.living_room_main
- light.kitchen_secondary
color_temp: "{{ 400 if is_state('sun.sun', 'above_horizon') else 500 }}"
- service: logbook.log
data_template:
name: "💡 Lighting Module · "
message: >-
Adjusting temperature - sun changed from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}
domain: light
# switch: # switch:
# - platform: flux # - platform: flux
+10 -4
View File
@@ -2,17 +2,22 @@ script:
routine_bedtime: routine_bedtime:
alias: Routine · Bedtime alias: Routine · Bedtime
sequence: sequence:
- service: script.say_discretely
data:
message: "Entering bed time."
# Set master bedroom state # Set master bedroom state
- service: fan.turn_on - service: fan.turn_on
entity_id: fan.philips_airpurifier entity_id: fan.philips_airpurifier
- service: light.turn_on
entity_id: light.bedside
- service: script.bed_led_on
- service: input_select.select_option - service: input_select.select_option
entity_id: input_select.purifier_preset_mode entity_id: input_select.purifier_preset_mode
data: data:
option: "sleep" option: "sleep"
- service: light.turn_on
entity_id: light.bedside
- service: script.bed_led_on
- service: light.turn_off - service: light.turn_off
entity_id: light.master_bedroom_main entity_id: light.master_bedroom_main
- service: sonos.unjoin - service: sonos.unjoin
@@ -41,5 +46,6 @@ script:
- light.kitchen_secondary - light.kitchen_secondary
- light.hallway_main - light.hallway_main
- light.hallway_entrance - light.hallway_entrance
- light.browser_kitchen
- light.browser_hallway
- switch.titanium - switch.titanium
- service: script.dashboards_light_down
+16 -7
View File
@@ -8,9 +8,16 @@ script:
routine_coming_home: routine_coming_home:
alias: Routine · Coming home alias: Routine · Coming home
sequence: sequence:
- service: input_select.select_option
entity_id: input_select.hallway_dashboard_mode
data:
option: "Coming Home"
# Lights
- service: light.turn_on - service: light.turn_on
entity_id: entity_id:
- light.hallway_entrance - light.hallway_entrance
- light.hallway_main
- light.browser_kitchen - light.browser_kitchen
- light.browser_hallway - light.browser_hallway
- light.living_room_ambient - light.living_room_ambient
@@ -18,22 +25,19 @@ script:
data: data:
brightness_pct: 100 brightness_pct: 100
- service: script.bed_led_on - service: script.bed_led_on
# Cameras
- service: switch.turn_on - service: switch.turn_on
entity_id: switch.mercury_home_mode entity_id: switch.mercury_home_mode
- service: script.routine_coming_home_during_daytime - service: script.routine_coming_home_during_daytime
- service: script.routine_coming_home_after_sunset - service: script.routine_coming_home_after_sunset
- service: input_select.select_option
entity_id: input_select.hallway_dashboard_mode
data:
option: "Coming Home"
- service: script.toshiba_ac_on_cool_if_hot - service: script.toshiba_ac_on_cool_if_hot
- service: script.sonos_join_bedroom - service: script.sonos_join_bedroom
- service: script.routine_coming_home_welcome_home - service: script.routine_coming_home_welcome_home
- service: script.turn_on_all_radiators - service: script.turn_on_all_radiators
routine_coming_home_during_daytime: routine_coming_home_during_daytime:
alias: Routine · Coming home · During daytime alias: Routine · Coming home · During daytime
sequence: sequence:
@@ -59,6 +63,10 @@ script:
after_offset: "-01:00:00" after_offset: "-01:00:00"
- condition: sun - condition: sun
before: sunrise before: sunrise
- service: notify.telegram
data:
title: "🏠 *Presence Module · Coming Home*"
message: "You're coming home after sunset! (this is for debug ;))"
- service: light.turn_on - service: light.turn_on
entity_id: light.on_after_dark entity_id: light.on_after_dark
data: data:
@@ -129,3 +137,4 @@ automation:
] | random ] | random
}} }}
- service: script.turn_on_all_radiators - service: script.turn_on_all_radiators
- service: script.toshiba_ac_on_cool_if_hot
+10 -7
View File
@@ -10,27 +10,30 @@ script:
data: data:
message: "Entering night mode. Good night!" message: "Entering night mode. Good night!"
# Prepare Bed LED brightness to be turned on during night time
- service: script.bed_led_on - service: script.bed_led_on
data: data:
brightness_pct: 40 brightness_pct: 40
- service: light.turn_on
entity_id: light.bed_led
data:
brightness_pct: 40
- service: fan.turn_on - service: fan.turn_on
entity_id: fan.philips_airpurifier entity_id: fan.philips_airpurifier
- service: input_select.select_option - service: input_select.select_option
entity_id: input_select.purifier_preset_mode entity_id: input_select.purifier_preset_mode
data: data:
option: "sleep" option: "sleep"
# Turn off everything else
- service: homeassistant.turn_off - service: homeassistant.turn_off
entity_id: entity_id:
- light.living_room - light.living_room
- light.master_bedroom - light.master_bedroom
- light.kitchen - light.kitchen_main
- light.hallway - light.kitchen_secondary
- light.hallway_main
- light.hallway_entrance
- light.browser_kitchen
- light.browser_hallway
- media_player.nvidia_shield - media_player.nvidia_shield
- media_player.living_room_tv - media_player.living_room_tv
- switch.titanium - switch.titanium
- group.all_radiators - group.all_radiators
- service: script.dashboards_light_down
-5
View File
@@ -34,11 +34,6 @@ views:
icon: "mdi:door-closed" icon: "mdi:door-closed"
panel: true panel: true
cards: !include lovelace/home_dashboard/hallway_dashboard.yaml cards: !include lovelace/home_dashboard/hallway_dashboard.yaml
- title: Vacuum
path: vacuum
icon: "mdi:robot-vacuum"
panel: true
cards: !include lovelace/home_dashboard/vacuum_dashboard.yaml
- title: Cameras - title: Cameras
path: cameras path: cameras
icon: "mdi:webcam" icon: "mdi:webcam"