This commit is contained in:
2020-05-06 04:32:08 +03:00
parent 94581b73b9
commit 9217caba9e
22 changed files with 94 additions and 48 deletions

22
.yamllint.yaml Normal file
View File

@@ -0,0 +1,22 @@
extends: default
ignore: |
config/templates/partials/
config/secrets.yaml
rules:
document-start:
present: false
line-length:
max: 120
level: warning
truthy:
allowed-values:
- 'true'
- 'false'
- 'yes'
- 'no'
- 'on'
- 'off'

View File

@@ -47,9 +47,18 @@ progress:
: temp < variables.high_value
? variables.normal_color
: variables.high_color;
const percent = (temp - variables.min_value)/(variables.max_value - variables.min_value) * 100;
const gradient = 100 - percent;
const degrees = variables.degrees + "deg";
return 'linear-gradient('+ degrees +', var(--paper-card-background-color) 0%, var(--paper-card-background-color)' + gradient + '%, ' + color + ' ' + gradient + '%)'
const min = variables.min_value;
const max = variables.max_value;
const percent = Math.round((temp - min)/(max - min) * 100);
const gradientPercent = 100 - percent;
const gradient = [
`${variables.degrees}deg`,
'var(--paper-card-background-color) 0%',
`var(--paper-card-background-color) ${gradientPercent}%`,
`${color} ${gradientPercent}%`
]
return `linear-gradient(${gradient.join(',')})`;
]]]

View File

@@ -12,4 +12,3 @@ small:
- height: 60px
name:
- height: 30px

View File

@@ -1,9 +1,9 @@
with_state_indicator:
variables:
state_indicator_id: # defaults to entity_id
state_indicator_id: # defaults to entity_id
state_indicator_size: 2px
state_indicator_off_size: # If set, used when the state_indicator entity is off
state_indicator_off_size: # If set, used when the state_indicator entity is off
# state indicators are used when the entity's state is not 'on'
state_indicator_on_color: white
@@ -13,7 +13,7 @@ with_state_indicator:
state_on_indicator_on_color: white
state_on_indicator_off_color: transparent
triggers_update: all # unfortunately a template doesn't seem to work here :/
triggers_update: all # unfortunately a template doesn't seem to work here :/
double_tap_action:
action: call-service
service: homeassistant.toggle

View File

@@ -8,4 +8,3 @@ xs:
- font-size: 12px
name:
- height: 24px

View File

@@ -16,7 +16,15 @@ brita_water_card:
[[[
const remaining = states['input_number.brita_remaining_liters'].state;
const percent = 100 - (remaining / 150 * 100);
return 'linear-gradient(180deg, var(--paper-card-background-color) 0%, var(--paper-card-background-color)' + percent + '%, var(--primary-color) ' + percent + '%)'
const gradient = [
'180deg',
'var(--paper-card-background-color) 0%',
`var(--paper-card-background-color) ${percent}%`,
`var(--primary-color) ${percent}%`
]
return `linear-gradient(${gradient.join(',')})`;
]]]
- color: white
name:

View File

@@ -265,4 +265,3 @@ bulsatcom_remote_card:
top: 83.5%
left: 81.5%
border-radius: 40%

View File

@@ -19,7 +19,7 @@
tap_action:
action: none
# Living Room
# Living Room
- type: conditional
conditions:
- entity: binary_sensor.floorplan_night_mode

View File

@@ -1,10 +1,11 @@
- type: conditional
conditions:
- entity: input_boolean.floorplan_show_all
state: 'on'
elements:
# Living room ───────────────────────────────────────────────────────────────────────────
# Living room ───────────────────────────────────────────────────────────────────────────
# Titanium
- type: custom:decluttering-card
template: floorplan_state_icon
@@ -55,7 +56,7 @@
- left: 48%
- icon: mdi:video
# Master Bedroom ────────────────────────────────────────────────────────────────────────
# Master Bedroom ────────────────────────────────────────────────────────────────────────
# Puifier
- type: custom:decluttering-card
@@ -76,7 +77,7 @@
- tap_action:
action: more-info
# Temperature
# Temperature
- type: state-label
entity: sensor.bedroom_weather_temperature
style:
@@ -90,7 +91,7 @@
font-weight: bold
line-height: 8px
# Kitchen ────────────────────────────────────────────────────────────────────────
# Kitchen ────────────────────────────────────────────────────────────────────────
# Sonos
- type: custom:decluttering-card
@@ -113,7 +114,7 @@
- tap_action:
action: more-info
# Bathroom ────────────────────────────────────────────────────────────────────────
# Bathroom ────────────────────────────────────────────────────────────────────────
# Sonos
- type: custom:decluttering-card
@@ -126,7 +127,7 @@
- tap_action:
action: more-info
# Hallway ────────────────────────────────────────────────────────────────────────
# Hallway ────────────────────────────────────────────────────────────────────────
# Motion
- type: custom:decluttering-card

View File

@@ -52,4 +52,3 @@
min_value: 0
max_value: 1000
normal_value: 1000

View File

@@ -202,4 +202,3 @@
- progress
entity: sensor.multisensor_6_ultraviolet
name: Multi UV

View File

@@ -146,14 +146,18 @@
- default
- with_state_indicator
entity: input_boolean.alarm_enabled
state_display: "[[[return states['input_datetime.alarm_time'].state.split(':').slice(0, -1).join(':'); ]]]"
state_display: >-
[[[
const time = states['input_datetime.alarm_time'].state;
return time.split(':').slice(0, -1).join(':');
]]]
show_state: true
show_name: false
styles:
icon:
- transform: translateY(-8px) # adjusted for state indicator size
- transform: translateY(-8px) # adjusted for state indicator size
state:
- transform: translateY(-13px) # adjusted for state indicator size
- transform: translateY(-13px) # adjusted for state indicator size
variables:
state_indicator_id: automation.alarm_set_time
- type: custom:button-card
@@ -335,4 +339,3 @@
variables:
- player: media_player.bathroom
- name: Bathroom

View File

@@ -47,14 +47,18 @@
- default
- with_state_indicator
entity: input_boolean.alarm_enabled
state_display: "[[[return states['input_datetime.alarm_time'].state.split(':').slice(0, -1).join(':'); ]]]"
state_display: >-
[[[
const time = states['input_datetime.alarm_time'].state;
return time.split(':').slice(0, -1).join(':');
]]]
show_state: true
show_name: false
styles:
icon:
- transform: translateY(-8px) # adjusted for state indicator size
- transform: translateY(-8px) # adjusted for state indicator size
state:
- transform: translateY(-13px) # adjusted for state indicator size
- transform: translateY(-13px) # adjusted for state indicator size
variables:
state_indicator_id: automation.alarm_set_time
- type: custom:button-card
@@ -160,4 +164,3 @@
name: Hallway
variables:
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on

View File

@@ -20,10 +20,15 @@ binary_sensor:
brita_should_change_filter:
friendly_name: Should change Brita filter
device_class: problem
value_template: >
value_template: >-
{% set liters_check = states('input_number.brita_remaining_liters')|int < 3 %}
{% set next_change = states('input_datetime.brita_next_change') %}
{{ states('input_number.brita_remaining_liters') | int < 3 or (as_timestamp(next_change) - as_timestamp(now())) / (3600*24) | round(0) < 3 }}
{% set time_delta = (as_timestamp(next_change) - as_timestamp(now())) %}
{% set date_check = time_delta / (3600*24) | round(0) < 3 %}
{{ liters_check or date_check }}
script:
brita_pour_water:

View File

@@ -104,4 +104,3 @@ automation:
action:
- service: switch.toggle
entity_id: switch.titanium

View File

@@ -60,4 +60,3 @@ automation:
action:
- service: input_select.select_next
entity_id: input_select.house_mode

View File

@@ -65,7 +65,7 @@ automation:
- light.light_le_12
- light.browser_kitchen
data:
brightness_pct: 13 # this is the lowest LE will go ¯\_(ツ)_/¯
brightness_pct: 13 # this is the lowest LE will go ¯\_(ツ)_/¯
- alias: Lighting · Kitchen · Night mode · Motion · Turn lights off
trigger:

View File

@@ -69,4 +69,3 @@ automation:
{% else %}
100
{% endif %}

View File

@@ -20,4 +20,3 @@ script:
entity_id: media_player.master_bedroom
data_template:
source: "{{ playlist | default('Evening Chill') }}"

View File

@@ -21,7 +21,7 @@ shell_command:
script:
youtube_play_file:
alias: Youtube · Play file
alias: Youtube · Play file
sequence:
- service: script.sonos_join_bedroom
- service: media_player.play_media
@@ -65,7 +65,9 @@ script:
- service: media_player.play_media
entity_id: media_player.master_bedroom
data_template:
media_content_id: "{{ states('sensor.sarah_url') }}/local/audio/youtube/{{ states('input_text.youtube_download_name') }}.mp3"
media_content_id: >-
{% set name = states('input_text.youtube_download_name') %}
{{ states('sensor.sarah_url') }}/local/audio/youtube/{{ name }}.mp3
media_content_type: "music"
- service: input_text.set_value

View File

@@ -64,7 +64,7 @@ script:
{% endif %}
{% endif %}
data_template:
title: "{{ title | default('💬 *Speech Module*') }}" # For telegram only
title: "{{ title | default('💬 *Speech Module*') }}" # For telegram only
message: "{{ message }}"
sonos_blast:

View File

@@ -7,7 +7,9 @@ binary_sensor:
- platform: template
sensors:
floorplan_night_mode:
value_template: "{{ states('sun.sun') == 'below_horizon' or is_state('input_boolean.floorplan_night_mode', 'on') }}"
value_template: >-
{{ states('sun.sun') == 'below_horizon'
or is_state('input_boolean.floorplan_night_mode', 'on') }}
sensor:
- platform: command_line
@@ -54,14 +56,14 @@ automation:
- service: script.say
data:
message: "Hey! I was out for a bit, but I'm back online!"
# - service: notify.telegram
# data:
# title: "⚙️ *System Module*"
# message: "Ask me to do something anytime!"
# data:
# keyboard:
# - "/guest_mode_on, /guest_mode_off"
# - "/status"
# - service: notify.telegram
# data:
# title: "⚙️ *System Module*"
# message: "Ask me to do something anytime!"
# data:
# keyboard:
# - "/guest_mode_on, /guest_mode_off"
# - "/status"
- alias: System · Telegram · Announce status
trigger: