Compare commits

...

56 Commits

Author SHA1 Message Date
1a706153a8 Fix handling of MLB rain delays, close #252 2025-06-26 17:27:26 -04:00
95b2c8cfc5 Update .HA_VERSION 2025-06-26 17:27:02 -04:00
61b04c05c6 Update time macros 2025-06-15 18:13:55 -04:00
41141e94df Add entity to denote ongoing server maintenance 2025-06-15 17:44:07 -04:00
cc9ec0b211 Update .HA_VERSION 2025-06-15 17:43:46 -04:00
adf881a106 Adjust scheduling to help K's room when it's hot upstairs 2025-06-13 20:09:52 -04:00
6ee298a3d2 Update .HA_VERSION 2025-06-13 20:09:35 -04:00
aa6358ce19 Merge branch 'sunset-rework' into dev 2025-05-29 17:32:50 -04:00
abe62888b2 Add outdoor lux threshold and triggered boolean for sunset lights
home_automation/HA-NerdFlows#32
2025-05-27 21:26:24 -04:00
0cabab0462 Adjustments to Recliner Mode 2025-05-26 00:01:21 -04:00
034cf2f972 Adaptive lighting should reset after tornado warnings #229 2025-05-25 19:22:25 -04:00
1d246e8018 Use locally calculated SLP in template weather provider 2025-05-24 20:17:12 -04:00
5cffb7208f Add rain intensity awareness to weather briefings
#247
2025-05-23 20:57:04 -04:00
a7b1a53754 Fix storm warning code I apparently wrote in my sleep... 2025-05-23 20:56:40 -04:00
de5efd39b4 Update .HA_VERSION 2025-05-23 20:56:02 -04:00
0129a56866 Comment out total rain sensors template 2025-05-23 04:35:35 -04:00
b305f7c880 Rewrite rain detection sensor 2025-05-23 04:34:26 -04:00
6ee4bacf55 Notifications for school status changes (delay/cancel)
#245
2025-05-23 03:57:44 -04:00
4710700f7e Fix adaptive lighting reset in basement studio goodnight script 2025-05-22 19:06:41 -04:00
895e99657b The new way of doing weather forecasts in Home Assistant is fucking trash 2025-05-21 22:15:52 -04:00
0dc7d0f8e4 Fix Weather.com attributes in template weather stations 2025-05-21 20:45:59 -04:00
d38cf59812 Make sure the correct teams are inhibited for MLB if playing each other 2025-05-21 20:41:35 -04:00
a489ecdf14 Update .HA_VERSION 2025-05-20 18:35:56 -04:00
8698a46d4f Exclude Tempest data from long-term stats, found another solution 2025-05-16 19:59:57 -04:00
7d5aa32834 Use Tempest rainfall sensor to trigger window warning 2025-05-15 18:19:03 -04:00
37458be1b8 Unfuck my recorder config... 2025-05-15 17:48:09 -04:00
72421b8716 Switch from Weather.com to Weatherflow for weather sensors 2025-05-15 06:26:41 -04:00
8be8f4bb58 Narrow down to just using the Tempest lighting strikes over past hour 2025-05-15 05:38:24 -04:00
6e619fa647 Input number for front porch lux threshold 2025-05-15 04:08:04 -04:00
9dca18048c Incorporate Weatherflow forecasts into main weather templates 2025-05-15 02:30:03 -04:00
52bfb8bd49 Handle lightning monitoring as more of a group effort 2025-05-15 01:14:19 -04:00
43feaa9b06 Lightning warning now uses local Tempest sensor by default 2025-05-15 00:05:10 -04:00
0847e7fd10 Add dewpoint and apparent temperature templates to INWS weather template 2025-05-15 00:04:49 -04:00
425b1fb0cf Add local Tempest Weather data to INWS weather template 2025-05-15 00:04:23 -04:00
f589cc0e6c Remove automations and blueprint for Chromecasting to TVs 2025-05-15 00:03:16 -04:00
49a4f4650b Update sensor light blueprint 2025-05-15 00:02:51 -04:00
3a2fc504f3 Update Twanne's lighting blueprints 2025-05-15 00:02:28 -04:00
f1180cc34b Track Weatherflow Tempest data in databases 2025-05-14 20:08:52 -04:00
b936838376 Updated readme 2025-05-14 01:28:00 -04:00
2d755be935 Shower Mode Auto Off automation 2025-05-13 23:57:42 -04:00
ed0431ae56 Update .HA_VERSION 2025-05-13 23:57:17 -04:00
a1b68f80b6 Changes for new version of Bubble Cards 2025-05-08 21:35:45 -04:00
adc4bc9b42 Update .HA_VERSION 2025-05-08 21:35:08 -04:00
1500151c12 Handle Tina's meds resetting when she wakes up #243 2025-05-07 11:48:56 -04:00
67d1d3d43e Fix #241 2025-04-29 18:11:36 -04:00
1c5ccbb926 Update time macros 2025-04-29 18:06:31 -04:00
5d4457c198 Adjust MBR climate scheduling 2025-04-29 01:54:06 -04:00
d16a0f8353 Update scheduled reset for wife's night meds 2025-04-29 01:53:40 -04:00
c8242c2fea Update .HA_VERSION 2025-04-29 01:52:52 -04:00
713ddb9f75 Fix Emma's climate scheduling using old logic 2025-04-28 21:33:49 -04:00
10d7ec5e03 Account for overtime in sports reports 2025-04-28 21:33:33 -04:00
95ffb38b7e Exclude RSSI sensors from recorder 2025-04-28 21:32:50 -04:00
b5c295a19d Add config stuff for new default theme 2025-04-24 01:51:11 -04:00
bd9dde2455 Remove eco mode sensors for aircons as they are no longer needed 2025-04-24 01:32:52 -04:00
857870e0b1 Add a few more lights to monitor for unintended switching 2025-04-19 22:50:35 -04:00
003fe6614d Update .HA_VERSION 2025-04-19 22:19:38 -04:00
23 changed files with 7529 additions and 3335 deletions

View File

@ -1 +1 @@
2025.4.2
2025.6.2

View File

@ -69,15 +69,6 @@
seconds: 0
milliseconds: 0
mode: single
- id: '1640916845901'
alias: Cast to Chromecast
description: ''
use_blueprint:
path: kind3r/cast-and-re-cast-a-lovelace-view-to-a-google-hub.yaml
input:
dashboard: lovelace
player: media_player.living_room_tv
view: chromecast
- id: '1640989510134'
alias: New Years
description: Flash lights for New Years
@ -281,15 +272,6 @@
- service: icloud3.restart
data: {}
mode: single
- id: '1645738561470'
alias: Cast to Basement TV
description: ''
use_blueprint:
path: kind3r/cast-and-re-cast-a-lovelace-view-to-a-google-hub.yaml
input:
dashboard: lovelace
player: media_player.basement_tv_chromecast
view: chromecast
- id: '1651785688186'
alias: Watchman Audit on Startup
description: Runs the Watchman Audit script after Home Assistant has successfully
@ -1887,54 +1869,70 @@
to: 'on'
id: recliner-on
trigger: state
alias: Recliner Mode On
- entity_id: input_boolean.recliner_mode
from: 'on'
to: 'off'
id: recliner-off
trigger: state
alias: Recliner Mode Off
conditions: []
actions:
- choose:
- alias: Routing
choose:
- conditions:
- condition: trigger
id: recliner-on
alias: Recliner Mode On
sequence:
- target:
entity_id: input_select.basement_studio_scenes
data:
option: Stairwell
action: input_select.select_option
alias: Set scene to Stairwell
- target:
entity_id:
- input_boolean.white_noise_basement
- input_boolean.studio_quiet
data: {}
action: input_boolean.turn_on
- if:
alias: Turn on white noise and Studio Quiet
- alias: Turn off TV
if:
- condition: template
value_template: "{% if is_state('media_player.basement_tv','playing') %}\n
\ false\n{% elif is_state('media_player.basement_tv','paused') or is_state('media_player.basement_tv','idle')
%}\n {{ state_attr('media_player.basement_tv','app_name') in ['TV','Android
TV Launcher'] }}\n{% else %}\n false\n{% endif %}\n"
alias: If nothing is playing
then:
- target:
entity_id: media_player.basement_tv
data: {}
action: media_player.turn_off
- if:
- condition: not
alias: Turn off TV
enabled: false
- alias: Turn off computer monitors
if:
- alias: If I'm not watching something
condition: not
conditions:
- condition: state
entity_id: media_player.tony_asus
state: playing
alias: PC playing video or music
then:
- target:
entity_id: script.tony_desktop_displays_off
data: {}
action: script.turn_on
alias: Turn off computer monitors
enabled: false
- conditions:
- condition: trigger
id: recliner-off
alias: Recliner Mode Off
sequence:
- data: {}
target:
@ -2064,10 +2062,12 @@
- script.tony_desktop_displays_on
data: {}
action: script.turn_on
enabled: false
- target:
entity_id: media_player.basement_tv
data: {}
action: media_player.turn_on
enabled: false
mode: restart
- id: '1696286540644'
alias: Basement Lights Adaptive Resync
@ -2632,100 +2632,100 @@
- id: '1696356974829'
alias: Scheduled Reset
description: Reset all context entities for the next day at the appropriate times
trigger:
- platform: time
at: 00:00:00
triggers:
- at: 00:00:00
id: midnight
- platform: time
at: input_datetime.audible_notification_on
trigger: time
- at: input_datetime.audible_notification_on
id: audible-on
- platform: time
at: input_datetime.kallen_school_day_end
trigger: time
- at: input_datetime.kallen_school_day_end
id: school-end
- platform: state
entity_id: sensor.twitch_ironnerd24
trigger: time
- entity_id: sensor.twitch_ironnerd24
from: streaming
to: offline
id: stream-offline
- platform: time
at: 04:00:00
trigger: state
- at: 04:00:00
id: 4am
- platform: time
at: '16:00:00'
id: 4pm
- platform: time
at: 06:00:00
trigger: time
- at: '12:00:00'
id: noon
trigger: time
- at: 06:00:00
id: 6am
condition: []
action:
trigger: time
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id: midnight
sequence:
- service: script.scheduling_reset
data: {}
- service: script.kallen_school_reset_late
data: {}
- service: automation.turn_on
target:
- data: {}
action: script.scheduling_reset
- data: {}
action: script.kallen_school_reset_late
- target:
entity_id:
- automation.scheduled_alarm_rearm
- automation.scheduled_alarm_disarm
data: {}
- service: input_boolean.turn_off
target:
action: automation.turn_on
- target:
entity_id:
- input_boolean.skip_disarm
- input_boolean.skip_rearm
data: {}
- service: counter.reset
target:
action: input_boolean.turn_off
- target:
entity_id:
- counter.back_door_opened_today
- counter.front_door_opened_today
- counter.basement_studio_door_opened_today
- counter.basement_led_strip_resets
data: {}
action: counter.reset
- conditions:
- condition: trigger
id:
- audible-on
sequence:
- service: script.reset_annc_switches
data: {}
- data: {}
action: script.reset_annc_switches
- conditions:
- condition: trigger
id: school-end
sequence:
- service: script.kallen_school_reset
data: {}
- data: {}
action: script.kallen_school_reset
- conditions:
- condition: trigger
id: stream-offline
sequence:
- service: input_boolean.turn_off
target:
- target:
entity_id: input_boolean.tony_streaming_today
data: {}
action: input_boolean.turn_off
- conditions:
- condition: trigger
id: 4am
sequence:
- service: input_boolean.turn_off
target:
- target:
entity_id:
- input_boolean.kallen_morning_meds_taken
- input_boolean.kallen_night_meds_taken
- input_boolean.tina_morning_meds_taken
- input_boolean.emma_scheduling_evening_ran
data: {}
- service: counter.reset
target:
action: input_boolean.turn_off
- target:
entity_id:
- counter.tony_morning_meds_reminder_count
- counter.tony_afternoon_meds_reminder_count
data: {}
action: counter.reset
- conditions:
- condition: trigger
id: 6am
@ -2735,19 +2735,16 @@
entity_id: sensor.twitch_ironnerd24
state: offline
then:
- service: input_boolean.turn_off
target:
- target:
entity_id: input_boolean.tony_streaming_today
data: {}
action: input_boolean.turn_off
- conditions:
- condition: trigger
id: 4pm
id:
- noon
sequence:
- service: input_boolean.turn_off
target:
entity_id:
- input_boolean.tina_night_meds_taken
data: {}
- stop: No current actions scheduled at noon, remove this action if this changes
mode: restart
- id: '1696361494561'
alias: Turn On Audible Notifications
@ -3018,18 +3015,21 @@
- id: '1696556688808'
alias: Rain Window Warning
description: Warn when it starts raining and a window is open
trigger:
- platform: state
entity_id: binary_sensor.raining
from: 'off'
to: 'on'
alias: Rain starts
condition:
triggers:
- alias: Rain starts
entity_id:
- sensor.home_tempest_precipitation_type
from: none
not_to:
- unavailable
- unknown
trigger: state
conditions:
- condition: state
entity_id: binary_sensor.windows
state: 'on'
alias: Windows are open
action:
actions:
- variables:
porch: "{% set windows = states('sensor.windows_open') | int %} {% set front
= states('sensor.front_windows_open') | int %} {% if windows == front %}\n
@ -3040,36 +3040,36 @@
house. Please close them!\n{% endif %}\n"
alias: Define variables
- parallel:
- service: script.text_notify
data:
- data:
type: alert
who: all
title: WINDOWS ARE OPEN!
message: '{{ message }}'
tag: rain-window-warning
alias: Send text notification
- service: script.speech_engine
data:
action: script.text_notify
- data:
who: everywhere
type: weather
message: '{{ message }}'
alias: TTS notification
- service: script.living_room_lights_alert
data:
action: script.speech_engine
- data:
type: blue
duration: 10
alias: Light alert in living room
action: script.living_room_lights_alert
- if:
- condition: state
entity_id: binary_sensor.basement_occupied
state: 'on'
alias: Basement is occupied
then:
- service: script.basement_lights_alert
data:
- data:
type: blue
duration: 10
alias: Light alert in basement
action: script.basement_lights_alert
alias: Light alert in basement, if occupied
alias: Send the various alerts
- wait_template: '{{ is_state(''binary_sensor.windows'',''off'') or is_state(''binary_sensor.raining'',''off'')
@ -3084,46 +3084,46 @@
}}'
alias: Windows closed and still raining
sequence:
- service: script.text_notify
data:
- data:
type: alert
who: all
message: clear_notification
tag: rain-window-warning
alias: Clear text notification
- service: script.speech_engine
data:
action: script.text_notify
- data:
who: common
type: weather
message: Windows are now closed. Thank you, and enjoy your dry house.
alias: TTS notification
action: script.speech_engine
- conditions:
- condition: template
value_template: '{{ is_state(''binary_sensor.raining'',''off'') }}'
alias: Stopped raining
sequence:
- service: script.text_notify
data:
- data:
type: alert
who: all
message: clear_notification
tag: rain-window-warning
alias: Clear text notification
- service: script.speech_engine
data:
action: script.text_notify
- data:
who: common
type: weather
message: Nevermind, it has stopped raining. Feel free to do whatever you'd
like with the windows.
alias: TTS notification
action: script.speech_engine
default:
- service: script.speech_engine
data:
- data:
who: common
type: weather
message: Well, I guess no one cares if the house floods. Suit yourself, but
do not say I didn't warn you.
alias: TTS notification
action: script.speech_engine
alias: After wait completed
mode: single
- id: '1696884613752'
@ -6112,3 +6112,180 @@
entity_id: input_boolean.emma_awake
alias: Turn on Emma Awake
mode: restart
- id: '1746632520108'
alias: Tina Sleep Handling
description: Awareness of when Tina is asleep or wakes up
triggers:
- alias: Leave Home
entity_id: person.christina_stork
zone: zone.home
event: leave
id: wake-leave
trigger: zone
- alias: Sentence
command:
- Tina is awake
- Christina is awake
id: wake-sentence
trigger: conversation
- alias: Focus off
entity_id:
- binary_sensor.tinas_iphone_focus
from: 'on'
to: 'off'
for:
hours: 0
minutes: 0
seconds: 30
id: wake-focus
trigger: state
conditions: []
actions:
- alias: Routing
choose:
- conditions:
- condition: and
conditions:
- alias: Wakeup
condition: trigger
id:
- wake-sentence
- wake-focus
- wake-leave
- condition: state
entity_id: input_boolean.tina_awake
state: 'off'
alias: Wakeup Trigger
sequence:
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- alias: Set context that Tina is awake
data: {}
action: input_boolean.turn_on
target:
entity_id: input_boolean.tina_awake
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id:
- input_boolean.tina_morning_meds_taken
- input_boolean.tina_night_meds_taken
alias: Reset Tina meds taken switches
mode: restart
- id: '1747130058536'
alias: Shower Mode Auto Off
description: Kallen keeps leaving shower mode on, so I'm fixing that
triggers:
- trigger: state
entity_id:
- input_boolean.shower_mode
from: 'off'
to: 'on'
id: shower-on
alias: Shower Mode On
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.shower_mode_auto_off
id: timer-finished
alias: Timer Finished
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- shower-on
alias: Shower On
sequence:
- alias: Start timer
action: timer.start
metadata: {}
data: {}
target:
entity_id: timer.shower_mode_auto_off
- conditions:
- condition: trigger
id:
- timer-finished
alias: Timer Finished
sequence:
- alias: Turn off shower mode
action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.shower_mode
alias: Routing
mode: restart
- id: '1747986913670'
alias: School Status Notifications
description: Sends alert notifications to all phones when school is placed under
a two hour delay or cancelled for the day
triggers:
- trigger: state
entity_id:
- input_boolean.two_hour_delay
from: 'off'
to: 'on'
id: delay
alias: Two Hour Delay
- trigger: state
entity_id:
- input_boolean.school_cancelled
from: 'off'
to: 'on'
id: cancel
alias: Cancelled
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- delay
alias: Two Hour Delay
sequence:
- alias: Send Notification
action: script.text_notify
metadata: {}
data:
type: alert
title: School Alert
message: Defiance City Schools is under a two hour delay!
tag: two-hour-delay
who: all
- conditions:
- condition: trigger
id:
- cancel
alias: Cancelled
sequence:
- action: script.text_notify
metadata: {}
data:
type: alert
who: all
message: clear_notification
tag: two-hour-delay
alias: Clear previous delay notification
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- alias: Send Notification
action: script.text_notify
metadata: {}
data:
type: alert
title: School Alert
message: Defiance City Schools has closed for today!
tag: school-cancelled
who: all
alias: Routing
mode: restart

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
blueprint:
name: Smart Lux Dimmer
author: AntonH
description: 'Version 4.1
description: 'Version 4.3
Switch or dim lights based on the value of a light sensor.
@ -24,10 +24,11 @@ blueprint:
value?
selector:
entity:
domain:
- sensor
device_class:
- illuminance
filter:
- domain:
- sensor
device_class:
- illuminance
multiple: false
target_light:
name: Target lights
@ -81,8 +82,8 @@ blueprint:
min: 0.0
max: 100.0
step: 1.0
mode: slider
unit_of_measurement: '%'
mode: slider
light_value_2:
name: Brightness at minimum light level
description: Brightness of the light at minimum ambient light.
@ -92,8 +93,8 @@ blueprint:
min: 0.0
max: 100.0
step: 1.0
mode: slider
unit_of_measurement: '%'
mode: slider
transition_time:
name: Transition time
description: 'The time it takes for the light to transition from the set value
@ -124,9 +125,9 @@ blueprint:
value: include_color
- label: Set temperature
value: include_temp
multiple: false
sort: false
custom_value: false
sort: false
multiple: false
light_color:
name: Light color
description: Color of the light when between minimum and maximum ambient light
@ -161,8 +162,8 @@ blueprint:
min: 0.0
max: 100.0
step: 1.0
mode: slider
unit_of_measurement: '%'
mode: slider
light_brightness_under_min:
name: Brightness when ambient light value under min.
description: Brightness of the light when the ambient light is lower than the
@ -173,8 +174,8 @@ blueprint:
min: 0.0
max: 100.0
step: 1.0
mode: slider
unit_of_measurement: '%'
mode: slider
include_color_or_temp_over_under:
name: Include color or temperature values when outside range
description: 'Set a color or temperature value for the light when over maximum
@ -193,9 +194,9 @@ blueprint:
value: include_color_outside_range
- label: Set temperature when outside range
value: include_temp_outside_range
multiple: false
sort: false
custom_value: false
sort: false
multiple: false
light_color_over_max:
name: Color when ambient light value over max.
description: Color of the light when the ambient light is higher than the set
@ -236,18 +237,25 @@ variables:
include_brightness_over_under: !input include_brightness_over_under
include_color_or_temp_over_under: !input include_color_or_temp_over_under
light_sensor: !input light_sensor_entity
maxB: !input max_brightness_value
minB: !input min_brightness_value
light1: !input light_value_1
light2: !input light_value_2
max_brightness_value: !input max_brightness_value
min_brightness_value: !input min_brightness_value
maxB: '{{ max_brightness_value * 2.55 }}'
minB: '{{ min_brightness_value * 2.55 }}'
light_value_1: !input light_value_1
light_value_2: !input light_value_2
light1: '{{ light_value_1 * 2.55 }}'
light2: '{{ light_value_2 * 2.55 }}'
slope: '{{ ( light1 - light2 ) / ( maxB - minB ) }}'
constant: '{{ light1 - ( slope * maxB ) }}'
trigger:
platform: state
light_brightness_over_max: !input light_brightness_over_max
light_brightness_under_min: !input light_brightness_under_min
brightness_over_max_pct: '{{ light_brightness_over_max * 2.55 }}'
brightness_under_min_pct: '{{ light_brightness_under_min * 2.55 }}'
triggers:
trigger: state
entity_id: !input light_sensor_entity
condition:
- condition: !input run_conditions
action:
conditions: !input run_conditions
actions:
- choose:
- conditions:
- condition: template
@ -258,20 +266,20 @@ action:
- condition: template
value_template: '{{ include_color_or_temp == "include_no_color_temp" }}'
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round
brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}'
target: !input target_light
- conditions:
- condition: template
value_template: '{{ include_color_or_temp == "include_color" }}'
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round
brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}'
rgb_color: !input light_color
target: !input target_light
@ -279,10 +287,10 @@ action:
- condition: template
value_template: '{{ include_color_or_temp == "include_temp" }}'
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round
brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}'
color_temp: !input light_temp
target: !input target_light
@ -302,20 +310,20 @@ action:
entity_id: !input light_sensor_entity
above: !input max_brightness_value
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: !input light_brightness_over_max
brightness: '{{ brightness_over_max_pct }}'
target: !input target_light
- conditions:
- condition: numeric_state
entity_id: !input light_sensor_entity
below: !input min_brightness_value
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: !input light_brightness_under_min
brightness: '{{ brightness_under_min_pct }}'
target: !input target_light
- conditions:
- condition: numeric_state
@ -323,10 +331,10 @@ action:
below: !input max_brightness_value
above: !input min_brightness_value
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round
brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}'
target: !input target_light
- conditions:
@ -340,10 +348,10 @@ action:
entity_id: !input light_sensor_entity
above: !input max_brightness_value
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: !input light_brightness_over_max
brightness: '{{ brightness_over_max_pct }}'
rgb_color: !input light_color_over_max
target: !input target_light
- conditions:
@ -351,10 +359,10 @@ action:
entity_id: !input light_sensor_entity
below: !input min_brightness_value
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: !input light_brightness_under_min
brightness: '{{ brightness_under_min_pct }}'
rgb_color: !input light_color_under_min
target: !input target_light
- conditions:
@ -363,10 +371,10 @@ action:
below: !input max_brightness_value
above: !input min_brightness_value
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round
brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}'
rgb_color: !input light_color
target: !input target_light
@ -381,10 +389,10 @@ action:
entity_id: !input light_sensor_entity
above: !input max_brightness_value
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: !input light_brightness_over_max
brightness: '{{ brightness_over_max_pct }}'
color_temp: !input light_temp_over_max
target: !input target_light
- conditions:
@ -392,10 +400,10 @@ action:
entity_id: !input light_sensor_entity
below: !input min_brightness_value
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: !input light_brightness_under_min
brightness: '{{ brightness_under_min_pct }}'
color_temp: !input light_temp_under_min
target: !input target_light
- conditions:
@ -404,10 +412,10 @@ action:
below: !input max_brightness_value
above: !input min_brightness_value
sequence:
- service: light.turn_on
- action: light.turn_on
data:
transition: !input transition_time
brightness_pct: '{{ (( slope * states(light_sensor)|int ) + constant)|round
brightness: '{{ (( slope * states(light_sensor)|int ) + constant)|round
}}'
color_temp: !input light_temp
target: !input target_light

View File

@ -31,12 +31,15 @@ blueprint:
text: {}
light_sensor_entity:
name: Light Sensor
description: Which light sensor do you want to use to measure the ambient light
value?
selector:
entity:
domain:
- sensor
device_class:
- illuminance
filter:
- domain:
- sensor
device_class:
- illuminance
multiple: false
max_brightness_value:
name: Maximum ambient light value
@ -94,15 +97,17 @@ variables:
light_sensor: !input light_sensor_entity
maxB: !input max_brightness_value
minB: !input min_brightness_value
light1: !input light_value_1
light2: !input light_value_2
light_value_1: !input light_value_1
light_value_2: !input light_value_2
light1: '{{ light_value_1 * 2.55 }}'
light2: '{{ light_value_2 * 2.55 }}'
slope: '{{ ( light1 - light2 ) / ( maxB - minB ) }}'
constant: '{{ light1 - ( slope * maxB ) }}'
days: !input schedule_days
trigger:
platform: state
triggers:
trigger: state
entity_id: !input light_sensor_entity
condition:
conditions:
- condition: numeric_state
entity_id: !input light_sensor_entity
above: !input min_brightness_value
@ -111,9 +116,9 @@ condition:
before: !input schedule_stop
- condition: template
value_template: '{{ now().strftime(''%a'') | lower in days }}'
action:
- service: light.turn_on
actions:
- action: light.turn_on
data:
brightness_pct: "{% if states(light_sensor)|int > maxB %}\n 0\n{% else %}\n {{
(( slope * states(light_sensor)|int ) + constant)|round }}\n{% endif %}\n"
brightness: "{% if states(light_sensor)|int > maxB %}\n 0\n{% else %}\n {{ ((
slope * states(light_sensor)|int ) + constant)|round }}\n{% endif %}\n"
target: !input target_light

View File

@ -1,7 +1,7 @@
blueprint:
name: The Everything Light
author: AntonH
description: "**Version 2.5**\nThe Everything Light: select any trigger and turn
description: "**Version 2.10**\nThe Everything Light: select any trigger and turn
on your light in multiple ways:\n - just turn the light on in it's default state\n
\ - turn it on with a set brightness, color and/or temperature value\n - turn
it on dynamically with a brightness value that changes according to an ambient
@ -55,13 +55,13 @@ blueprint:
Toggle the light.
- **FIXED MODE: **
- **FIXED MODE:**
The light will turn on at a set brightness percentage, optionally color or
temperature can be set.
- **DYNAMIC MODE**
- **DYNAMIC MODE:**
The light will be assigned a brightness value based on the value of a ambient
light sensor, optionally color or temperature can be set.
@ -74,15 +74,15 @@ blueprint:
options:
- label: DEFAULT MODE
value: default
- label: TOGGLE
- label: TOGGLE MODE
value: toggle
- label: FIXED MODE
value: fixed
- label: DYNAMIC MODE
value: dynamic
multiple: false
sort: false
custom_value: false
sort: false
multiple: false
transition_time:
name: Transition time (FIXED & DYNAMIC MODE)
description: "The time it takes for the light to transition to the assigned
@ -110,9 +110,9 @@ blueprint:
value: include_color
- label: Set temperature
value: include_temperature
multiple: false
sort: false
custom_value: false
sort: false
multiple: false
light_color:
name: Light color (FIXED & DYNAMIC MODE)
description: Color of the light when between minimum and maximum ambient light
@ -125,22 +125,28 @@ blueprint:
color_rgb: {}
light_temperature:
name: Light temperature (FIXED & DYNAMIC MODE)
description: Temperature of the light when between minimum and maximum ambient
description: 'Temperature of the light when between minimum and maximum ambient
light values.
(not all lights will support all values, please consult your lights spec sheet.)
'
default: 2000
selector:
color_temp: {}
color_temp:
unit: kelvin
min: 1500
max: 6500
brightness:
name: Brightness (FIXED BRIGHTNESS MODE)
description: Set the brightness value the light needs to turn on at
default: 0
default: 100
selector:
number:
min: 0.0
max: 100.0
step: 1.0
mode: slider
unit_of_measurement: '%'
light_sensor_entity:
name: Light Sensor (DYNAMIC MODE)
description: Which light sensor do you want to use to measure the ambient light
@ -188,7 +194,6 @@ blueprint:
max: 100.0
step: 1.0
mode: slider
unit_of_measurement: '%'
light_value_2:
name: Brightness at minimum light level (DYNAMIC MODE)
description: Brightness of the light at minimum ambient light.
@ -199,7 +204,6 @@ blueprint:
max: 100.0
step: 1.0
mode: slider
unit_of_measurement: '%'
light_brightness_over_max:
name: Brightness when ambient light value over max (DYNAMIC MODE)
description: Brightness of the light when the ambient light is higher than the
@ -211,19 +215,17 @@ blueprint:
max: 100.0
step: 1.0
mode: slider
unit_of_measurement: '%'
light_brightness_under_min:
name: Brightness when ambient light value under min (DYNAMIC MODE)
description: Brightness of the light when the ambient light is lower than the
set minimum value.
default: 100
default: 255
selector:
number:
min: 0.0
max: 100.0
step: 1.0
mode: slider
unit_of_measurement: '%'
include_color_or_temp_over_under:
name: Include color or temperature values when outside range (DYNAMIC MODE)
description: 'Set a color or temperature value for the light when over maximum
@ -242,9 +244,9 @@ blueprint:
value: include_color_outside_range
- label: Set temperature when outside range
value: include_temp_outside_range
multiple: false
sort: false
custom_value: false
sort: false
multiple: false
light_color_over_max:
name: Color when ambient light value over max (DYNAMIC MODE)
description: Color of the light when the ambient light is higher than the set
@ -267,18 +269,32 @@ blueprint:
color_rgb: {}
light_temp_over_max:
name: Temperature when ambient light value over max (DYNAMIC MODE)
description: Temperature of the light when the ambient light is higher than
description: 'Temperature of the light when the ambient light is higher than
the set maximum value.
(not all lights will support all values, please consult your lights spec sheet.)
'
default: 2000
selector:
color_temp: {}
color_temp:
unit: kelvin
min: 1500
max: 6500
light_temp_under_min:
name: Temperature when ambient light value under min (DYNAMIC MODE)
description: Temperature of the light when the ambient light is lower than the
set minimum value.
description: 'Temperature of the light when the ambient light is lower than
the set minimum value.
(not all lights will support all values, please consult your lights spec sheet.)
'
default: 2000
selector:
color_temp: {}
color_temp:
unit: kelvin
min: 1500
max: 6500
include_turn_off:
name: Include light turn off function
description: 'Select if the light needs to turn back off again and how you want
@ -307,8 +323,8 @@ blueprint:
value: trigger
- label: Staircase function
value: staircase
sort: false
custom_value: false
sort: false
turn_off_triggers:
name: Turn off triggers
description: Triggers that turn the light off
@ -343,71 +359,75 @@ variables:
include_color_or_temp: !input include_color_or_temp
light_color: !input light_color
light_temperature: !input light_temperature
light_brightness: !input brightness
brightness: !input brightness
light_brightness: '{{ brightness * 2.55 }}'
light_sensor: !input light_sensor_entity
maxB: !input max_brightness_value
minB: !input min_brightness_value
light1: !input light_value_1
light2: !input light_value_2
light_value_1: !input light_value_1
light_value_2: !input light_value_2
light1: '{{ light_value_1 * 2.55 }}'
light2: '{{ light_value_2 * 2.55 }}'
slope: '{{ ( light1 - light2 ) / ( maxB - minB ) }}'
constant: '{{ light1 - ( slope * maxB ) }}'
dynamic_brightness_pct: "{% if mode == \"dynamic\" %}\n {{ (( slope * states(light_sensor)|int
dynamic_brightness: "{% if mode == \"dynamic\" %}\n {{ (( slope * states(light_sensor)|int
) + constant)|round }}\n{% else %}\n 0\n{% endif %}\n"
include_color_or_temp_over_under: !input include_color_or_temp_over_under
light_brightness_over_max: !input light_brightness_over_max
brightness_over_max_pct: '{{ light_brightness_over_max * 2.55 }}'
light_color_over_max: !input light_color_over_max
light_temp_over_max: !input light_temp_over_max
light_brightness_under_min: !input light_brightness_under_min
brightness_under_min_pct: '{{ light_brightness_under_min * 2.55 }}'
light_color_under_min: !input light_color_under_min
light_temp_under_min: !input light_temp_under_min
include_turn_off: !input include_turn_off
trigger: !input triggers
condition:
- condition: !input run_conditions
action:
conditions: !input run_conditions
actions:
- choose:
- conditions: '{{ mode == "toggle" }}'
sequence:
- service: homeassistant.toggle
- action: homeassistant.toggle
target: !input target_light
- conditions: '{{ mode == "default" }}'
sequence:
- service: homeassistant.turn_on
- action: homeassistant.turn_on
target: !input target_light
- conditions: '{{ mode == "fixed" }}'
sequence:
- service: light.turn_on
- action: light.turn_on
data: "{% if include_color_or_temp == \"include_color\" %}\n {{ { \"transition\":
transition_time, \"brightness_pct\": light_brightness, \"rgb_color\": light_color
transition_time, \"brightness\": light_brightness, \"rgb_color\": light_color
} }}\n{% elif include_color_or_temp == \"include_temperature\" %}\n {{ {
\"transition\": transition_time, \"brightness_pct\": light_brightness, \"color_temp\":
\"transition\": transition_time, \"brightness\": light_brightness, \"color_temp\":
light_temperature } }}\n{% else %}\n {{ { \"transition\": transition_time,
\"brightness_pct\": light_brightness } }}\n{% endif %}\n"
\"brightness\": light_brightness } }}\n{% endif %}\n"
target: !input target_light
- conditions: '{{ mode == "dynamic" }}'
sequence:
- service: light.turn_on
- action: light.turn_on
data: "{% if states(light_sensor)|int > maxB %}\n {% if include_color_or_temp_over_under
== \"include_color_outside_range\" %}\n {{ { \"transition\": transition_time,
\"brightness_pct\": light_brightness_over_max, \"rgb_color\": light_color_over_max
\"brightness\": brightness_over_max_pct, \"rgb_color\": light_color_over_max
} }}\n {% elif include_color_or_temp_over_under == \"include_temp_outside_range\"
%}\n {{ { \"transition\": transition_time, \"brightness_pct\": light_brightness_over_max,
%}\n {{ { \"transition\": transition_time, \"brightness\": brightness_over_max_pct,
\"color_temp\": light_temp_over_max } }}\n {% else %}\n {{ { \"transition\":
transition_time, \"brightness_pct\": light_brightness_over_max } }}\n {%
endif %}\n{% elif states(light_sensor)|int < minB %}\n {% if include_color_or_temp_over_under
transition_time, \"brightness\": brightness_over_max_pct } }}\n {% endif
%}\n{% elif states(light_sensor)|int < minB %}\n {% if include_color_or_temp_over_under
== \"include_color_outside_range\" %}\n {{ { \"transition\": transition_time,
\"brightness_pct\": light_brightness_under_min, \"rgb_color\": light_color_under_min
\"brightness\": brightness_under_min_pct, \"rgb_color\": light_color_under_min
} }}\n {% elif include_color_or_temp_over_under == \"include_temp_outside_range\"
%}\n {{ { \"transition\": transition_time, \"brightness_pct\": light_brightness_under_min,
%}\n {{ { \"transition\": transition_time, \"brightness\": brightness_under_min_pct,
\"color_temp\": light_temp_under_min } }}\n {% else %}\n {{ { \"transition\":
transition_time, \"brightness_pct\": light_brightness_under_min } }}\n {%
endif %}\n{% else %}\n {% if include_color_or_temp == \"include_color\" %}\n
\ {{ { \"transition\": transition_time, \"brightness_pct\": light_brightness,
\"rgb_color\": light_color } }}\n {% elif include_color_or_temp == \"include_temperature\"
%}\n {{ { \"transition\": transition_time, \"brightness_pct\": dynamic_brightness_pct,
transition_time, \"brightness\": brightness_under_min_pct } }}\n {% endif
%}\n{% else %}\n {% if include_color_or_temp == \"include_color\" %}\n {{
{ \"transition\": transition_time, \"brightness\": light_brightness, \"rgb_color\":
light_color } }}\n {% elif include_color_or_temp == \"include_temperature\"
%}\n {{ { \"transition\": transition_time, \"brightness\": dynamic_brightness,
\"color_temp\": light_temperature } }}\n {% else %}\n {{ { \"transition\":
transition_time, \"brightness_pct\": dynamic_brightness_pct } }}\n {% endif
%}\n{% endif %}\n"
transition_time, \"brightness\": dynamic_brightness } }}\n {% endif %}\n{%
endif %}\n"
target: !input target_light
- if: !input turn_off_conditions
then:
@ -420,11 +440,11 @@ action:
timeout: !input staircase_duration
else:
- delay: !input staircase_duration
- service: homeassistant.turn_off
- action: homeassistant.turn_off
target: !input target_light
- conditions: '{{ "trigger" in include_turn_off and not "staircase" in include_turn_off
}}'
sequence:
- wait_for_trigger: !input turn_off_triggers
- service: homeassistant.turn_off
- action: homeassistant.turn_off
target: !input target_light

View File

@ -10,6 +10,7 @@ blueprint:
selector:
entity:
integration: cast
multiple: false
view:
name: Lovelace view path
description: Path of the view to cast. A path has to be defined in your Lovelace
@ -21,11 +22,11 @@ blueprint:
source_url: https://community.home-assistant.io/t/cast-and-re-cast-a-lovelace-view-to-a-google-hub/259631
trigger:
- platform: state
entity_id: !input 'player'
entity_id: !input player
to: 'off'
for: 00:00:20
- platform: state
entity_id: !input 'player'
entity_id: !input player
to: paused
for: 00:00:20
- platform: time_pattern
@ -38,38 +39,38 @@ action:
- condition: or
conditions:
- condition: state
entity_id: !input 'player'
entity_id: !input player
state: 'off'
- condition: state
entity_id: !input 'player'
entity_id: !input player
state: paused
for: 00:00:20
sequence:
- service: media_player.volume_mute
data:
is_volume_muted: true
entity_id: !input 'player'
entity_id: !input player
- service: media_player.turn_off
data:
entity_id: !input 'player'
entity_id: !input player
- delay:
seconds: 2
- service: media_player.turn_on
data:
entity_id: !input 'player'
entity_id: !input player
- service: cast.show_lovelace_view
data:
view_path: !input 'view'
dashboard_path: !input 'dashboard'
entity_id: !input 'player'
view_path: !input view
dashboard_path: !input dashboard
entity_id: !input player
- service: cast.show_lovelace_view
data:
view_path: !input 'view'
dashboard_path: !input 'dashboard'
entity_id: !input 'player'
view_path: !input view
dashboard_path: !input dashboard
entity_id: !input player
- delay:
seconds: 10
- service: media_player.volume_mute
data:
is_volume_muted: false
entity_id: !input 'player'
entity_id: !input player

View File

@ -32,8 +32,16 @@ frontend:
extra_module_url:
- /hacsfiles/hass-hue-icons/hass-hue-icons.js
- /hacsfiles/hass-bha-icons/hass-bha-icons.js
- /hacsfiles/material-you-utilities/material-you-utilities.min.js
javascript_version: latest
panel_custom:
- name: material-you-panel
url_path: material-you-configuration
sidebar_title: Material You Utilities
sidebar_icon: mdi:material-design
module_url: /hacsfiles/material-you-utilities/material-you-utilities.min.js
http:
use_x_forwarded_for: true
trusted_proxies:
@ -107,6 +115,8 @@ recorder:
- sensor.*gpu_core_load
- sensor.portainer*
- sensor.mosquitto*
- sensor.*_rssi
- sensor.weatherflow_hub*
entities:
- sensor.avg_ping
- sensor.max_ping
@ -121,6 +131,8 @@ recorder:
- sensor.mariadb_database_size
- sensor.random_joke
- sensor.bypassed_sensors
- sensor.home_tempest_signal_strength
- sensor.home_tempest_uptime
include:
entities:
- media_player.living_room_tv
@ -166,6 +178,8 @@ influxdb:
entity_globs:
- binary_sensor.*tamper*
- light.*screen*
- sensor.weatherflow_hub*
- sensor.home_tempest*
entities:
- sensor.last_boot
- sensor.date
@ -178,6 +192,8 @@ influxdb:
- light.all_lights
- fan.all_fans
- sensor.random_joke
- sensor.home_tempest_signal_strength
- sensor.home_tempest_uptime
include:
domains:
- sun
@ -347,6 +363,8 @@ prometheus:
exclude_entity_globs:
- binary_sensor.*tamper*
- light.*screen*
- sensor.weatherflow_hub*
- sensor.home_tempest*
exclude_entities:
- sensor.last_boot
- sensor.date
@ -359,6 +377,8 @@ prometheus:
- light.all_lights
- fan.all_fans
- sensor.random_joke
- sensor.home_tempest_signal_strength
- sensor.home_tempest_uptime
include_domains:
- sun
- light

View File

@ -203,6 +203,8 @@
'today': 'vandaag',
'tomorrow': 'morgen',
'yesterday': 'gisteren',
'next': 'volgende',
'last': 'afgelopen',
},
'days':[
"maandag",
@ -226,12 +228,30 @@
'oktober',
'november',
'december',
]
],
'time_of_hour':{
0: '{hour} uur',
1: '1 over {hour}',
15: 'kwart over {hour}',
30: 'half {hour}',
45: 'kwart voor {hour}',
59: '1 voor {hour}',
'past_hour': '{minute} over {hour}',
'to_hour': '{minute} voor {hour}',
'to_half_hour': '{minute} voor half {hour}',
'past_half_hour': '{minute} over half {hour}',
'half_hour': 'half {hour}',
'use_twelve': true,
},
'time_of_day':{
'midnight': 'middernacht',
'noon': 'middag',
},
},
'sv':{
'_language': 'Svenska',
'and': 'och',
'in': 'i',
'in': 'om',
'ago': 'sedan',
'now': 'nu',
'lose': 'förlora',
@ -273,6 +293,7 @@
'today': 'idag',
'tomorrow': 'imorgon',
'yesterday': 'igår',
'next': 'nästa',
},
'days':[
"måndag",
@ -302,7 +323,7 @@
'_language': 'Deutsch',
'and': 'und',
'in': 'in',
'ago': 'vor',
'ago': 'vor %s',
'now': 'jetzt',
'lose': 'Du verlierst',
'gain': 'Du gewinnst',
@ -363,7 +384,7 @@
'Juli',
'August',
'September',
'October',
'Oktober',
'November',
'Dezember',
]
@ -623,6 +644,8 @@
'today': "aujourd'hui",
'tomorrow': 'demain',
'yesterday': 'hier',
'next': 'prochain',
'last': 'dernier',
},
'days':[
"lundi",
@ -693,6 +716,8 @@
'today': 'hoy',
'tomorrow': 'mañana',
'yesterday': 'ayer',
'next': 'el próximo',
'last': 'el pasado',
},
'days':[
'lunes',
@ -711,12 +736,26 @@
'mayo',
'junio',
'julio',
'agosto'
'agosto',
'septiembre',
'octubre',
'noviembre',
'diciembre'
]
],
'time_of_hour':{
0: '{hour} en punto',
1: '{hour} y un minuto',
15: '{hour} y quarto',
30: '{hour} y media',
45: '{hour} menos quarto',
59: '{hour} menos uno',
'past_hour': '{hour} y {minute}',
'to_hour': '{hour} menos {minute}',
},
'time_of_day':{
'midnight': 'medianoche',
'noon': 'mediodía',
},
},
'it':{
'_language': 'Italiano',
@ -786,7 +825,21 @@
'ottobre',
'novembre',
'dicembre',
]
],
'time_of_hour':{
0: '{hour}',
1: '{hour} e un minuto',
15: '{hour} ed un quarto',
30: '{hour} e mezzo',
45: '15 minuti alle {hour}',
59: 'un minuto alle {hour}',
'past_hour': '{hour} e {minute}',
'to_hour': '{hour} meno {minute}',
},
'time_of_day':{
'midnight': 'mezzanotte',
'noon': 'mezzogiorno',
}
},
'pt':{
'_language': 'Português',
@ -865,9 +918,9 @@
'and': 'i',
'in': 'u',
'ago': 'prije',
'now': 'sad',
'now': 'sada',
'lose': 'gubiš',
'gain': 'dobijaš',
'gain': 'dobivaš',
'time':{
'format': '24-hr',
'year': [
@ -905,8 +958,8 @@
'today': 'danas',
'tomorrow': 'sutra',
'yesterday': 'jučer',
'next': 'slijedeći',
'last': 'prošli',
'next': 'sljedeći',
'last': 'protekli',
},
'days':[
"Ponedjeljak",
@ -1002,12 +1055,436 @@
'Październik',
'Listopad',
'Grudzień',
]
],
'time_of_hour': {
0: '{hour}',
1: 'minuta po {hour}',
15: 'kwadrans po {hour}',
30: 'pół godziny po {hour}',
45: 'za kwadrans {hour}',
59: 'za minutę {hour}',
'past_hour': '{minute} po {hour}',
'to_hour': '{minute} do {hour}'
},
'time_of_day': {
'midnight': 'północ',
'noon': 'południe'
}
},
'ru':{
'_language': 'Русский',
'and': 'и',
'in': 'в',
'ago': 'назад',
'now': 'сейчас',
'lose': 'уменьшение',
'gain': 'увеличение',
'time':{
'format': '24-hr',
'year': [
'г',
'год',
'лет',
],
'week': [
'нед',
'неделя',
'недель',
],
'day': [
'д',
'день',
'дней',
],
'hour': [
'ч',
'час',
'часов',
],
'minute': [
'мин',
'минута',
'минут',
],
'second': [
'сек',
'секунда',
'секунд',
],
},
'delta':{
'today': 'сегодня',
'tomorrow': 'завтра',
'yesterday': 'вчера',
'next': 'следующий',
'last': 'последний',
},
'days':[
"Понедельник",
"Вторник",
"Среда",
"Четверг",
"Пятница",
"Суббота",
"Воскресенье",
],
'months':[
'Январь',
'Февраль',
'Март',
'Апрель',
'Май',
'Июнь',
'Июль',
'Август',
'Сентябрь',
'Октябрь',
'Ноябрь',
'Декабрь',
],
'time_of_hour':{
0: '{hour} часов ровно',
1: '{hour} и 1 минута',
15: '{hour} с четвертью',
30: '{hour} с половиной',
45: 'без четверти {hour}',
59: 'без минуты {hour}',
'past_hour': '{hour} и {minute} минут',
'to_hour': 'без {minute} минут {hour}',
},
'time_of_day':{
'midnight': 'полночь',
'noon': 'полдень',
},
},
'uk':{
'_language': 'Українська',
'and': 'і',
'in': 'в',
'ago': 'тому',
'now': 'зараз',
'lose': 'зменшення',
'gain': 'збільшення',
'time':{
'format': '24-hr',
'year': [
'р',
'рік',
'роки',
],
'week': [
'тиж',
'тиждень',
'тижні',
],
'day': [
'д',
'день',
'дні',
],
'hour': [
'год',
'година',
'години',
],
'minute': [
'хв',
'хвилина',
'хвилини',
],
'second': [
'сек',
'секунда',
'секунди',
],
},
'delta':{
'today': 'сьогодні',
'tomorrow': 'завтра',
'yesterday': 'вчора',
'next': 'наступний',
'last': 'останній',
},
'days':[
"Понеділок",
"Вівторок",
"Середа",
"Четвер",
"П'ятниця",
"Субота",
"Неділя",
],
'months':[
'Січень',
'Лютий',
'Березень',
'Квітень',
'Травень',
'Червень',
'Липень',
'Серпень',
'Вересень',
'Жовтень',
'Листопад',
'Грудень',
],
'time_of_hour':{
0: '{hour} годин',
1: '{hour} годин(а) одна хвилина',
15: 'чверть на {hour}',
30: 'пів на {hour}',
45: 'за чверть {hour}',
59: 'за хвилину {hour}',
'past_hour': '{hour} та {minute} хвилин',
'to_hour': 'за {minute} хвилин {hour}',
},
'time_of_day':{
'midnight': 'опівночі',
'noon': 'опівдні',
},
},
'zh-Hans':{
'_language': '简体中文',
'and': '',
'in': '',
'ago': '之前',
'now': '现在',
'lose': '失去',
'gain': '获得',
'time':{
'format': '24-hr',
'year': [
'年',
'年',
'年',
],
'week': [
'周',
'星期',
'星期',
],
'day': [
'天',
'天',
'天',
],
'hour': [
'时',
'小时',
'小时',
],
'minute': [
'分',
'分钟',
'分钟',
],
'second': [
'秒',
'秒',
'秒',
],
},
'delta':{
'today': '今天',
'tomorrow': '明天',
'yesterday': '昨天',
'next': '下一个',
'last': '上一个',
},
'days':[
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
"星期日",
],
'months':[
'一月',
'二月',
'三月',
'四月',
'五月',
'六月',
'七月',
'八月',
'九月',
'十月',
'十一月',
'十二月',
],
'time_of_day':{
'midnight': '午夜',
'noon': '正午',
},
},
'ko':{
'_language':'Korean',
'and':'',
'in':'후',
'ago':'전',
'now':'지금',
'lose':'감소',
'gain':'증가',
'time':{
'format':'24-hr',
'year':[
'년',
'년',
'년',
],
'week':[
'주',
'주',
'주',
],
'day':[
'일',
'일',
'일',
],
'hour':[
'시',
'시간',
'시간',
],
'minute':[
'분',
'분',
'분',
],
'second':[
'초',
'초',
'초',
],
},
'delta':{
'today':'오늘',
'tomorrow':'내일',
'yesterday':'어제',
'next':'다음',
'last':'지난',
},
'days':[
'월요일',
'화요일',
'수요일',
'목요일',
'금요일',
'토요일',
'일요일',
],
'months':[
'1월',
'2월',
'3월',
'4월',
'5월',
'6월',
'7월',
'8월',
'9월',
'10월',
'11월',
'12월',
],
'time_of_day':{
'midnight':'자정',
'noon':'정오',
},
},
'cs': {
'_language': 'Čeština',
'and': 'a',
'in': 'za',
'ago': 'před %s',
'now': 'nyní',
'lose': 'ztratit',
'gain': 'získat',
'time': {
'format': '12-hodin',
'year': [
'rok',
'rok',
'roky'
],
'week': [
'týd',
'týden',
'týdny'
],
'day': [
'd',
'den',
'dny'
],
'hour': [
'hod',
'hodina',
'hodiny'
],
'minute': [
'min',
'minuta',
'minuty'
],
'second': [
'sek',
'sekunda',
'sekundy'
]
},
'delta': {
'today': 'dnes',
'tomorrow': 'zítra',
'yesterday': 'včera',
'next': 'příští',
'last': 'poslední'
},
'days': [
'Pondělí',
'Úterý',
'Středa',
'Čtvrtek',
'Pátek',
'Sobota',
'Neděle'
],
'months': [
'Leden',
'Únor',
'Březen',
'Duben',
'Květen',
'Červen',
'Červenec',
'Srpen',
'Září',
'Říjen',
'Listopad',
'Prosinec'
],
'time_of_hour': {
0: '{hour} hodin',
1: 'minuta po {hour}',
15: 'čtvrt na {hour}',
30: 'půl {hour}',
45: 'tři čtvrtě na {hour}',
59: 'minuta do {hour}',
'past_hour': '{minute} po {hour}',
'to_hour': '{minute} do {hour}'
},
'time_of_day': {
'midnight': 'půlnoc',
'noon': 'poledne'
}
}
} %}
{# DO NOT MODIFY BELOW THIS LINE #}
{% set valid_entity_id_pattern = '^(?!.+__)(?!_)[\\da-z_]+(?<!_)\\.(?!_)[\\da-z_]+(?<!_)$' %}
{% set _bad_value = '?' %}
{% set _durations = {
'year': 31536000,
@ -1091,10 +1568,10 @@
{%- endmacro -%}
{%- macro _check_for_duration_sensor(input) %}
{%- if input is string and input | regex_search('^(?!.+__)(?!_)[\da-z_]+(?<!_)\.(?!_)[\da-z_]+(?<!_)$') and input.startswith('sensor') and states[input] is not none and states[input].attributes.device_class is defined and states[input].attributes.unit_of_measurement is defined -%}
{%- if input is string and input | regex_search(valid_entity_id_pattern) and input.startswith('sensor') and states[input] is not none and states[input].attributes.device_class is defined and states[input].attributes.unit_of_measurement is defined -%}
{%- set obj = states[input] -%}
{%- set divisor = _duration_sensor.get(obj.attributes.unit_of_measurement) -%}
{{- (obj.state | float / divisor) | string | as_timedelta -}}
{%- set multiplier = _duration_sensor.get(obj.attributes.unit_of_measurement) -%}
{{- (obj.state | float * multiplier) | string | as_timedelta -}}
{%- else %}
{{- '' -}}
{%- endif -%}
@ -1116,7 +1593,7 @@
{#- assume time as string or entity_id -#}
{%- elif input is string and input not in ['', 'None'] -%}
{#- if entity_id -#}
{%- if input | regex_search('^(?!.+__)(?!_)[\da-z_]+(?<!_)\.(?!_)[\da-z_]+(?<!_)$') -%}
{%- if input | regex_search(valid_entity_id_pattern) -%}
{%- if attribute is not none and attribute is string -%}
{{- _to_datetime(state_attr(input, attribute), None) -}}
{%- elif input.startswith('input_datetime') and is_state_attr(input, 'has_date', False) -%}
@ -1201,7 +1678,7 @@
{%- set index = values.index(values | first | default) %}
{%- for item in values[index:] %}
{%- set duration = _durations.get(item, 1) %}
{%- set period = _periods.get(item, 1) %}
{%- set period = _periods.get(item, 0) %}
{%- set value = ((seconds // duration) % (period if period else duration)) | int %}
{%- if value > 0 or raw %}
{%- if ns.ret | length == 0 %}
@ -1252,8 +1729,8 @@
{%- endmacro %}
{%- macro _time_between(func, input1, attr1, utc1, input2, attr2, utc2) -%}
{%- set t1 = _to_datetime(input1, attr1, utc1) | as_datetime -%}
{%- set t2 = _to_datetime(input2, attr2, utc2) | as_datetime -%}
{%- set t1 = _to_datetime(input1, attr1, utc1) | as_datetime | as_local -%}
{%- set t2 = _to_datetime(input2, attr2, utc2) | as_datetime | as_local -%}
{%- if t1 is not none and t2 is not none -%}
{{- func(t1, t2) -}}
{%- else -%}
@ -1320,16 +1797,19 @@
{%- if uptime %}
{%- set value = _delta_seconds(now(), uptime) | int %}
{%- set seconds = value | abs %}
{%- set future = value / seconds > 0 %}
{%- set current = value == 0 %}
{%- set future = not current and value / seconds > 0 %}
{%- set items = _just_time(seconds, language, values, biggest, short=short, floor=floor) %}
{%- if future %}
{%- if current %}
{{- items }}
{%- elif future %}
{{- translate('in', language=language) }} {{ items }}
{%- else %}
{%- set t = translate('ago', language=language) %}
{%- if '%s' in t %}
{{ t % items }}
{{- t % items }}
{%- else %}
{{- items }} {{ translate('ago', language=language) }}
{{- items }} {{ t }}
{%- endif %}
{%- endif %}
{%- else %}
@ -1411,6 +1891,16 @@
{{- _next_weekday(weekday, -7) }}
{%- endmacro %}
{%- macro nearest_day(weekday) %}
{%- set today_timestamp = as_timestamp(today_at())|int %}
{%- set this_weekday_timestamp = as_timestamp(this_weekday(weekday))|int %}
{%- if today_timestamp < this_weekday_timestamp %}
{{- _next_weekday(weekday, 0) }}
{%- else %}
{{- _next_weekday(weekday, 7) }}
{%- endif %}
{%- endmacro %}
{%- macro days_in_month(month=None) %}
{%- set today = today_at() %}
{%- set input = month if month is not none else today.month %}
@ -1527,30 +2017,36 @@
{%- endif -%}
{%- endmacro -%}
{%- macro month(month=None, language=None) %}
{%- macro month(month=None, language=None, short=False) %}
{%- if month is datetime %}
{%- set idx = month.month - 1 %}
{%- elif month is integer and month > 0 %}
{%- set idx = (month - 1) % 12 %}
{%- elif month | regex_match(valid_entity_id_pattern) %}
{%- set idx = (states(month) | as_datetime | as_local).month - 1 %}
{%- else %}
{%- set idx = now().month - 1 %}
{%- endif %}
{{- translate('months', index=idx, language=language) }}
{%- set ret = translate('months', index=idx, language=language) %}
{{- ret[:3] if short else ret }}
{%- endmacro %}
{%- macro weekday(weekday=None, language=None) %}
{%- macro weekday(weekday=None, language=None, short=False) %}
{%- if weekday is datetime %}
{%- set idx = weekday.weekday() %}
{%- elif weekday is integer and weekday > 0 %}
{%- set idx = (weekday - 1) % 7 %}
{%- elif weekday | regex_match(valid_entity_id_pattern) %}
{%- set idx = (states(weekday) | as_datetime | as_local).weekday() %}
{%- else %}
{%- set idx = now().weekday() %}
{%- endif %}
{{- translate('days', index=idx, language=language) }}
{%- set ret = translate('days', index=idx, language=language) %}
{{- ret[:3] if short else ret }}
{%- endmacro %}
{%- macro count_the_days(input, attr, utc=False) %}
{%- set input = _to_datetime(input, attr, utc) | as_datetime %}
{%- set input = _to_datetime(input, attr, utc) | as_datetime | as_local %}
{%- set midnight = today_at() %}
{{- (input - midnight).days }}
{%- endmacro %}
@ -1561,7 +2057,7 @@
{%- set ns = namespace(days=[]) %}
{%- for i in range(-7, 14) %}
{%- set prefix = translate('delta', 'last', language=language) ~ ' ' if i < -1 else translate('delta', 'next', language=language) ~ ' ' if i > 6 else '' %}
{%- set ns.days = ns.days + [ (i | string, prefix ~ _days.get(i, weekday(midnight.weekday() + i + 1, language))) ] %}
{%- set ns.days = ns.days + [ (i | string, prefix ~ _days.get(i, weekday(midnight.weekday() + (i % 7) + 1, language))) ] %}
{%- endfor %}
{%- set collection = dict.from_keys(ns.days) %}
{%- set days = count_the_days(input, attr, utc) %}
@ -1577,7 +2073,7 @@
{%- if '%s' in t %}
{{- t % ret }}
{%- else %}
{{- ret }} {{ translate('ago', language=language) }}
{{- ret }} {{ t }}
{%- endif %}
{%- endif %}
{%- endif %}
@ -1586,16 +2082,20 @@
{%- macro hour(hour, language=None) %}
{%- if hour is datetime %}
{%- set hour = hour.hour %}
{%- elif hour | regex_match(valid_entity_id_pattern) %}
{%- set hour = (states(hour) | as_datetime | as_local).hour %}
{%- endif %}
{%- set _12 = not (hour % 12) %}
{%- set _24 = not (hour % 24) %}
{%- set _12hr = translate('time','format') == '12-hr' %}
{%- if _12 and _24 and _12hr %}
{%- set use_twelve = translate('time_of_day', 'use_twelve', language=language, fallback=false) %}
{%- set _12hr = translate('time','format', language=language) == '12-hr' %}
{%- if _12 and _24 and _12hr and not use_twelve %}
{{- translate('time_of_day', 'midnight', language=language) }}
{%- elif _12 and _12hr %}
{%- elif _12 and _12hr and not use_twelve %}
{{- translate('time_of_day', 'noon', language=language) }}
{%- else %}
{{- hour % 12 if _12hr else hour }}
{%- set ret = hour % 12 if _12hr else hour %}
{{- 12 if ret == 0 and use_twelve else ret }}
{%- endif %}
{%- endmacro %}
@ -1617,7 +2117,22 @@
{%- set hour_phrase = hour(this_hour, language=language) %}
{%- set minute_phrase = _phrase('minute', 60 * this_minute, language, True, True) if this_minute % 5 else this_minute | string %}
{%- endif %}
{%- if this_minute in [0, 1, 15, 30, 45, 59] %}
{%- set this_config = translate('time_of_hour', language=language) %}
{%- if (16 <= this_minute <= 29 and 'to_half_hour' in this_config) or (31 <= this_minute <= 44 and 'past_half_hour' in this_config) or (this_minute == 30 and 'half_hour' in this_config) %}
{%- set hour_phrase = hour(this_hour + 1, language=language) %}
{%- if 16 <= this_minute <= 29 %}
{%- set minute_calc = 30 - this_minute %}
{%- set fmat = translate('time_of_hour', 'to_half_hour', language=language) %}
{%- set minute_phrase = _phrase('minute', 60 * minute_calc, language, True, True) if this_minute % 5 else minute_calc | string %}
{%- elif 31 <= this_minute <= 44 %}
{%- set minute_calc = this_minute - 30 %}
{%- set fmat = translate('time_of_hour', 'past_half_hour', language=language) %}
{%- set minute_phrase = _phrase('minute', 60 * minute_calc, language, True, True) if this_minute % 5 else minute_calc | string %}
{%- else %}
{%- set minute_calc = None %}
{%- set fmat = translate('time_of_hour', 'half_hour', language=language) %}
{%- endif %}
{%- elif this_minute in [0, 1, 15, 30, 45, 59] %}
{%- if hour_phrase in ['noon', 'midnight'] and this_minute == 0 %}
{%- set fmat = '{hour}' %}
{%- else %}

View File

@ -1,234 +1,358 @@
{#
set phrases to be used in the relative_time_period macro
one list item per language, each time fraction contains a list with the singular, plural and abbriviated phrase
one list item per language, each time fraction contains a list with the short and several long forms of time units
combine contains the text to combine the last time fraction, and error the text to display on wrong date input
Plural forms for languages: https://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms
asian: ja, vi, ko
english: en, de, nl, sv, da, no, nb, nn, fo, es, pt, it, bg, el, fi, et, he, eo, hu, tr, ca
french: pt_BR, fr
latvian: lv
irish: ga
romanian: ro
lithuanian: lv
russian: ru, uk, be, sr, hr
slovak: cs, sk
polish: pl
slovenian: sl
arabic: ar
#}
{%- set _time_period_phrases = [
{
'language': 'en',
'plural_form': 'english',
'phrases': {
'year': ['year', 'years', 'yr'],
'month': ['month', 'months', 'mth'],
'week': ['week', 'weeks', 'wk'],
'day': ['day', 'days', 'day'],
'hour': ['hour', 'hours', 'hr'],
'minute': ['minute', 'minutes', 'min'],
'second': ['second', 'seconds', 'sec'],
'millisecond': ['millisecond', 'milliseconds', 'ms'],
'year': ['yr', 'year', 'years'],
'month': ['mth', 'month', 'months'],
'week': ['wk', 'week', 'weeks'],
'day': ['day', 'day', 'days'],
'hour': ['hr', 'hour', 'hours'],
'minute': ['min', 'minute', 'minutes'],
'second': ['sec', 'second', 'seconds'],
'millisecond': ['ms', 'millisecond', 'milliseconds'],
'combine': 'and',
'error': 'Invalid date',
}
},
{
'language': 'pl',
'plural_form': 'polish',
'phrases': {
'year': ['rok', 'lat', 'r'],
'month': ['miesiąc', 'miesięcy', 'msc'],
'week': ['tydzień', 'tygodni', 'tyg'],
'day': ['dzień', 'dni', 'dzień'],
'hour': ['godzina', 'godzin', 'godz'],
'minute': ['minuta', 'minut', 'min'],
'second': ['sekunda', 'sekund', 'sek'],
'millisecond': ['milisekunda', 'milisekund', 'ms'],
'year': ['r', 'rok', 'lata', 'lat'],
'month': ['msc', 'miesiąc', 'miesiące', 'miesięcy'],
'week': ['tyg', 'tydzień', 'tygodnie', 'tygodni'],
'day': ['dzień', 'dzień', 'dni', 'dni'],
'hour': ['godz', 'godzina', 'godziny', 'godzin'],
'minute': ['min', 'minuta', 'minuty', 'minut'],
'second': ['sek', 'sekunda', 'sekundy', 'sekund'],
'millisecond': ['ms', 'milisekunda', 'milisekundy', 'milisekund'],
'combine': 'i',
'error': 'Niepoprawna data',
}
},
{
'language': 'fr',
'plural_form': 'french',
'phrases': {
'year': ['année', 'années', 'an'],
'year': ['an', 'année', 'années'],
'month': ['mois', 'mois', 'mois'],
'week': ['semaine', 'semaines', 'sem'],
'day': ['jour', 'jours', 'j'],
'hour': ['heure', 'heures', 'h'],
'minute': ['minute', 'minutes', 'min'],
'second': ['seconde', 'secondes', 'sec'],
'millisecond': ['milliseconde', 'millisecondes', 'ms'],
'week': ['sem', 'semaine', 'semaines'],
'day': ['j', 'jour', 'jours'],
'hour': ['h', 'heure', 'heures'],
'minute': ['min', 'minute', 'minutes'],
'second': ['sec', 'seconde', 'secondes'],
'millisecond': ['ms', 'milliseconde', 'millisecondes'],
'combine': 'et',
'error': 'Date non valide',
}
},
{
'language': 'it',
'plural_form': 'english',
'phrases': {
'year': ['anno', 'anni', 'aa'],
'month': ['mese', 'mesi', 'mm'],
'week': ['settimana', 'settimane', 'set'],
'day': ['giorno', 'giorni', 'gg'],
'hour': ['ora', 'ore', 'h'],
'minute': ['minuto', 'minuti', 'min'],
'second': ['secondo', 'secondi', 'sec'],
'millisecond': ['millisecondo', 'millisecondi', 'ms'],
'year': ['aa', 'anno', 'anni'],
'month': ['mm', 'mese', 'mesi'],
'week': ['set', 'settimana', 'settimane'],
'day': ['gg', 'giorno', 'giorni'],
'hour': ['h', 'ora', 'ore'],
'minute': ['min', 'minuto', 'minuti'],
'second': ['sec', 'secondo', 'secondi'],
'millisecond': ['ms', 'millisecondo', 'millisecondi'],
'combine': 'e',
'error': 'Data non valida',
}
},
{
'language': 'nb',
'plural_form': 'english',
'phrases': {
'year': ['år', 'år', 'år'],
'month': ['måned', 'måneder', 'mnd'],
'week': ['uke', 'uker', 'u'],
'day': ['dag', 'dager', 'd'],
'hour': ['time', 'timer', 't'],
'minute': ['minutt', 'minutter', 'min'],
'second': ['sekund', 'sekunder', 'sek'],
'millisecond': ['millisekund', 'millisekunder', 'ms'],
'month': ['mnd', 'måned', 'måneder'],
'week': ['u', 'uke', 'uker'],
'day': ['d', 'dag', 'dager'],
'hour': ['t', 'time', 'timer'],
'minute': ['min', 'minutt', 'minutter'],
'second': ['sek', 'sekund', 'sekunder'],
'millisecond': ['ms', 'millisekund', 'millisekunder'],
'combine': 'og',
'error': 'Ugyldig dato',
}
},
{
'language': 'nl',
'plural_form': 'english',
'phrases': {
'year': ['jaar', 'jaar', 'jr'],
'month': ['maand', 'maanden', 'mnd'],
'week': ['week', 'weken', 'wk'],
'day': ['dag', 'dagen', 'dg'],
'hour': ['uur', 'uur', 'u'],
'minute': ['minuut', 'minuten', 'min'],
'second': ['seconde', 'seconden', 'sec'],
'millisecond': ['milliseconde', 'milliseconden', 'ms'],
'year': ['jr', 'jaar', 'jaar'],
'month': ['mnd', 'maand', 'maanden'],
'week': ['wk', 'week', 'weken'],
'day': ['dg', 'dag', 'dagen'],
'hour': ['u', 'uur', 'uur'],
'minute': ['min', 'minuut', 'minuten'],
'second': ['sec', 'seconde', 'seconden'],
'millisecond': ['ms', 'milliseconde', 'milliseconden'],
'combine': 'en',
'error': 'Ongeldige datum',
}
},
{
'language': 'nn',
'plural_form': 'english',
'phrases': {
'year': ['år', 'år', 'år'],
'month': ['månad', 'månader', 'mnd'],
'week': ['veke', 'veker', 'v'],
'day': ['dag', 'dagar', 'd'],
'hour': ['time', 'timar', 't'],
'minute': ['minutt', 'minutt', 'min'],
'second': ['sekund', 'sekund', 'sek'],
'millisecond': ['millisekund', 'millisekund', 'ms'],
'month': ['mnd', 'månad', 'månader'],
'week': ['v', 'veke', 'veker'],
'day': ['d', 'dag', 'dagar'],
'hour': ['t', 'time', 'timar'],
'minute': ['min', 'minutt', 'minutt'],
'second': ['sek', 'sekund', 'sekund'],
'millisecond': ['ms', 'millisekund', 'millisekund'],
'combine': 'og',
'error': 'Ugyldig dato',
}
},
{
'language': 'de',
'plural_form': 'english',
'phrases': {
'year': ['Jahr', 'Jahre', 'J.'],
'month': ['Monat', 'Monate', 'M.'],
'week': ['Woche', 'Wochen', 'Wo.'],
'day': ['Tag', 'Tage', 'Tg.'],
'hour': ['Stunde', 'Stunden', 'Std.'],
'minute': ['Minute', 'Minuten', 'Min.'],
'second': ['Sekunde', 'Sekunden', 'Sek.'],
'millisecond': ['Millisekunde', 'Millisekunden', 'ms'],
'year': ['J.', 'Jahr', 'Jahre'],
'month': ['M.', 'Monat', 'Monate'],
'week': ['Wo.', 'Woche', 'Wochen'],
'day': ['Tg.', 'Tag', 'Tage'],
'hour': ['Std.', 'Stunde', 'Stunden'],
'minute': ['Min.', 'Minute', 'Minuten'],
'second': ['Sek.', 'Sekunde', 'Sekunden'],
'millisecond': ['ms', 'Millisekunde', 'Millisekunden'],
'combine': 'und',
'error': 'Falsches Datum',
}
},
{
'language': 'pt',
'plural_form': 'english',
'phrases': {
'year': ['ano', 'anos', 'aa'],
'month': ['mês', 'meses', 'mm'],
'week': ['semana', 'semanas', 'sem'],
'day': ['dia', 'dias', 'd'],
'hour': ['hora', 'horas', 'h'],
'minute': ['minuto', 'minutos', 'min'],
'second': ['segundo', 'segundos', 'seg'],
'millisecond': ['millissegundo', 'millissegundos', 'ms'],
'year': ['aa', 'ano', 'anos'],
'month': ['mm', 'mês', 'meses'],
'week': ['sem', 'semana', 'semanas'],
'day': ['d', 'dia', 'dias'],
'hour': ['h', 'hora', 'horas'],
'minute': ['min', 'minuto', 'minutos'],
'second': ['seg', 'segundo', 'segundos'],
'millisecond': ['ms', 'millissegundo', 'millissegundos'],
'combine': 'e',
'error': 'Data Inválida',
}
},
{
'language': 'dk',
'plural_form': 'english',
'phrases': {
'year': ['år', 'år', 'år'],
'month': ['måned', 'måneder', 'mnd'],
'week': ['uge', 'uger', 'uge'],
'day': ['dag', 'dage', 'dag'],
'hour': ['time', 'timer', 't.'],
'minute': ['minut', 'minuter', 'min.'],
'second': ['sekund', 'sekunder', 'sek.'],
'millisecond': ['millisekund', 'millisekunder', 'ms.'],
'month': ['mnd', 'måned', 'måneder'],
'week': ['uge', 'uge', 'uger'],
'day': ['dag', 'dag', 'dage'],
'hour': ['t.', 'time', 'timer'],
'minute': ['min.', 'minut', 'minuter'],
'second': ['sek.', 'sekund', 'sekunder'],
'millisecond': ['ms.', 'millisekund', 'millisekunder'],
'combine': 'og',
'error': 'Ugyldig dato',
}
},
{
'language': 'sv',
'plural_form': 'english',
'phrases': {
'year': ['år', 'år', 'år'],
'month': ['månad', 'månader', 'mån'],
'week': ['vecka', 'veckor', 'v'],
'day': ['dag', 'dagar', 'dag'],
'hour': ['timme', 'timmar', 'tim'],
'minute': ['minut', 'minuter', 'min'],
'second': ['sekund', 'sekunder', 'sek'],
'millisecond': ['millisekund', 'millisekunder', 'ms'],
'month': ['mån', 'månad', 'månader'],
'week': ['v', 'vecka', 'veckor'],
'day': ['dag', 'dag', 'dagar'],
'hour': ['tim', 'timme', 'timmar'],
'minute': ['min', 'minut', 'minuter'],
'second': ['sek', 'sekund', 'sekunder'],
'millisecond': ['ms', 'millisekund', 'millisekunder'],
'combine': 'och',
'error': 'Ogiltigt datum',
}
},
{
'language': 'cs',
'plural_form': 'slovak',
'phrases': {
'year': ['rok', 'roky', 'rok'],
'month': ['měsíc', 'měsíce', 'měs'],
'week': ['týden', 'týdny', 'týd'],
'day': ['den', 'dny', 'd'],
'hour': ['hodina', 'hodiny', 'hod'],
'minute': ['minuta', 'minuty', 'min'],
'second': ['sekunda', 'sekundy', 'sek'],
'millisecond': ['millisekunda', 'millisekundy', 'ms'],
'year': ['rok', 'rok', 'roky', 'let'],
'month': ['měs', 'měsíc', 'měsíce', 'měsíců'],
'week': ['týd', 'týden', 'týdny', 'týd'],
'day': ['d', 'den', 'dny', 'd'],
'hour': ['hod', 'hodina', 'hodiny', 'hodin'],
'minute': ['min', 'minuta', 'minuty', 'minut'],
'second': ['sek', 'sekunda', 'sekundy', 'sekund'],
'millisecond': ['ms', 'millisekunda', 'millisekundy', 'millisekund'],
'combine': 'a',
'error': 'špatný datum'
'error': 'špatné datum'
}
},
{
'language': 'fi',
'plural_form': 'english',
'phrases': {
'year': ['vuosi', 'vuotta', 'v'],
'month': ['kuukausi', 'kuukautta', 'kk'],
'week': ['viikko', 'viikkoa', 'vk'],
'day': ['päivä', 'päivää', 'pv'],
'hour': ['tunti', 'tuntia', 't'],
'minute': ['minuutti', 'minuuttia', 'min'],
'second': ['sekunti', 'sekuntia', 's'],
'millisecond': ['millisekunti', 'millisekuntia', 'ms'],
'year': ['v', 'vuosi', 'vuotta'],
'month': ['kk', 'kuukausi', 'kuukautta'],
'week': ['vk', 'viikko', 'viikkoa'],
'day': ['pv', 'päivä', 'päivää'],
'hour': ['t', 'tunti', 'tuntia'],
'minute': ['min', 'minuutti', 'minuuttia'],
'second': ['s', 'sekunti', 'sekuntia'],
'millisecond': ['ms', 'millisekunti', 'millisekuntia'],
'combine': 'ja',
'error': 'Väärä päivämäärä',
}
},
{
'language': 'ru',
'plural_form': 'russian',
'phrases': {
'year': ['год', 'года', 'г'],
'month': ['месяц', 'месяцы', 'м'],
'week': ['неделя', 'недели', 'н'],
'day': ['день', 'дни', 'д'],
'hour': ['час', 'часы', 'ч'],
'minute': ['минута', 'минут', 'м'],
'second': ['секунд', 'секунды', 'с'],
'millisecond': ['милисекунд', 'милисекунды', 'мс'],
'year': ['г', 'год', 'года', 'лет'],
'month': ['м', 'месяц', 'месяца', 'месяцев'],
'week': ['н', 'неделя', 'недели', 'недель'],
'day': ['д', 'день', 'дня', 'дней'],
'hour': ['ч', 'час', 'часа', 'часов'],
'minute': ['м', 'минута', 'минуты', 'минут'],
'second': ['с', 'секунда', 'секунды', 'секунд'],
'millisecond': ['мс', 'миллисекунда', 'миллисекунды', 'миллисекунд'],
'combine': 'и',
'error': 'Неверная дата',
}
},
{
'language': 'uk',
'plural_form': 'russian',
'phrases': {
'year': ['рік', 'років', 'р'],
'month': ['місяць', 'місяців', 'м'],
'week': ['тиждень', 'тижнів', 'тижд'],
'day': ['день', 'днів', 'дн'],
'hour': ['годину', 'годин', 'год'],
'minute': ['хвилину', 'хвилин', 'хв'],
'second': ['секунду', 'секунд', 'сек'],
'millisecond': ['мілісекунду', 'мілісекунд', 'мсек'],
'year': ['р', 'рік', 'роки', 'років'],
'month': ['м', 'місяць', 'місяці', 'місяців'],
'week': ['тижд', 'тиждень', 'тижні', 'тижнів'],
'day': ['дн', 'день', 'дні', 'днів'],
'hour': ['год', 'година', 'години', 'годин'],
'minute': ['хв', 'хвилина', 'хвилини', 'хвилин'],
'second': ['сек', 'секунда', 'секунди', 'секунд'],
'millisecond': ['мсек', 'мілісекунда', 'мілісекунди', 'мілісекунд'],
'combine': 'та',
'error': 'Недійсна дата',
}
},
{
'language': 'bg',
'plural_form': 'english',
'phrases': {
'year': ['г', 'година', 'години'],
'month': ['м', 'месец', 'месеца'],
'week': ['седм', 'седмица', 'седмици'],
'day': ['д', 'ден', 'дни'],
'hour': ['ч', 'час', 'часа'],
'minute': ['м', 'минута', 'минути'],
'second': ['с', 'секунда', 'секунди'],
'millisecond': ['мс', 'милисекунда', 'милисекунди'],
'combine': 'и',
'error': 'Невалидна дата',
}
},
{
'language': 'vi',
'plural_form': 'asian',
'phrases': {
'year': ['y', 'năm'],
'month': ['m', 'tháng'],
'week': ['w', 'tuần'],
'day': ['d', 'ngày'],
'hour': ['h', 'giờ'],
'minute': ['m', 'phút', 'phút'],
'second': ['s', 'giây'],
'millisecond': ['ms', 'mili giây'],
'combine': 'và',
'error': 'Ngày không hợp lệ',
}
},
{
'language': 'es',
'plural_form': 'english',
'phrases': {
'year': ['a', 'año', 'años'],
'month': ['m', 'mes', 'meses'],
'week': ['sem', 'semana', 'semanas'],
'day': ['d', 'día', 'días'],
'hour': ['h', 'hora', 'horas'],
'minute': ['min', 'minuto', 'minutos'],
'second': ['s', 'segundo', 'segundos'],
'millisecond': ['ms', 'milisegundo', 'milisegundos'],
'combine': 'y',
'error': 'Fecha inválida',
}
},
{
'language': 'he',
'plural_form': 'english',
'phrases': {
'year': ['שנה', 'שנה', 'שנים'],
'month': ['חודש', 'חודש', 'חודשים'],
'week': ['שבוע', 'שבוע', 'שבועות'],
'day': ['יום', 'יום', 'ימים'],
'hour': ['שעה', 'שעה', 'שעות'],
'minute': ['דקה', 'דקה', 'דקות'],
'second': ['שניה', 'שניה', 'שניות'],
'millisecond': ['מילי', 'מילישניה', 'מילישניות'],
'combine': 'ו',
'error': 'תאריך לא חוקי',
}
},
{
'language': 'hu',
'plural_form': 'english',
'phrases': {
'year': ['é', 'év', 'év'],
'month': ['hó', 'hónap', 'hónap'],
'week': ['hét', 'hét', 'hét'],
'day': ['n', 'nap', 'nap'],
'hour': ['ó', 'óra', 'óra'],
'minute': ['p', 'perc', 'perc'],
'second': ['mp', 'másodperc', 'másodperc'],
'millisecond': ['ms', 'ezredmásodperc', 'ezredmásodperc'],
'combine': 'és',
'error': 'Érvénytelen dátum',
}
},
{
'language': 'tr',
'plural_form': 'english',
'phrases': {
'year': ['yıl', 'yıl', 'yıl'],
'month': ['ay', 'ay', 'ay'],
'week': ['hf', 'hafta', 'hafta'],
'day': ['gün', 'gün', 'gün'],
'hour': ['sa', 'saat', 'saat'],
'minute': ['dk', 'dakika', 'dakika'],
'second': ['sn', 'saniye', 'saniye'],
'millisecond': ['ms', 'milisaniye', 'milisaniye'],
'combine': 've',
'error': 'Geçersiz tarih',
}
},
] -%}
{# macro to convert the abbreviated input for the not_use and always_show lists to the full time part names #}
@ -256,6 +380,8 @@
{%- set compare_date = compare_date if compare_date is datetime else compare_date | as_datetime('invalid') -%}
{%- set time = time | bool(true) -%}
{%- set parts = [parts | int(1), always_show | count] | max -%}
{# create namespace to store debug data #}
{%- set debug = namespace(debug="") -%}
{# 1: check if date input is correct #}
{%- if date is datetime and compare_date is datetime -%}
{# convert date input to local or date only #}
@ -354,7 +480,7 @@
{%- set first = keys | select('in', always_show | default([], true) + [first]) | first -%}
{%- set to_use = keys[keys.index(first):] -%}
{%- set to_output = to_use[:parts] -%}
{%- set last = to_output | last |default('millisecond') -%}
{%- set last = dur.items() | selectattr('0', 'in', to_output) | map(attribute='0') | list | last | default('millisecond') -%}
{# 3: check if there is anything left to use #}
{%- if to_use -%}
{%- set to_output = to_use[:parts] -%}
@ -365,9 +491,10 @@
{%- set to_reject = to_use | reject('in', to_output) | reject('in', always_show) | list -%}
{%- set not_use = not_use + to_output[as_check*-1:] + to_reject -%}
{%- set to_output = to_output | reject('in', not_use) | list + always_show -%}
{%- set to_output = keys | select('in', to_output) | list -%}
{%- set to_output = keys | select('in', to_output) | list + ['extra']-%}
{%- set output = time_split(date, parts, compare_date, not_use, always_show, time, round_mode) | from_json -%}
{%- endif -%}
{# apply round if needed #}
{%- if round_mode in ['common', 'ceil'] and last != 'millisecond' -%}
{# determine first and last item with data #}
@ -376,22 +503,59 @@
{%- set remain_part = remain / dur[last] -%}
{%- set to_round = 1 if remain_part >= 0.5 and round_mode == 'common' else remain_part | round(0, round_mode) -%}
{%- set sec_to_add = ((dur[last] + (dur.day if last in ['year', 'month'] else 1) - remain) | round(0, 'ceil') * to_round) / 1000 -%}
{%- set round_mode = 'floor' -%}
{%- set date_max = [compare_date, date] | max + timedelta(seconds=sec_to_add) -%}
{%- set date_min = [compare_date, date] | min -%}
{%- set output = time_split(date_max, parts, date_min, not_use, always_show, time, round_mode) | from_json -%}
{%- set output = time_split(date_max, parts, date_min, not_use, always_show, time, 'floor') | from_json -%}
{%- set output = dict(output.items() | selectattr('0', 'in', do_use)) -%}
{%- set keys = output.keys() | list -%}
{%- set with_value = output.items() | rejectattr('1', 'eq', 0) | map(attribute='0') | list -%}
{%- set first = with_value | first | default('millisecond') -%}
{%- set first = keys | select('in', always_show | default([], true) + [first]) | first -%}
{%- set to_use = keys[keys.index(first):] -%}
{%- set to_output = to_use[:parts] -%}
{%- endif -%}
{# output result #}
{%- set zero_values = output.items() | selectattr('1', 'eq', 0) | map(attribute='0') | list -%}
{%- set reject_list = zero_values | reject('in', always_show) | list -%}
{{- dict(output.items() | selectattr('0', 'in', to_output) | rejectattr('0', 'in', reject_list)) | default({always_return: 0}, true) | to_json -}}
{%- else -%} {{- dict(error='No time parts left to output') | to_json -}}
{{- dict(output.items() | selectattr('0', 'in', to_output) | rejectattr('0', 'in', reject_list), **dict(debug=debug.debug) if debug.debug else dict()) | default({always_return: 0}, true) | to_json-}}
{%- else -%} {{- dict(error='No time parts left to output') -}}
{%- endif -%} {# 3 #}
{%- endif -%} {# 2 #}
{%- else -%} {{- dict(error='Invalid date input') | to_json -}}
{%- else -%} {{- dict(error='Invalid date input')-}}
{%- endif -%} {# 1 #}
{%- endmacro -%}
{# macro for determining the time unit variant depending on the language #}
{%- macro plural(number=0, rule='english') -%}
{%- set mod100 = number % 100 -%}
{%- set mod10 = number % 10 -%}
{%- set form = 1 -%}
{%- if rule == 'english' -%}
{%- set form = 1 if number == 1 else 2 -%}
{%- elif rule == 'french' -%}
{%- set form = 1 if number <= 1 else 2 -%}
{%- elif rule == 'latvian' -%}
{%- set form = 1 if (mod10 == 1 and mod100 != 11) else 2 if number != 0 else 3 -%}
{%- elif rule == 'irish' -%}
{%- set form = 1 if number == 1 else 2 if number == 2 else 3 -%}
{%- elif rule == 'romanian' -%}
{%- set form = 1 if number == 1 else 2 if (number == 0 or (mod100 > 0 and mod100 < 20 )) else 3 -%}
{%- elif rule == 'lithuanian' -%}
{%- set form = 1 if (mod10 == 1 and mod100 != 11) else 2 if (mod10 >= 2 and (mod100 < 10 or mod100 >= 20)) else 3 -%}
{%- elif rule == 'russian' -%}
{%- set form = 1 if (mod10 == 1 and mod100 != 11) else 2 if (mod10 >= 2 and mod10 <= 4 and (mod100 < 10 or mod100 >= 20)) else 3 -%}
{%- elif rule == 'slovak' -%}
{%- set form = 1 if number == 1 else 2 if (number >= 2 and number <= 4) else 3 -%}
{%- elif rule == 'polish' -%}
{%- set form = 1 if number == 1 else 2 if (mod10 >= 2 and mod10 <= 4 and (mod100 < 10 or mod100 >= 20)) else 3 -%}
{%- elif rule == 'slovenian' -%}
{%- set form = 1 if mod100 == 1 else 2 if mod100 == 2 else 3 if (mod100 == 3 or mod100 == 4) else 4 -%}
{%- elif rule == 'arabic' -%}
{%- set form = 1 if number == 0 else 2 if number == 1 else 3 if number == 2 else 4 if (mod100 >= 3 and mod100 <= 10) else 5 if mod100 >= 11 else 6 -%}
{%- endif -%}
{{- form -}}
{%- endmacro -%}
{# macro to output a timedelta in a readable format #}
{%- macro relative_time_plus(date, parts=1, abbr=false, language='en', compare_date=now(), not_use=['millisecond'], always_show=[], time=true, round_mode='floor') -%}
{#- select correct phrases bases on language input #}
@ -399,6 +563,7 @@
{%- set languages = phrases | map(attribute='language') | list -%}
{%- set language = iif(language in languages, language, 'en') -%}
{%- set phr = phrases | selectattr('language', 'eq', language) | map(attribute='phrases') | list | first -%}
{%- set plural_form = phrases | selectattr('language', 'eq', language) | map(attribute='plural_form') | list | first -%}
{%- set abbr = abbr | bool(false) -%}
{# split timedelta #}
{%- set time_parts = time_split(date, parts, compare_date, not_use, always_show, time, round_mode) | from_json -%}
@ -409,9 +574,9 @@
{# convert to phrases #}
{%- set ns = namespace(phrases=[]) -%}
{%- for i in time_parts.keys() -%}
{%- set phr_abbr = phr[i][2] -%}
{%- set phr_verb = phr[i][1] if time_parts[i] != 1 else phr[i][0] -%}
{%- set phrase = '{} {}'.format(time_parts[i], phr_abbr if abbr else phr_verb) -%}
{%- set plural_variant = plural(time_parts[i], plural_form) | int -%}
{%- set phr_form = phr[i][0] if abbr else phr[i][plural_variant] -%}
{%- set phrase = '{} {}'.format(time_parts[i], phr_form) -%}
{%- set ns.phrases = ns.phrases + [phrase] -%}
{%- endfor -%}
{#- join phrases in a string, using phr.combine for the last item #}

View File

@ -27,14 +27,23 @@
{% set period_str = period_str(team) %}
{% set game_clock = state_attr(team,'clock') | lower %}
{% if state_attr(team,'league') == 'MLB' %}
{% set inning_parts = game_clock.split(' ') %}
in the {{ inning_parts[0] ~ ' of the ' ~ inning_parts[1] ~ ' ' ~ period_str }}
{% if 'rain delay' in game_clock %}
{# Handle cases like "Rain Delay, Top 1st" #}
{% set status, inning = game_clock.split(',', 1) %}
{% set inning_parts = inning.split(' ') %}
in a {{ status | trim }} in the {{ inning_parts[1] ~ ' of the ' ~ inning_parts[2] }} {{ period_str }}
{% else %}
{% set inning_parts = game_clock.split(' ') %}
in the {{ inning_parts[0] ~ ' of the ' ~ inning_parts[1] ~ ' ' ~ period_str }}
{% endif %}
{% else %}
{% if ' - ' in game_clock %}
{% set clock_time, quarter = game_clock.split(' - ') %}
with {{ clock_time ~ ' remaining in the ' ~ quarter ~ ' ' ~ period_str }}
{% else %}
with {{ game_clock ~ ' remaining in the ' ~ period_str }}
{% if quarter == 'ot' %}
with {{ clock_time ~ ' remaining in overtime' }}
{% else %}
with {{ clock_time ~ ' remaining in the ' ~ quarter ~ ' ' ~ period_str }}
{% endif %}
{% endif %}
{% endif %}
{% endmacro %}

View File

@ -19,15 +19,15 @@
{% if type in ['alerts','full'] %}
{% if is_state('input_boolean.tornado_alarm','on') %}
We are under a tornado warning. If you are not already in shelter, you should be. Get on it!
{% if state_attr('binary_sensor.tornado_warning','confirmed' == true) %}
{% if state_attr('binary_sensor.tornado_warning','confirmed') == true %}
A tornado has been confirmed in the area. Please take shelter immediately!
{% endif %}
{% elif is_state('binary_sensor.severe_thunderstorm_warning','on') %}
We are under a severe thunderstorm warning.
{% if state_attr('binary_sensor.severe_thunderstorm_warning','tornado_possible' == true) %}
{% if state_attr('binary_sensor.severe_thunderstorm_warning','tornado_possible') == true %}
The incoming storm has the potential to produce a tornado, so please pay attention and prepare to take shelter!
{% endif %}
{% if state_attr('binary_sensor.severe_thunderstorm_warning','considerable_destructive' == true) %}
{% if state_attr('binary_sensor.severe_thunderstorm_warning','considerable_destructive') == true %}
This storm has the potential to cause considerable damage. Please take shelter and stay safe!
{% endif %}
{% elif states('sensor.weatheralerts_active_alerts') > '0' and method != 'dashboard' %}
@ -39,7 +39,22 @@
There is lightning in the area. Nearest strike is {{ ltgdist }} miles away.
{% endif %}
{% if is_state('binary_sensor.raining','on') %}
It is currently raining. Make sure all doors and windows are closed!
{% if states('sensor.home_tempest_cloud_sensors_precipitation_intensity') not in ['unavailable','unknown','no_rain'] %}
{% set intensity = states('sensor.home_tempest_cloud_sensors_precipitation_intensity') %}
{% if intensity == 'very_light' %}
There is currently a very light drizzle falling.
{% elif intensity == 'light' %}
There is currently light rain falling. Front porch windows should be okay, but other windows should be closed.
{% elif intensity == 'moderate' %}
It is raining pretty good outside, you should probably make sure all windows are closed.
{% elif intensity in ['heavy','very_heavy'] %}
There is heavy rain falling, please make sure all doors and windows are closed at this time.
{% elif intensity == 'extreme' %}
It is raining extremely hard outside. Make sure all doors and windows are closed, and I recommend staying inside until it calms down. Perhaps check for roof leaks as well.
{% endif %}
{% else %}
It is currently raining. Make sure all doors and windows are closed!
{% endif %}
{% endif %}
{% endif %}
{% if state_attr('weather.iron_nerd_weather_station','visibility') | int < 3 %}
@ -60,15 +75,15 @@
{% endif %}
{% if is_state('input_boolean.tornado_alarm','on') %}
"We are under a tornado warning. If you are not already in shelter, you should be. Get on it! "
{% if state_attr('binary_sensor.tornado_warning','confirmed' == true) %}
{% if state_attr('binary_sensor.tornado_warning','confirmed') == true %}
"A tornado has been confirmed in the area. Please take shelter immediately! "
{% endif %}
{% elif is_state('binary_sensor.severe_thunderstorm_warning','on') %}
"We are under a severe thunderstorm warning. "
{% if state_attr('binary_sensor.severe_thunderstorm_warning','tornado_possible' == true) %}
{% if state_attr('binary_sensor.severe_thunderstorm_warning','tornado_possible') == true %}
"The incoming storm has the potential to produce a tornado, so please pay attention and prepare to take shelter! "
{% endif %}
{% if state_attr('binary_sensor.severe_thunderstorm_warning','considerable_destructive' == true) %}
{% if state_attr('binary_sensor.severe_thunderstorm_warning','considerable_destructive') == true %}
"This storm has the potential to cause considerable damage. Please take shelter and stay safe! "
{% endif %}
{% elif is_state('input_boolean.tornado_watch','on') %}
@ -90,12 +105,49 @@
"The nearest lightning strike is {{ ltgdist }} miles away. "
{% endif %}
{% if is_state('binary_sensor.raining','on') %}
{{ [
"I have looked outside and determined that it is raining. ",
"If you look outside the window, you will notice, it wainin. ",
"It wainin sideways! ",
"There appears to be excessive moisture currently falling from the sky. Plan accordingly. ",
] | random }}
{% if states('sensor.home_tempest_cloud_sensors_precipitation_intensity') not in ['unavailable','unknown','no_rain'] %}
{% set intensity = states('sensor.home_tempest_cloud_sensors_precipitation_intensity') %}
{% if intensity == 'very_light' %}
{{ [
"There is currently a very light drizzle falling. ",
"It is drizzling outside, but it is not too bad. ",
"The sky is spitting on us. That's not very nice, but a mild inconvenience at most. "
] | random }}
{% elif intensity == 'light' %}
{{ [
"There is currently light rain falling. ",
"It is raining lightly outside, but it is not too bad. ",
"It kinda wainin outside, but just a little. "
] | random }}
"Front porch windows should be okay, but other windows should be closed. "
{% elif intensity == 'moderate' %}
{{ [
"It is raining pretty good outside, you should probably make sure all windows are closed. ",
"It is raining at a decent rate outside, please make sure all windows are closed. "
"If you look outside, you will see that it wainin. "
] | random }}
{% elif intensity in ['heavy','very_heavy'] %}
{{ [
"There is heavy rain falling, please make sure all doors and windows are closed at this time. ",
"It is raining heavily outside, please make sure all doors and windows are closed. ",
"It wainin sideways! Please make sure all doors and windows are closed. "
] | random }}
{% elif intensity == 'extreme' %}
{{ [
"It is raining extremely hard outside. ",
"There is a torrential downpour outside. ",
"Holy crap, I have never seen it rain this hard before. "
] | random }}
"Make sure all doors and windows are closed, and I recommend staying inside until it calms down. Perhaps check for roof leaks as well. "
{% endif %}
{% else %}
{{ [
"I have looked outside and determined that it is raining. ",
"If you look outside the window, you will notice, it wainin. ",
"It wainin sideways! ",
"There appears to be excessive moisture currently falling from the sky. Plan accordingly. ",
] | random }}
{% endif %}
{% endif %}
{% if (state_attr('weather.iron_nerd_weather_station','visibility') | int ) < 3 %}
{{ [

View File

@ -239,6 +239,9 @@ script:
server_maintenance_annc:
alias: Server Maintenance Announcement
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.server_maintenance
- service: script.status_annc
data:
who: "{{ who|default('everywhere') }}"
@ -248,6 +251,9 @@ script:
server_maintenance_done_annc:
alias: Server Maintenance Done Announcement
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.server_maintenance
- service: script.status_annc
data:
who: "{{ who|default('everywhere') }}"

View File

@ -116,16 +116,6 @@ template:
unique_id: 2ce31844-b115-42b8-8213-feccf24e236c
state: "{{ state_attr('climate.master_bedroom_aircon','temperature') | float }}"
availability: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
- name: "Master Bedroom Eco Mode"
unique_id: edf36e23-adcf-4506-80eb-a14f4ea2fce0
state: "{{ is_state_attr('climate.master_bedroom_aircon','eco_mode',true) }}"
icon: >-
{% if is_state_attr('climate.master_bedroom_aircon','eco_mode',true) %}
mdi:home-lightning-bolt
{% else %}
mdi:home-lightning-bolt-outline
{% endif %}
availability: "{{ states('climate.master_bedroom_aircon') not in ['unavailable','unknown'] }}"
- name: "Master Bedroom Aircon Fan Mode"
unique_id: c0e4f9ba-0c6c-4673-9a75-13f253f2f2e8
state: "{{ state_attr('climate.master_bedroom_aircon','fan_mode') }}"
@ -146,16 +136,6 @@ template:
unique_id: b81152a1-d4d9-4e3e-8a78-6039de2884ad
state: "{{ state_attr('climate.emma_bedroom_aircon','temperature') | float }}"
availability: "{{ states('climate.emma_bedroom_aircon') not in ['unavailable','unknown'] }}"
- name: "Emma Bedroom Eco Mode"
unique_id: 4b6fc8fc-4152-4d8b-ad8d-80f97fcabe44
state: "{{ is_state_attr('climate.emma_bedroom_aircon','eco_mode',true) }}"
icon: >-
{% if is_state_attr('climate.emma_bedroom_aircon','eco_mode',true) %}
mdi:home-lightning-bolt
{% else %}
mdi:home-lightning-bolt-outline
{% endif %}
availability: "{{ states('climate.emma_bedroom_aircon') not in ['unavailable','unknown'] }}"
- name: "Emma Bedroom Aircon Fan Mode"
unique_id: d678eb2e-be5b-4626-913d-fc1e32941ead
state: "{{ state_attr('climate.emma_bedroom_aircon','fan_mode') }}"

View File

@ -3,6 +3,7 @@ weather:
name: "Iron Nerd Weather Station"
condition_template: >
{% set stations = [
states.weather.home_tempest_forecast_home,
states.weather.home,
states.weather.kdfi_daynight,
states.weather.iron_nerd_studios,
@ -12,6 +13,7 @@ weather:
{{ states(result) }}
temperature_template: >
{% set temps = [
states.sensor.home_tempest_temperature,
states.sensor.home_temperature,
states.sensor.kdfi_temperature,
states.sensor.pirateweather_temperature,
@ -20,8 +22,28 @@ weather:
{% set sensor = temps | selectattr('state','ne','unavailable') | selectattr('state','ne','unknown') | map(attribute='entity_id') | list | first %}
{{ states(sensor) | float }}
temperature_unit: °F
dew_point_template: >
{% set dewpoints = [
states.sensor.home_tempest_dew_point,
states.sensor.home_dew_point,
states.sensor.kdfi_dew_point,
states.sensor.pirateweather_dew_point,
states.sensor.openweathermap_dew_point
] %}
{% set sensor = dewpoints | selectattr('state','ne','unavailable') | selectattr('state','ne','unknown') | map(attribute='entity_id') | list | first %}
{{ states(sensor) | float }}
apparent_temperature_template: >
{% set apparent_temps = [
states.sensor.home_tempest_feels_like,
states.sensor.home_temperature_feels_like,
states.sensor.pirateweather_apparent_temperature,
states.sensor.stratton_ave_apparent_temperature
] %}
{% set sensor = apparent_temps | selectattr('state','ne','unavailable') | selectattr('state','ne','unknown') | map(attribute='entity_id') | list | first %}
{{ states(sensor) | float }}
humidity_template: >
{% set humidity = [
states.sensor.home_tempest_humidity,
states.sensor.home_relative_humidity,
states.sensor.kdfi_relative_humidity,
states.sensor.pirateweather_humidity,
@ -40,12 +62,14 @@ weather:
{{ forecasts | selectattr('forecast','defined') | map(attribute='forecast') | list | first }}
forecast_hourly_template: >
{% set forecasts = [
states.sensor.weather_com_hourly_weather_forecast,
states.sensor.weather_com_hourly_weather_forecast.attributes,
states.sensor.pirateweather_hourly_weather_forecast.attributes
] %}
{{ forecasts | selectattr('forecast','defined') | map(attribute='forecast') | list | first }}
pressure_template: >
{% set pressures = [
states.sensor.home_tempest_local_slp,
states.sensor.home_tempest_cloud_sensors_sea_level_pressure,
states.sensor.home_pressure,
states.sensor.kdfi_barometric_pressure
] %}
@ -92,6 +116,7 @@ weather:
name: "Iron Nerd Weather Station - Hourly"
condition_template: >
{% set stations = [
states.weather.home_tempest_forecast_home,
states.weather.home,
states.weather.tomorrow_io_stratton_ave_hourly,
states.weather.iron_nerd_studios,
@ -102,6 +127,7 @@ weather:
{{ states(result) }}
temperature_template: >
{% set temps = [
states.sensor.home_tempest_temperature,
states.sensor.home_temperature,
states.sensor.kdfi_temperature,
states.sensor.pirateweather_temperature,
@ -110,8 +136,28 @@ weather:
{% set sensor = temps | selectattr('state','ne','unavailable') | selectattr('state','ne','unknown') | map(attribute='entity_id') | list | first %}
{{ states(sensor) | float }}
temperature_unit: °F
dew_point_template: >
{% set dewpoints = [
states.sensor.home_tempest_dew_point,
states.sensor.home_dew_point,
states.sensor.kdfi_dew_point,
states.sensor.pirateweather_dew_point,
states.sensor.openweathermap_dew_point
] %}
{% set sensor = dewpoints | selectattr('state','ne','unavailable') | selectattr('state','ne','unknown') | map(attribute='entity_id') | list | first %}
{{ states(sensor) | float }}
apparent_temperature_template: >
{% set apparent_temps = [
states.sensor.home_tempest_feels_like,
states.sensor.home_temperature_feels_like,
states.sensor.pirateweather_apparent_temperature,
states.sensor.stratton_ave_apparent_temperature
] %}
{% set sensor = apparent_temps | selectattr('state','ne','unavailable') | selectattr('state','ne','unknown') | map(attribute='entity_id') | list | first %}
{{ states(sensor) | float }}
humidity_template: >
{% set humidity = [
states.sensor.home_tempest_humidity,
states.sensor.home_relative_humidity,
states.sensor.kdfi_relative_humidity,
states.sensor.pirateweather_humidity,
@ -121,13 +167,15 @@ weather:
{{ states(result) | float }}
forecast_hourly_template: >
{% set forecasts = [
states.sensor.weather_com_hourly_weather_forecast,
states.sensor.weather_com_hourly_weather_forecast.attributes,
states.weather.tomorrow_io_stratton_ave_hourly.attributes,
states.sensor.pirateweather_hourly_weather_forecast.attributes
] %}
{{ forecasts | selectattr('forecast','defined') | map(attribute='forecast') | list | first }}
pressure_template: >
{% set pressures = [
states.sensor.home_tempest_local_slp,
states.sensor.home_tempest_cloud_sensors_sea_level_pressure,
states.sensor.home_pressure,
states.sensor.kdfi_barometric_pressure
] %}
@ -322,6 +370,60 @@ sensor:
# days: 7
template:
- trigger:
- platform: time_pattern
minutes: /15
- platform: state
entity_id: weather.home_tempest_forecast_home
- platform: homeassistant
event: start
action:
- service: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.home_tempest_forecast_home
response_variable: daily
- variables:
today: "{{ daily['weather.home_tempest_forecast_home'].forecast[0] }}"
sensor:
- name: Weatherflow Daily Weather Forecast
unique_id: 2c70c4ee-7f7f-42b4-ad40-90ce2b6c6d77
state: "{{ now().isoformat() }}"
attributes:
forecast: "{{ daily['weather.home_tempest_forecast_home'].forecast }}"
- name: Weatherflow High
unique_id: 296b4361-459a-48e7-9793-c003b88fcdef
state: "{{ today.temperature }}"
unit_of_measurement: °F
- name: Weatherflow Low
unique_id: 61c344be-33d3-4e1d-8d0d-277c2b850c0d
state: "{{ today.templow }}"
unit_of_measurement: °F
- name: Weatherflow Rain Chance Today
unique_id: ab0327ff-f20f-4d16-aeb5-78682b3e2397
state: "{{ today.precipitation_probability }}"
unit_of_measurement: "%"
- trigger:
- platform: time_pattern
minutes: /15
- platform: state
entity_id: weather.home_tempest_forecast_home
- platform: homeassistant
event: start
action:
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: weather.home_tempest_forecast_home
response_variable: hourly
sensor:
- name: Weatherflow Hourly Weather Forecast
unique_id: aa0b368c-ea23-4514-a697-e122353eb76d
state: "{{ now().isoformat() }}"
attributes:
forecast: "{{ hourly['weather.home_tempest_forecast_home'].forecast }}"
- trigger:
- platform: time_pattern
minutes: /15
@ -668,10 +770,10 @@ template:
{% endif %}
- name: "Lightning Warning"
unique_id: edaddfc4-f7f0-4d75-aada-a2c588afe029
state: "{{ states('sensor.blitzortung_lightning_counter') | int > 0 }}"
state: "{{ states('sensor.home_tempest_cloud_sensors_lightning_strikes_last_hour') | int > 0 }}"
device_class: safety
attributes:
current_strikes: "{{ states('sensor.blitzortung_lightning_counter') | int }}"
current_strikes: "{{ states('sensor.home_tempest_cloud_sensors_lightning_strikes_last_hour') | int }}"
icon: "{{ 'mdi:flash-alert' if states('sensor.blitzortung_lightning_counter') | int > 0 else 'mdi:flash-outline'}}"
- name: "Audible Weather Alerts Allowed"
unique_id: 03851823-32d5-44c1-af42-256fcd922069
@ -701,52 +803,57 @@ template:
- name: Raining
unique_id: 232b43a4-4598-4315-ab76-42348c11e6ff
state: >
{{ states('sensor.total_rain_sensors') | int > 1 }}
icon: "{{ 'mdi:weather-rainy' if states('sensor.total_rain_sensors') | int > 1 else 'mdi:weather-cloudy' }}"
{{ states('sensor.home_tempest_precipitation_intensity') | float > 0 or
states('sensor.home_tempest_precipitation_type') in ['rain','hail','rain_hail'] or
states('sensor.home_tempest_cloud_sensors_precipitation_description') in ['rain','heavy_rain'] or
is_state('binary_sensor.home_tempest_cloud_binary_sensors_is_raining','on') }}
icon: "{{ 'mdi:weather-rainy' if this.state == 'on' else 'mdi:weather-cloudy' }}"
- sensor:
- name: Total Rain Sensors
unique_id: b7c2e709-8f5c-4263-aa1d-fa8280afcddb
unit_of_measurement: 'sensors'
state: >
{% set sensors = [
states.sensor.pirateweather_precip,
states.sensor.openweathermap_precipitation_kind,
states.sensor.tomorrow_io_stratton_ave_precipitation_type
] %}
{% set numeric_sensors = [
states.sensor.stratton_ave_precipitation
] %}
{% set c1 = sensors | selectattr('state','eq','rain') | list | count %}
{% set c2 = numeric_sensors | map(attribute='state') | map('float') | select('gt',0) | list | count %}
{{ (c1 + c2) | int }}
# - name: Total Rain Sensors
# unique_id: b7c2e709-8f5c-4263-aa1d-fa8280afcddb
# unit_of_measurement: 'sensors'
# state: >
# {% set sensors = [
# states.sensor.home_tempest_precipitation_type,
# states.sensor.pirateweather_precip,
# states.sensor.openweathermap_precipitation_kind,
# states.sensor.tomorrow_io_stratton_ave_precipitation_type
# ] %}
# {% set numeric_sensors = [
# states.sensor.home_tempest_precipitation_intensity,
# states.sensor.stratton_ave_precipitation
# ] %}
# {% set c1 = sensors | selectattr('state','eq','rain') | list | count %}
# {% set c2 = numeric_sensors | map(attribute='state') | map('float') | select('gt',0) | list | count %}
# {{ (c1 + c2) | int }}
- name: Current Forecast
unique_id: c0faea33-2ac3-40f1-8558-584c3f5d6b16
icon: mdi:weather-sunny
state: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[0] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[0] %}
{{ forecast.condition }}
attributes:
high_temp: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[0] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[0] %}
{{ forecast.temperature }}
overnight_low: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[0] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[0] %}
{{ forecast.templow }}
wind_bearing: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[0] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[0] %}
{{ forecast.wind_bearing }}
wind_speed: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[0] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[0] %}
{{ forecast.wind_speed }}
precipitation: >-
{% if state_attr('weather.iron_nerd_weather_station','precipitation') %}
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[0] %}
{% else %}
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[0] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[0] %}
{% endif %}
{{ forecast.precipitation }}
friendly: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[0] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[0] %}
{{ forecast.condition | replace("partlycloudy","partly cloudy") }}
- name: Current Forecast Detail
unique_id: e5ae9864-70b5-402c-9d2f-c4d6a10085df
@ -861,23 +968,23 @@ template:
unique_id: a8ae26b0-ed26-4568-bb2b-f7c72707b009
icon: mdi:weather-sunny
state: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[1] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[1] %}
{{ forecast.condition }}
attributes:
high_temp: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[1] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[1] %}
{{ forecast.temperature }}
overnight_low: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[1] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[1] %}
{{ forecast.templow }}
wind_bearing: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[1] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[1] %}
{{ forecast.wind_bearing }}
wind_speed: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[1] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[1] %}
{{ forecast.wind_speed }}
precipitation: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[1] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[1] %}
{{ forecast.precipitation }}
- name: Tomorrow Forecast Detail
unique_id: 21374ed0-80d1-49ba-817d-3e93eb3865e4
@ -1182,7 +1289,7 @@ template:
unit_of_measurement: '°F'
device_class: temperature
state: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[0] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[0] %}
{% if is_number(forecast.temperature) %}
{{ forecast.temperature }}
{% else %}
@ -1193,14 +1300,14 @@ template:
unit_of_measurement: '°F'
device_class: temperature
state: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[2] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[2] %}
{{ forecast.temperature }}
- name: "Tonight's Low Temp"
unique_id: 8ddc55b6-4728-4897-a32f-90be970f744b
unit_of_measurement: '°F'
device_class: temperature
state: >-
{% set forecast = state_attr('sensor.weather_com_daily_weather_forecast','forecast')[0] %}
{% set forecast = state_attr('sensor.weatherflow_daily_weather_forecast','forecast')[0] %}
{{ forecast.templow }}
- name: "Clothing Forecast"
unique_id: 8ed2684b-d0ad-402c-bc3c-340cb9b2437a
@ -1461,8 +1568,8 @@ template:
unit_of_measurement: '°F'
state: >
{% set ns = namespace(temps=[]) %}
{% set x = state_attr('sensor.weather_com_hourly_weather_forecast','forecast') | count %}
{% set pd = state_attr('sensor.weather_com_hourly_weather_forecast','forecast') %}
{% set x = state_attr('sensor.weatherflow_hourly_weather_forecast','forecast') | count %}
{% set pd = state_attr('sensor.weatherflow_hourly_weather_forecast','forecast') %}
{% for i in range(0,x) %}
{% set hr = as_timestamp(as_local(as_datetime(pd[i].datetime))) | timestamp_custom('%H') | int %}
{% if hr in range(21,24) or hr in range(0,8) %}

11
packages/dashboards.yaml Normal file
View File

@ -0,0 +1,11 @@
template:
- trigger:
- trigger: event
event_type: bubble_card_update_modules
sensor:
- name: "Bubble Card Modules"
state: "saved"
icon: "mdi:puzzle"
attributes:
modules: "{{ trigger.event.data.modules }}"
last_updated: "{{ trigger.event.data.last_updated }}"

View File

@ -44,6 +44,9 @@ input_boolean:
adaptive_lighting_adjustments:
name: Adaptive Lighting Adjustments
icon: mdi:knob
sunset_lights_triggered:
name: Sunset Lights Triggered
icon: mdi:weather-sunset
input_number:
upstairs_bathroom_motion_off_delay:
@ -207,6 +210,21 @@ input_number:
step: 5
unit_of_measurement: lx
icon: mdi:sun-wireless
front_porch_lux_threshold:
name: Front Porch Lux Threshold
min: 0
max: 2000
step: 5
mode: box
unit_of_measurement: lx
icon: mdi:sun-wireless
sunset_lights_outdoor_lux_threshold:
name: Sunset Lights Outdoor Lux Threshold
min: 0
max: 10000
step: 100
unit_of_measurement: lx
icon: mdi:sun-wireless
# Settings for adaptive adjustments
daytime_colortemp_front_porch:
@ -659,14 +677,18 @@ template:
state: >
{% set lights = states.light.upstairs_bathroom_lights,
states.light.hallway_overhead,
states.light.downstairs_bathroom_lights %}
states.light.downstairs_bathroom_lights,
states.light.living_room_lights,
states.light.front_porch_light %}
{% set issues = lights | selectattr('state','eq','unavailable') | list | count %}
{{ issues > 0 }}
attributes:
issues: >
{% set lights = states.light.upstairs_bathroom_lights,
states.light.hallway_overhead,
states.light.downstairs_bathroom_lights %}
states.light.downstairs_bathroom_lights,
states.light.living_room_lights,
states.light.front_porch_light %}
{% set ids = lights | selectattr('state','eq','unavailable') | map(attribute='attributes.friendly_name') | list %}
{{ ids | join(', ') }}
- sensor:

View File

@ -600,22 +600,17 @@ script:
data:
time: >
{% set low = states('sensor.overnight_lowest_temperature') | int %}
{% set high = states('sensor.todays_high_temp') | int %}
{% set kallen_bedtime = state_attr('input_datetime.kallen_bedtime','timestamp') | int %}
{% set cutoff = 81000 %}
{% if is_state('input_boolean.hot_day','on') and is_state('binary_sensor.kallen_school_tomorrow','on') %}
{{ (kallen_bedtime - 3600) | timestamp_custom('%H:%M',false) }}
{% elif is_state('input_boolean.hot_day','on') and is_state('binary_sensor.kallen_school_tomorrow','off') %}
{{ kallen_bedtime | timestamp_custom('%H:%M',false) }}
{% elif 56 <= low <= 60 %}
22:30
{% elif low > 60 %}
{% if kallen_bedtime < cutoff %}
{{ kallen_bedtime | timestamp_custom('%H:%M',false) }}
{% else %}
21:30
{% endif %}
{% set kallen_fantime = state_attr('input_datetime.kallen_fan','timestamp') | int %}
{% set bedroom_hot = is_state('binary_sensor.kallen_bedroom_hot','on') %}
{% set cutoff = 81000 %} {# Cutoff time is 22:30 #}
{% if is_state('input_boolean.hot_day','on') or bedroom_hot == true %}
{{ (kallen_fantime - 3600) | timestamp_custom('%H:%M',false) }}
{% elif low >= 56 or high >= 75 %}
{{ (kallen_bedtime - 1800) | timestamp_custom('%H:%M',false) }}
{% else %}
00:00
{{ kallen_bedtime | timestamp_custom('%H:%M',false) }}
{% endif %}
- service: input_datetime.set_datetime
entity_id: input_datetime.master_bedroom_fan
@ -624,11 +619,11 @@ script:
{% set low = states('sensor.overnight_lowest_temperature') | int %}
{% set high = states('sensor.todays_high_temp') | int %}
{% if low > 60 or is_state('input_boolean.hot_day','on') %}
00:00
{% elif 50 <= low <= 60 %}
01:00
{% elif low >= states('input_number.master_bedroom_fan_threshold') | int and high > 60 %}
{% elif 50 <= low <= 60 %}
02:00
{% elif low >= states('input_number.master_bedroom_fan_threshold') | int and high > 60 %}
03:00
{% else %}
06:00
{% endif %}
@ -714,11 +709,16 @@ script:
entity_id: input_select.scheduled_climate_mode_emma_bedroom
data:
option: >
{% if is_state('input_boolean.emma_bedroom_aircon_installed','on') %}
{% if (states('sensor.overnight_lowest_temperature') | int) >= (states('input_number.emma_aircon_threshold') | int) %}
{% set low = states('sensor.overnight_lowest_temperature') | int %}
{% set run_threshold = states('input_number.emma_bedroom_aircon_run_threshold') | int %}
{% set mode_threshold = states('input_number.emma_bedroom_aircon_mode_threshold') | int %}
{% if is_state('input_boolean.emma_bedroom_aircon_installed','off') %}
White Noise
{% elif low >= run_threshold %}
{% if low >= mode_threshold %}
AC
{% else %}
White Noise
Fan
{% endif %}
{% else %}
White Noise

View File

@ -106,7 +106,7 @@ template:
unique_id: 2987ae95-f55d-4994-b9dd-018278d2f5ad
state: >
{% from 'sports.jinja' import sports_inhibit %}
{{ state_attr('sensor.minnesota_twins','opponent_abbr') in ['CLE','LAD'] or sports_inhibit('sensor.minnesota_twins') }}
{{ sports_inhibit('sensor.minnesota_twins') }}
- name: Minnesota Twins Event Today
unique_id: 30055cb3-d259-4cef-90e1-7dea0a5cb439
state: >
@ -116,7 +116,7 @@ template:
unique_id: b0980d47-d762-4f23-97b1-9e88da729d8f
state: >
{% from 'sports.jinja' import sports_inhibit %}
{{ sports_inhibit('sensor.cleveland_guardians') }}
{{ state_attr('sensor.cleveland_guardians','opponent_abbr') in ['MIN','LAD'] or sports_inhibit('sensor.cleveland_guardians') }}
- name: Cleveland Guardians Event Today
unique_id: 985a7b2c-9ebd-4a2e-8ee2-2ab5359310e0
state: >
@ -126,7 +126,7 @@ template:
unique_id: 2c6aae6e-eff6-46e5-bee9-311f9bbc0c0e
state: >
{% from 'sports.jinja' import sports_inhibit %}
{{ state_attr('sensor.los_angeles_dodgers','opponent_abbr') in ['CLE'] or sports_inhibit('sensor.los_angeles_dodgers') }}
{{ state_attr('sensor.los_angeles_dodgers','opponent_abbr') in ['MIN'] or sports_inhibit('sensor.los_angeles_dodgers') }}
- name: Los Angeles Dodgers Event Today
unique_id: 7c2bd060-ea2c-4b81-8af7-3e6b9b3c639d
state: >

View File

@ -1,3 +1,8 @@
input_boolean:
server_maintenance:
name: Server Maintenance
icon: mdi:wrench-clock
input_select:
log_level:
name: Log Level

View File

@ -2,11 +2,9 @@ # Tony's Home Assistant Configs
Just a place to track my work on my personal Home Assistant configuration, and learn as I go. Maybe also TRY to keep myself a little bit more organized ;)
## New location for Node-RED flows
## Node-RED flows
I have recently started using the Node-RED Projects feature, which makes version control for my flows a LOT easier than it was before.
With this change, the Node-RED flows are now in their own repo. They can be found at [HA-NerdFlows](https://github.com/tm24fan8/HA-NerdFlows).
My Node-RED flows can be found at [HA-NerdFlows](https://gitea.nerdhomeinc.com/home_automation/HA-NerdFlows). Additionally, code used in function nodes in my Node-RED flows can be found at [HA-NerdFlows-Functions](https://gitea.nerdhomeinc.com/home_automation/HA-NerdFlows-Functions).
## Attributions
@ -34,7 +32,6 @@ ## HACS Components
- [Node-RED Companion](https://github.com/zachowj/hass-node-red)
- [Holidays](https://github.com/bruxy70/Holidays)
- [Twitch Helix](https://github.com/Radioh/ha_twitch_helix)
- [Local Tuya](https://github.com/rospogrigio/localtuya)
- [Pirate Weather](https://github.com/alexander0042/pirate-weather-ha)
- [Holidays](https://github.com/bruxy70/Holidays)
- [Thermal Comfort](https://github.com/dolezsa/thermal_comfort)
@ -42,7 +39,7 @@ ## HACS Components
- [HASS.Agent Media Player](https://github.com/LAB02-Research/HASS.Agent-MediaPlayer)
- [Music Assistant](https://github.com/music-assistant/hass-music-assistant)
- [Blitzortung Lightning Detector](https://github.com/mrk-its/homeassistant-blitzortung)
- [Midea Air Conditioning](https://github.com/mill1000/midea-ac-py)
- [Midea Air Conditioning](https://github.com/wuwentao/midea_ac_lan)
- [WeatherAPI](https://github.com/iprak/weatherapi)
- [Browser Mod](https://github.com/thomasloven/hass-browser_mod)
- [Watchman](https://github.com/dummylabs/thewatchman)
@ -50,7 +47,6 @@ ## HACS Components
- [PyScript](https://github.com/custom-components/pyscript)
- [Hass Animated Scenes](https://github.com/chazzu/hass-animated-scenes)
- [Jokes](https://github.com/LaggAt/ha-jokes)
- [Google Photos](https://github.com/Daanoz/ha-google-photos)
- [Uptime Kuma](https://github.com/meichthys/uptime_kuma)
- [Jellyfin](https://github.com/koying/jellyfin_ha)
- [Sonoff LAN](https://github.com/AlexxIT/SonoffLAN)
@ -58,6 +54,9 @@ ## HACS Components
- [Govee LAN Control](https://github.com/wez/govee-lan-hass)
- [Discord Game](https://github.com/LordBoos/discord_game)
- [Versatile Thermostat](https://github.com/jmcollin78/versatile_thermostat)
- [GasBuddy](https://github.com/firstof9/ha-gasbuddy)
- [Union Pacific Big Boy Tracker](https://github.com/jheizer/up_4014_tracker)
- [WeatherFlow Forecast](https://github.com/briis/weatherflow_forecast)
</details>
@ -70,22 +69,19 @@ ## HACS Lovelace Cards
- [Bubble Card](https://github.com/Clooos/Bubble-Card) Backbone of the new mobile dashboard
- [Config Template Card](https://github.com/iantrich/config-template-card)
- [Decluttering Card](https://github.com/custom-cards/decluttering-card)
- [Card Tools](https://github.com/thomasloven/lovelace-card-tools) (required for various other cards)
- [Streamline Card](https://github.com/brunosabot/streamline-card)
- [Layout Card](https://github.com/thomasloven/lovelace-layout-card)
- [Scheduler Card](https://github.com/nielsfaber/scheduler-card) (required for Scheduler component)
- [Horizon Card](https://github.com/rejuvenate/lovelace-horizon-card)
- [Lovelace Home Feed Card](https://github.com/gadgetchnnel/lovelace-home-feed-card)
- [Mini Graph Card](https://github.com/kalkih/mini-graph-card)
- [Battery State Card](https://github.com/maxwroc/battery-state-card)
- [Compass Card](https://github.com/tomvanswam/compass-card)
- [Flipdown Timer Card](https://github.com/pmongloid/flipdown-timer-card)
- [Atomic Calendar Revive](https://github.com/totaldebug/atomic-calendar-revive)
- [Plotly Graph Card](https://github.com/dbuezas/lovelace-plotly-graph-card)
- [Mushroom](https://github.com/piitaya/lovelace-mushroom)
- [Apexcharts Card](https://github.com/RomRider/apexcharts-card)
- [Auto Entities Card](https://github.com/thomasloven/lovelace-auto-entities)
- [Slider Button Card](https://github.com/custom-cards/slider-button-card)
- [Weather Radar Card](https://github.com/Makin-Things/weather-radar-card)
- [Stack In Card](https://github.com/custom-cards/stack-in-card)
- [Paper Buttons Row](https://github.com/jcwillox/lovelace-paper-buttons-row)
@ -93,32 +89,24 @@ ## HACS Lovelace Cards
- [Multiple Entity Row](https://github.com/benct/lovelace-multiple-entity-row)
- [Weather Card](https://github.com/bramkragten/weather-card)
- [Template Entity Row](https://github.com/thomasloven/lovelace-template-entity-row)
- [Canvas Gauge Card](https://github.com/custom-cards/canvas-gauge-card)
- [Datetime Card](https://github.com/a-p-z/datetime-card)
- [Waze Travel Time](https://github.com/r-renato/ha-card-waze-travel-time)
- [Fold Entity Row](https://github.com/thomasloven/lovelace-fold-entity-row)
- [Slider Entity Row](https://github.com/thomasloven/lovelace-slider-entity-row)
- [Room Card](https://github.com/marcokreeft87/room-card)
- [Simple Thermostat Card](https://github.com/nervetattoo/simple-thermostat)
- [Clock Weather Card](https://github.com/pkissling/clock-weather-card)
- [Tabbed Card](https://github.com/kinghat/tabbed-card)
- [HA Team Tracker Card](https://github.com/vasqued2/ha-teamtracker-card)
- [Banner Card](https://github.com/nervetattoo/banner-card)
- [Lovelace Lock Card](https://github.com/CyrisXD/love-lock-card)
- [Card Templater](https://github.com/gadgetchnnel/lovelace-card-templater)
- [Energy Overview Card](https://github.com/Sese-Schneider/ha-energy-overview-card)
- [Button Card](https://github.com/custom-cards/button-card)
- [Number Box Card](https://github.com/htmltiger/numberbox-card)
- [Restriction Card](https://github.com/iantrich/restriction-card)
- [Timer Bar Card](https://github.com/rianadon/timer-bar-card)
- [Minimalistic Area Card](https://github.com/junalmeida/homeassistant-minimalistic-area-card)
- [Sankey Chart Card](https://github.com/MindFreeze/ha-sankey-chart)
- [Hourly Weather Card](https://github.com/decompil3d/lovelace-hourly-weather)
- [Formula One Card](https://github.com/marcokreeft87/formulaone-card)
- [UV Index Card](https://github.com/t1gr0u/uv-index-card)
- [Github Flexi Card](https://github.com/maxwroc/github-flexi-card)
- [Windrose Card](https://github.com/aukedejong/lovelace-windrose-card)
- [Swipe Card](https://github.com/bramkragten/swipe-card)
- [Meteoalarm Card](https://github.com/MrBartusek/MeteoalarmCard)
- [Weather Chart Card](https://github.com/mlamberts78/weather-chart-card)
- [Comfortable Environment Card](https://github.com/argaar/comfortable-environment-card)
@ -135,6 +123,16 @@ ## AppDaemon Apps
</details>
## Custom Jinja2 Templates/Macros
<details>
<summary>Click here</summary>
- [Easy Time](https://github.com/Petro31/easy-time-jinja)
- [Relative Time](https://github.com/TheFes/relative-time-plus)
</details>
## Themes/Icons
<details>
@ -146,5 +144,6 @@ ## Themes/Icons
- [BHA Icon Pack](https://github.com/hulkhaugen/hass-bha-icons)
- [Custom Icons Library](https://github.com/Mariusthvdb/custom-icons)
- [FontAwesome](https://github.com/thomasloven/hass-fontawesome)
- [Material Symbols](https://github.com/beecho01/material-symbols)
</details>

View File

@ -854,6 +854,12 @@ adaptive_on_first_floor:
adaptive_on_second_floor:
alias: Adaptive on Second Floor
sequence:
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.adaptive_lighting_stairwell
alias: Turn on adaptive lighting in stairwell
- if:
- condition: state
entity_id: light.hallway_overhead
@ -1441,16 +1447,42 @@ evening_on_second_floor:
goodnight_in_basement:
alias: Goodnight in Basement
sequence:
- service: light.turn_off
target:
- target:
area_id:
- basement_studio
- furnace_room
data: {}
- service: fan.turn_off
target:
action: light.turn_off
alias: Turn lights off
- target:
entity_id: fan.basement_fan
data: {}
action: fan.turn_off
alias: Turn fan off
- delay:
hours: 0
minutes: 0
seconds: 3
milliseconds: 0
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.adaptive_lighting_sleep_mode_basement_studio
alias: Turn off sleep mode
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.adaptive_lighting_basement_studio
alias: Turn on adaptive lighting
- action: input_text.set_value
metadata: {}
data:
value: Adaptive
target:
entity_id: input_text.basement_studio_selected_scene
alias: Reset selected scene text
goodnight_on_first_floor:
alias: Goodnight on First Floor
sequence: