From 4a3777800b175991b55f8152e14bf9999d5c19b9 Mon Sep 17 00:00:00 2001 From: jazzyisj Date: Sat, 14 Dec 2024 23:00:23 -0500 Subject: [PATCH] Update to 2024.12.3 - update unavailable entities package - update mobile notification channels - expected precipitation type sensor - update weather templates - update weather ui - bugfixes --- .HA_VERSION | 2 +- automations/climate/climate_fireplace.yaml | 13 +- .../climate/climate_temperature_alert.yaml | 2 +- automations/climate/climate_thermostat.yaml | 2 +- automations/hass/hass_log_error.yaml | 26 +- .../hass/hass_update_group_entities.yaml | 2 +- .../alarm_clock/alarm_clock_turn_on.yaml | 28 +- .../notify/notify_alert_announcements.yaml | 4 +- .../schedule/commute/commute_before_work.yaml | 2 +- automations/weather/precipitation_alert.yaml | 48 +-- custom_templates/door.jinja | 2 +- custom_templates/lock.jinja | 2 +- custom_templates/weather.jinja | 25 +- custom_templates/window.jinja | 2 +- include/bedtime_report.yaml | 92 ++++++ include/weather_report.yaml | 10 +- logging/recorder.yaml | 24 +- packages/climate.yaml | 4 +- packages/unavailable_entities.yaml | 92 ++---- packages/weather.yaml | 5 +- scripts/schedule/bedtime.yaml | 87 +----- templates/climate.yaml | 15 +- templates/schedule/calendar.yaml | 22 +- templates/schedule/commute.yaml | 17 +- templates/schedule/schedule.yaml | 2 +- templates/schedule/work_schedule.yaml | 8 +- templates/weather/weather.yaml | 281 ++++++++++++------ ui/button/climate/thermostat.yaml | 2 +- ui/button/layout/weather_sensors.yaml | 4 +- ui/button/weather/cloud_cover.yaml | 38 ++- ui/button/weather/humidity.yaml | 52 ++-- ui/button/weather/lightning.yaml | 7 +- ui/button/weather/precipitation.yaml | 5 +- ui/button/weather/pressure.yaml | 40 +++ ui/button/weather/temperature.yaml | 47 ++- ui/button/weather/wind.yaml | 12 +- ui/button/weather/wind_conditions.yaml | 42 --- ui/card/alarm/door_sensors.yaml | 12 +- ui/card/alarm/window/bedroom_front.yaml | 2 +- ui/card/alarm/window/bedroom_side.yaml | 2 +- ui/card/alarm/window/downstairs_kitchen.yaml | 2 +- ui/card/alarm/window/family_room.yaml | 2 +- ui/card/alarm/window/kitchen.yaml | 2 +- ui/card/alarm/window/kitchen_sink.yaml | 2 +- ui/card/alarm/window/laundry_room.yaml | 2 +- ui/card/alarm/window/living_room_1.yaml | 2 +- ui/card/alarm/window/living_room_2.yaml | 2 +- ui/card/alarm/window/living_room_3.yaml | 2 +- ui/card/alarm/window/living_room_4.yaml | 2 +- ui/card/alarm/window/master_bathroom.yaml | 2 +- ui/card/alarm/window/master_bedroom.yaml | 2 +- ui/card/alarm/window/office.yaml | 2 +- ui/card/climate/climate_settings.yaml | 4 +- ui/card/lock/entry_locks.yaml | 8 +- ui/card/weather/current_conditions.yaml | 195 +++++++----- .../weather/include/air_quality_entities.yaml | 18 +- ui/card/weather/include/allergy_entities.yaml | 6 +- ui/card/weather/include/asthma_entities.yaml | 6 +- .../include/barometric_pressure_entities.yaml | 2 +- ui/card/weather/include/cloud_entities.yaml | 2 +- ui/card/weather/include/flu_entities.yaml | 4 +- .../weather/include/lightning_entities.yaml | 2 +- .../weather/include/nearest_storm_entity.yaml | 14 +- .../include/outdoor_humidity_entities.yaml | 2 +- .../include/outdoor_temperature_entities.yaml | 110 ++++--- .../include/precipitation_entities.yaml | 97 +++--- ui/card/weather/include/uv_entities.yaml | 4 +- .../include/weather_condition_colors.yaml | 34 +-- ui/card/weather/include/wind_entities.yaml | 6 +- ui/card/weather/today_forecast.yaml | 65 ++-- ui/card/weather/tomorrow_forecast.yaml | 63 ++-- ui/card/weather/weather_forecast.yaml | 6 +- ui/card/weather/weather_forecast_mini.yaml | 2 +- .../subview/weather/weather_comparison.yaml | 41 ++- ui/dashboard/subview/weather/wind.yaml | 2 +- ui/gauge/cloud_cover.yaml | 10 +- ui/gauge/smoke_risk.yaml | 2 +- ui/graph/climate/climate_summary_month.yaml | 8 +- ui/graph/climate/climate_summary_week.yaml | 2 +- ui/graph/climate/indoor_temperature.yaml | 2 +- .../climate/indoor_temperature_detail.yaml | 2 +- ui/graph/climate/spa_summary_week.yaml | 5 +- ui/graph/graph_templates.yaml | 13 +- ui/graph/include/temperature_area_color.yaml | 67 ++--- ui/graph/include/temperature_line_color.yaml | 5 +- ui/graph/weather/air_quality_detail.yaml | 22 +- .../atmospheric_conditions_detail.yaml | 17 +- ui/graph/weather/lightning_detail.yaml | 2 +- ui/graph/weather/precipitation_detail.yaml | 4 +- ui/graph/weather/temperature_detail.yaml | 8 +- .../weather/lightning_count_comparison.yaml | 16 + .../lightning_distance_comparison.yaml | 15 + .../precipitation_today_comparison.yaml | 2 +- ui/statistics_graph/smoke_level.yaml | 2 +- ui/themes/custom.yaml | 27 +- 95 files changed, 1125 insertions(+), 907 deletions(-) create mode 100644 include/bedtime_report.yaml delete mode 100644 ui/button/weather/wind_conditions.yaml create mode 100644 ui/history/weather/lightning_count_comparison.yaml create mode 100644 ui/history/weather/lightning_distance_comparison.yaml diff --git a/.HA_VERSION b/.HA_VERSION index 11c0ecbdd..a10ce8c74 100644 --- a/.HA_VERSION +++ b/.HA_VERSION @@ -1 +1 @@ -2024.12.0b4 \ No newline at end of file +2024.12.3 \ No newline at end of file diff --git a/automations/climate/climate_fireplace.yaml b/automations/climate/climate_fireplace.yaml index 756318a5c..057c5de5b 100644 --- a/automations/climate/climate_fireplace.yaml +++ b/automations/climate/climate_fireplace.yaml @@ -35,11 +35,11 @@ HVAC Mode: {{ states('climate.thermostat') }} HVAC State: {{ state_attr('climate.thermostat', 'hvac_action') }} Temperature: {{ states('sensor.indoor_temperature', with_unit=true) }} - Target: {{ states('input_number.thermostat_target_temperature', with_unit=true) }} + Target: {{ states('sensor.indoor_temperature_target', with_unit=true) }} data: tag: fireplace_emergency_on group: Alert - channel: Urgent + channel: alarm_stream notification_icon: mdi:fireplace icon_url: !secret FIREPLACE_ICON ledColor: !secret WARNING_COLOR @@ -80,6 +80,12 @@ - Night - Away - Vacation + + - trigger: event + id: notification + event_type: mobile_app_notification_action + event_data: + action: fireplace_off conditions: - condition: state entity_id: switch.fireplace @@ -94,6 +100,9 @@ entity_id: alert.indoor_low_temperature state: "idle" + - condition: template + value_template: "{{ trigger.id == 'notification' }}" + - condition: template alias: "Occupancy override is off if occupancy trigger" value_template: > diff --git a/automations/climate/climate_temperature_alert.yaml b/automations/climate/climate_temperature_alert.yaml index 85d00c8dd..044d97281 100644 --- a/automations/climate/climate_temperature_alert.yaml +++ b/automations/climate/climate_temperature_alert.yaml @@ -44,7 +44,7 @@ HVAC Mode: {{ states('climate.thermostat') }} HVAC State: {{ state_attr('climate.thermostat', 'hvac_action') }} Temperature: {{ states('sensor.indoor_temperature', with_unit=true) }} - Target: {{ states('input_number.thermostat_target_temperature', with_unit=true) }} + Target: {{ states('sensor.indoor_temperature_target', with_unit=true) }} data: tag: emergency_heat group: Alert diff --git a/automations/climate/climate_thermostat.yaml b/automations/climate/climate_thermostat.yaml index 5948085ac..a58d10861 100644 --- a/automations/climate/climate_thermostat.yaml +++ b/automations/climate/climate_thermostat.yaml @@ -104,7 +104,7 @@ {% set temp = state_attr('climate.thermostat', 'temperature') %} {% set high = state_attr('climate.thermostat', 'target_temp_high') %} {% set low = state_attr('climate.thermostat', 'target_temp_low') %} - {% set stored = states('input_number.thermostat_target_temperature') %} + {% set stored = states('sensor.indoor_temperature_target') %} {% set outdoor = states('sensor.outdoor_temperature') %} {% if hvac in ['heat', 'cool'] %}{{ temp | int if is_number(temp) else stored }} {% elif hvac == 'heat_cool' %} diff --git a/automations/hass/hass_log_error.yaml b/automations/hass/hass_log_error.yaml index 231bd531b..cc208a74a 100644 --- a/automations/hass/hass_log_error.yaml +++ b/automations/hass/hass_log_error.yaml @@ -7,11 +7,17 @@ description: "Notify on HASS log errors." mode: single variables: - error: > - {% set message = trigger.event.data.message[0] %} - {% set exception = trigger.event.data.exception %} - {% if 'Missing device owner or root rights to reboot the device' in message %} - Fully Kiosk - Missing device owner or root rights to reboot the device. + log_error: > + {% set message = '' %} + {% set exception = '' %} + {% if trigger.event.data.message[0] is defined %} + {% set message = trigger.event.data.message[0] %} + {% endif %} + {% if trigger.event.data.exception is defined %} + {% set exception = trigger.event.data.exception %} + {% endif %} + {% if 'Missing device owner or root rights to reboot the device' in exception %} + Fully Kiosk Error - Missing device owner or root rights to reboot the device. {% else %} {{ none }} {% endif %} triggers: @@ -21,18 +27,18 @@ level: ERROR conditions: - condition: template - value_template: "{{ error != none }}" + value_template: "{{ log_error != none }}" actions: - action: browser_mod.notification data: duration: 10000 - message: "{{ error }}" + message: "{{ log_error }}" - action: persistent_notification.create data: title: "HASS Log Error" - message: "{{ error }}" - notification_id: kiosk_reboot + message: "{{ log_error }}" + notification_id: log_error - if: - condition: state @@ -43,4 +49,4 @@ then: - action: notify.kiosk_tts data: - message: "{{ error }}" \ No newline at end of file + message: "{{ log_error }}" \ No newline at end of file diff --git a/automations/hass/hass_update_group_entities.yaml b/automations/hass/hass_update_group_entities.yaml index 587f7c25c..542204485 100644 --- a/automations/hass/hass_update_group_entities.yaml +++ b/automations/hass/hass_update_group_entities.yaml @@ -156,7 +156,7 @@ | rejectattr('entity_id', 'in', integration_entities('fully_kiosk')) | rejectattr('entity_id', 'in', integration_entities('hassio')) | rejectattr('entity_id', 'in', integration_entities('dlna_dmr')) - | rejectattr('entity_id', 'in', state_attr('group.ignored_unavailable_entities', 'entity_id') | default([])) + | rejectattr('entity_id', 'in', state_attr('group.ignored_unavailable_entities', 'entity_id')) | rejectattr('entity_id', 'contains', 'garage_inside') | rejectattr('entity_id', 'contains', 'front_door_lock') | rejectattr('entity_id', 'contains', '_next_cycle') diff --git a/automations/media/alarm_clock/alarm_clock_turn_on.yaml b/automations/media/alarm_clock/alarm_clock_turn_on.yaml index 0583670c9..9f23c6ff8 100644 --- a/automations/media/alarm_clock/alarm_clock_turn_on.yaml +++ b/automations/media/alarm_clock/alarm_clock_turn_on.yaml @@ -32,23 +32,29 @@ entity_id: input_boolean.alarm_clock_skip_next else: - if: - - condition: state #TEST + - condition: state entity_id: input_select.occupancy_mode state: - Home - Guest - Night - - - condition: template #TEST - value_template: "{{ iif(trigger.id == 'wake', is_state('input_select.occupancy_mode', 'Night'), true) }}" then: - - action: switch.turn_on - target: - entity_id: "switch.alarm_clock_{{ trigger.id }}" + - if: + - condition: template + value_template: > + {{ iif(trigger.id == 'wake', + is_state('input_select.occupancy_mode', 'Night'), true) }} + then: + - action: notify.jason #VERIFY + data: + title: "Alarm Clock" + message: "Wake alarm clock was scheduled but the house is already awake!" + else: + - action: switch.turn_on + target: + entity_id: "switch.alarm_clock_{{ trigger.id }}" else: - - action: notify.jason #TEST + - action: notify.jason data: title: "Alarm Clock" - message: "Alarm clock scheduled but nobody home!" - - + message: "Alarm clock was scheduled but nobody is home!" diff --git a/automations/notify/notify_alert_announcements.yaml b/automations/notify/notify_alert_announcements.yaml index 8783c4b2a..816ae7641 100644 --- a/automations/notify/notify_alert_announcements.yaml +++ b/automations/notify/notify_alert_announcements.yaml @@ -29,7 +29,7 @@ {%- elif t == 'alert.precipitation' %} {%- from 'weather.jinja' import precipitation_text %} Attention! {{- precipitation_text() }} - Make sure you get Charlie walked! + Check the Jeep windows and make sure you get Charlie walked! {%- elif t == 'alert.wind' %} Hang on to yer hats people! It's getting a little windy out there! Wind speed is {{ states('sensor.wind_speed') | int('unknown') }} kilometers per hour, with gusts approaching {{ states('sensor.wind_gust') | int('unknown') }} kilometers per hour. @@ -221,7 +221,7 @@ for: minutes: 60 actions: - - if: "{{ tts_repeat }}" + - if: "{{ tts_repeat and tts_timeout > 0 }}" then: - repeat: sequence: diff --git a/automations/schedule/commute/commute_before_work.yaml b/automations/schedule/commute/commute_before_work.yaml index 381f0fbd2..f28048c65 100644 --- a/automations/schedule/commute/commute_before_work.yaml +++ b/automations/schedule/commute/commute_before_work.yaml @@ -58,7 +58,7 @@ {%- set start = states('sensor.precipitation_start') %} {%- set time = state_attr('sensor.precipitation_start', '12hour') %} {%- set type = iif(precip, states('sensor.precipitation_type'), - state_attr('sensor.precipitation_start', 'type')) %} + states('sensor.precipitation_type_expected')) %} {%- if precip or (has_value('sensor.precipitation_start') and start | as_datetime - now() < timedelta(hours=9)) %} {{ iif(type == 'snow', 'Bundle up', 'Bring an umbrella') }} diff --git a/automations/weather/precipitation_alert.yaml b/automations/weather/precipitation_alert.yaml index a99be5e4b..3da0064f8 100644 --- a/automations/weather/precipitation_alert.yaml +++ b/automations/weather/precipitation_alert.yaml @@ -7,10 +7,11 @@ max_exceeded: silent triggers: - trigger: state + id: alert entity_id: alert.precipitation to: "on" - # notification after work - windows, walk dog etc. + # notification after work on days - windows, walk dog etc. - trigger: template value_template: > {{ is_state('binary_sensor.precipitation_likely_next_24_hours', 'on') @@ -18,7 +19,7 @@ and is_state('sensor.work_shift_today', 'Days') and states('sensor.time') == '15:50' }} - # notification before work - windows, walk dog etc. + # notification before work on afternoons, weekends - windows, walk dog etc. - trigger: template value_template: > {{ is_state('binary_sensor.precipitation_likely_next_24_hours', 'on') @@ -35,12 +36,8 @@ - condition: template alias: "Only once every 2 hours" value_template: > - {{ true if this.attributes.last_triggered == none - else now() - this.attributes.last_triggered > timedelta(hours=2) }} - - - condition: state - entity_id: alert.precipitation - state: "on" + {{ trigger.id == 'alert' or (true if this.attributes.last_triggered == none + else now() - this.attributes.last_triggered > timedelta(hours=2)) }} actions: - variables: file: > @@ -73,38 +70,3 @@ actions: - title: "Pause" action: pause_alert_precipitation - -############################################################################### -## Weather - Rain Announcement -############################################################################### -- id: weather_rain_announcement - alias: "[Weather] Rain Announcement" - description: "Announcement when it's about to rain or it starts raining." - triggers: - - trigger: state - entity_id: alert.precipitation - to: "on" - conditions: - - condition: state - entity_id: binary_sensor.freezing - state: "off" - - - condition: state - entity_id: binary_sensor.jason_home - state: "on" - - - condition: template - alias: "Only once every 4 hours" - value_template: > - {{ true if this.attributes.last_triggered == none - else now() - this.attributes.last_triggered > timedelta(hours=4) }} - actions: - - action: script.tts_play - data: - message: > - Hey Knucklehead! - {{ iif(is_state('sensor.precipitation_type', 'rain'), 'It is starting to rain.', - 'It is probably going to start raining soon.') }} - Have you checked the Jeep windows yet? - quiet_play: true - save_message: "{{ is_state('binary_sensor.jason_home', 'on') }}" diff --git a/custom_templates/door.jinja b/custom_templates/door.jinja index c9b9a644d..7cf76c2a7 100644 --- a/custom_templates/door.jinja +++ b/custom_templates/door.jinja @@ -5,7 +5,7 @@ {%- endif %} {%- endmacro -%} -{%- macro door_color(entity) -%} +{%- macro door_icon_color(entity) -%} {%- set alert_entity = entity ~ '_open_alert' %} {%- set open = state_attr('alarm_control_panel.master', 'open_sensors') if state_attr('alarm_control_panel.master', 'open_sensors') != none else '' %} diff --git a/custom_templates/lock.jinja b/custom_templates/lock.jinja index 25397c076..73dccf278 100644 --- a/custom_templates/lock.jinja +++ b/custom_templates/lock.jinja @@ -12,7 +12,7 @@ {%- endif %} {%- endmacro -%} -{%- macro lock_color(entity) -%} +{%- macro lock_icon_color(entity) -%} {%- if not has_value(entity) %} grey {%- elif is_state(entity, 'unlocked') %} yellow {%- else %} white diff --git a/custom_templates/weather.jinja b/custom_templates/weather.jinja index a687e07c8..597623e32 100644 --- a/custom_templates/weather.jinja +++ b/custom_templates/weather.jinja @@ -2,14 +2,14 @@ {%- from 'speech.jinja' import plural_qty -%} {%- from 'speech.jinja' import full_cardinal_direction -%} {%- set current = states('sensor.precipitation_type') %} -{%- set type = state_attr('sensor.precipitation_start', 'type') %} +{%- set expected = states('sensor.precipitation_type_expected') %} {%- set time = state_attr('sensor.precipitation_start', '12hour') %} {%- set dist = states('sensor.nearest_storm_distance') | int(-1) %} {%- set dir = full_cardinal_direction(states('sensor.nearest_storm_bearing')) %} {%- if is_state('binary_sensor.precipitation_active', 'on') %} It is {{ current }}ing right now. {%- elif time != none %} -Possibility of {{ type }} around {{ time }}. +Possibility of {{ expected }} around {{ time }}. {%- if dist > 0 %} The storm is {{ iif(dist > 0, plural_qty('kilometer', dist, false) ~ ' away', ' in the immediate vicinity') }} @@ -128,6 +128,18 @@ The storm is {{ iif(dist > 0, } {%- endmacro -%} +{%- macro precipitation_color(precip) -%} +:host { + --paper-item-icon-color: + {% if precip in ['unknown', 'unavailable'] %} var(--entity-disabled-color) + {%- elif precip == 'rain' %} var(--entity-rain-color) + {%- elif precip == 'snow' %} var(--entity-snow-color) + {%- else %} var(--state-icon-color) + {%- endif %} + ; +} +{%- endmacro -%} + {%- macro wind_color(wind) -%} :host { --paper-item-icon-color: @@ -178,6 +190,15 @@ The storm is {{ iif(dist > 0, } {%- endmacro -%} +{%- macro cloud_icon(cloud) -%} + {%- set cloud = cloud | int(-1) %} + {%- if cloud < 20 %} mdi:cloud-outline + {%- elif cloud < 50 %} mdi:weather-partly-cloudy + {%- elif cloud < 80 %} mdi:clouds + {%- else %} mdi:cloud + {%- endif -%} +{%- endmacro -%} + {%- macro cloud_color(cloud) -%} :host { --paper-item-icon-color: diff --git a/custom_templates/window.jinja b/custom_templates/window.jinja index 49f056280..7624eb257 100644 --- a/custom_templates/window.jinja +++ b/custom_templates/window.jinja @@ -5,7 +5,7 @@ {%- endif %} {%- endmacro -%} -{%- macro window_color(entity) -%} +{%- macro window_icon_color(entity) -%} {%- set alert_entity = entity ~ '_open_alert' %} {%- set open = state_attr('alarm_control_panel.master', 'open_sensors') if state_attr('alarm_control_panel.master', 'open_sensors') != none else '' %} diff --git a/include/bedtime_report.yaml b/include/bedtime_report.yaml new file mode 100644 index 000000000..8c890a45a --- /dev/null +++ b/include/bedtime_report.yaml @@ -0,0 +1,92 @@ +############################################################################### +## Bedtime Report Template +############################################################################### +| + {%- from 'schedule.jinja' import list_events %} + {%- from 'speech.jinja' import iarticle %} + {%- from 'speech.jinja' import plural_qty %} + {%- set wake_time = states('sensor.next_waketime') | as_datetime %} + {%- set alarm_time = states('sensor.alarm_clock_next_alarm') | as_datetime + if has_value('sensor.alarm_clock_next_alarm') else none %} + {%- set day_reset = today_at(states('input_datetime.day_reset')) %} + {%- set wake_display = state_attr('sensor.next_waketime', '12hour') %} + {%- set source = state_attr('sensor.alarm_clock_next_alarm', 'source') %} + {%- if is_state('input_boolean.bedtime_delayed', 'on') %} + It's almost bedtime but you've elected to stay up late. + Turn the bedtime delay off if you're going to bed now. + {%- else %} + {%- if warn_time > 0 %} + Hey there! Bedtime is in {{ plural_qty('minute', warn_time, false) }}! + Turn on the bedtime delay if you'd like to stay up a bit longer. + {%- endif -%} + {%- endif %} + {%- if is_state('binary_sensor.jason_home', 'on') %} + {%- if is_state('binary_sensor.jason_phone_connected', 'off') %} + Jason your mobile phone is not connected. Did you let the battery die? + {%- elif is_state('jason_phone_battery_alert', 'on') %} + Jason you need to plug in your phone. Your battery level is only {{ states('sensor.jphone_battery_level') }} percent. + {%- endif %} + {%- endif %} + {%- if wake_time == alarm_clock_next_alarm %} + Wake time is at {{ wake_display }}. An alarm has been set on + {%- if source in ['Auto', 'Manual', 'Nap'] %} the {{ source }} alarm clock + {%- elif source == 'Jason Phone' %} Jason's mobile phone + {%- else %} the {{ source }} + {%- endif %} + {%- if source in ['Auto', 'Manual', 'Nap'] -%} + , and will play on the {{ states('select.alarm_clock_media_player_' ~ source | lower) }}{% endif %}. + {%- elif alarm_time != none %} + The alarm clock has been set for {{ state_attr('sensor.alarm_clock_next_alarm', '12hour') }} on + {%- if source == 'Jason Phone' %} Jason's mobile phone + {%- else %} the {{ source }} alarm clock + {%- endif %} + {%- elif wake_time != none %} + Wake time will be at {{ wake_display }}, but there has been no alarm clock set + {%- endif %}. + {%- if wake_time == none + or ((now() > wake_time and is_state('binary_sensor.work_tomorrow', 'on') and is_state('input_boolean.workday_morning', 'off')) + or (now() < wake_time and is_state('binary_sensor.work_today', 'on') and is_state('input_boolean.workday_morning', 'off')) + or (now() > wake_time and is_state('binary_sensor.work_tomorrow', 'off') and is_state('input_boolean.weekend_morning', 'off')) + or (now() < wake_time and is_state('binary_sensor.work_today', 'off') and is_state('input_boolean.weekend_morning', 'off')) + or ( is_state('binary_sensor.owner_home', 'off') and is_state('input_boolean.guest_morning', 'off'))) %} + Just a heads up, + {{- ' there is no wake time set for tomorrow, so the ' if wake_display == 'off' else ' the ' -}} + morning routine has been disabled. Don't forget to set the occupancy mode and disarm the house alarm in the morning! + {%- endif %} + {%- if agenda is defined %} + {%- set events = agenda['calendar.jazzyisj']['events'] %} + {%- if events | count > 0 %} + These are your upcoming calendar events. + {{ list_events(agenda['calendar.jazzyisj']['events']) }} + {%- else %} + There are no upcoming events on your calendar. + {%- endif %} + {%- endif %} + {%- set high = iif(now() < day_reset, states('sensor.outdoor_high_temperature'), + states('sensor.outdoor_high_temperature_tomorrow')) | int('unknown')%} + {%- set condition = iif(now() < day_reset, states('sensor.condition_today'), + states('sensor.condition_tomorrow')) | replace('partlycloudy', 'partly cloudy') %} + {%- set pop = iif(now() < day_reset, states('sensor.precipitation_probability_today'), + states('sensor.precipitation_probability_tomorrow')) | int('unknown') %} + Tommorow will be {{ condition }} with a high of {{ plural_qty('degree', high, false) }} + {%- if not condition is search('rain|pouring|hail|snow') %} + {{- ' and ' ~ iif(pop == 0, 'no', iarticle(pop) ~ ' percent') }} chance of precipitation + {%- endif %}. + {%- if now() >= day_reset and is_state_attr('sensor.next_garbage_day', 'display', 'Tomorrow') + or now() < day_reset and is_state_attr('sensor.next_garbage_day', 'display', 'Today') + and is_state('input_boolean.garbage_alert', 'on') %} + {%- set waste = 'garbage' %} + {%- endif %} + {%- if now() >= day_reset and is_state_attr('sensor.next_recycle_day', 'display', 'Tomorrow') + or now() < day_reset and is_state_attr('sensor.next_recycle_day', 'display', 'Today') + and is_state('input_boolean.recycle_alert', 'on') %} + {%- set waste = 'recycle' %} + {%- endif %} + {%- if now() >= day_reset and is_state_attr('sensor.next_yardwaste_day', 'display', 'Tomorrow') + or now() < day_reset and is_state_attr('sensor.next_yardwaste_day', 'display', 'Today') + and is_state('input_boolean.yardwaste_alert', 'on') %} + {%- set waste = 'yard waste' %} + {%- endif %} + {%- if waste is defined %} + Oh, and one last thing. Did you remember to take out the {{ waste }} today? + {%- endif %} \ No newline at end of file diff --git a/include/weather_report.yaml b/include/weather_report.yaml index 3c7b12371..1ab1ee7ca 100644 --- a/include/weather_report.yaml +++ b/include/weather_report.yaml @@ -15,14 +15,13 @@ {%- set normal_low_diff = states('sensor.outdoor_low_temperature_differential') | int('unknown') %} {%- set show_normal_high = is_number(normal_high_diff) and normal_high_diff | abs > 2 %} {%- set show_normal_low = is_number(normal_low_diff) and normal_low_diff | abs > 2 %} - {%- set humidity = states('sensor.outdoor_humidity') | int(0) %} - {%- set humidty_today = states('sensor.outdoor_humidity_today') | int('unknown') %} + {%- set humidity_today = states('sensor.outdoor_humidity_today') | int('unknown') %} {%- set fog = states('sensor.fog_probability') | int(-1) %} {%- set precip_now = is_state('binary_sensor.precipitation_active', 'on') %} {%- set precipitation_today = is_state('binary_sensor.precipitation_likely_next_24_hours', 'on') %} {%- set precip_start = state_attr('sensor.precipitation_start', '12hour') %} {%- set pop = states('sensor.precipitation_probability_today') | int('unknown') %} - {%- set precip_type = states('sensor.precipitation_type') | replace('none', 'precipitation') %} + {%- set precip_type = states('sensor.precipitation_type') | replace('none', states('states.precipitation_type_expected')) %} {%- set expected_precip = states('sensor.precipitation_expected_today') | float(-1) %} {%- set rain_exp = states('sensor.pirateweather_liquid_accumulation_0d') | float(-1) %} {%- set snow_exp = states('sensor.pirateweather_snow_accumulation_0d') | float(-1) %} @@ -45,13 +44,13 @@ Environment Canada has issued a {{ state_attr('binary_sensor.envcan_weather_alert', 'title') }} for the immediate area {{- ' until ' ~ until if until != none -}}.{% endif %} {%- if high_temp >= states('input_number.outdoor_high_temperature_threshold') | int %} - It will be bloody hot {{ iif(humidty_today > 70, 'and humid') }} today with temperatures reaching {{ high_temp }} + It will be bloody hot {{ iif(humidity_today > 60, 'and humid') }} today with temperatures reaching {{ high_temp }} {%- if app_high_temp - high_temp > 2 %}, and a humidex of {{ app_high_temp }}{% endif %} nut sack soakin' degrees {%- if show_normal_high %}, which is {{ plural_qty('degree', normal_high_diff | abs, false) }} {{ 'lower' if normal_high_diff < 0 else 'higher' }} than normal{% endif %}. The overnight low will be {{ low_temp }} {%- if show_normal_low %}, which is {{ plural_qty('degree', normal_low_diff | abs, false) }} {{ 'lower' if normal_low_diff < 0 else 'higher' }} than normal{% endif %}. {%- elif low_temp <= states('input_number.outdoor_low_temperature_threshold') | int %} - It's going to be friggin cold{% if humidty_today > 60 %} and damp{% endif %} today. + It's going to be friggin cold{% if humidity_today > 60 %} and damp{% endif %} today. The expected high is only {{ plural_qty('degree', high_temp, false) }} {%- if temp - app_temp > 2 %} with a windchill of {{ app_high_temp }} {% endif %} {%- if show_normal_high -%}, which is {{ plural_qty('degree', normal_high_diff | abs, false) }} {{ 'lower' if normal_high_diff < 0 else 'higher' }} than normal. @@ -64,7 +63,6 @@ The overnight low will be {{ plural_qty('degree', low_temp, false) }} {%- if show_normal_low %}, which is {{ plural_qty('degree', normal_low_diff | abs, false) }} {{ 'lower' if normal_low_diff < 0 else 'higher' }} than normal{% endif %}. {%- endif %} - The current humidity is {{ humidity }} percent, and today's average humidity will be {{ humidty_today }} percent. {% if precip_now or precipitation_today %} {%- if precip_now %} It is currently {{ precip_type }}ing. {%- else %} diff --git a/logging/recorder.yaml b/logging/recorder.yaml index 76a8455b3..073e5a059 100644 --- a/logging/recorder.yaml +++ b/logging/recorder.yaml @@ -57,6 +57,8 @@ include: - sensor.outdoor_temperature_daily_average - sensor.outdoor_high_temperature - sensor.outdoor_low_temperature + - sensor.outdoor_normal_high_temperature + - sensor.outdoor_normal_low_temperature - sensor.outdoor_high_temperature_differential - sensor.outdoor_low_temperature_differential - sensor.dew_point @@ -88,7 +90,7 @@ include: - sensor.nearest_storm_bearing - sensor.nearest_storm_distance - sensor.lightning_count - - sensor.lightning_last_strike_distance + - sensor.lightning_distance - sensor.barometric_pressure - sensor.wind_speed - sensor.wind_gust @@ -103,13 +105,12 @@ include: - sensor.uv_index - sensor.uv_index_today - sensor.ozone_index - - sensor.ozone_level - sensor.nitrogen_dioxide - sensor.carbon_monoxide - sensor.sulphur_dioxide - sensor.particulate_matter_2_5 - sensor.fire_index - - sensor.atmospheric_smoke + - sensor.smoke_level #TEST - sensor.tempest_st_00057689_rain_today - sensor.home_sensors_precipitation_today @@ -125,10 +126,6 @@ include: - sensor.tempest_st_00057689_battery - sensor.tempest_st_00057689_voltage - # ~~~~ Environment Canada ~~~~ # graphs - - sensor.windsor_normal_high_temperature - - sensor.windsor_normal_low_temperature - # ~~~~ Shelly Devices ~~~~ # history - sensor.indoor_sump_count - sensor.outdoor_sump_count @@ -149,18 +146,21 @@ include: - sensor.spa_heat_daily_runtime # ~~~~ Climate ~~~~ # graphs - - sensor.thermostat_heat_daily_runtime - - sensor.thermostat_cool_daily_runtime - - sensor.indoor_temperature_differential # statistics - - sensor.indoor_humidity_differential # statistics - sensor.indoor_temperature + - sensor.indoor_temperature_target # statistics + - sensor.indoor_temperature_differential # statistics + - sensor.indoor_humidity + - sensor.indoor_humidity_differential # statistics + - sensor.bathroom_humidity_change - sensor.thermostat_hvac_state # history stats - sensor.thermostat_temperature - sensor.thermostat_humidity - - input_number.thermostat_target_temperature + + - sensor.thermostat_heat_daily_runtime + - sensor.thermostat_cool_daily_runtime - sensor.bathroom_sensor_air_temperature - sensor.bathroom_sensor_humidity diff --git a/packages/climate.yaml b/packages/climate.yaml index b3718a673..3aea72447 100644 --- a/packages/climate.yaml +++ b/packages/climate.yaml @@ -239,7 +239,7 @@ alert: message: | HVAC Mode: {{ states('climate.thermostat') }} HVAC State: {{ state_attr('climate.thermostat', 'hvac_action') }} - Target: {{ states('input_number.thermostat_target_temperature', with_unit=true) }} + Target: {{ states('sensor.indoor_temperature_target', with_unit=true) }} Temperature: {{ states('sensor.indoor_temperature', with_unit=true) }} {%- set entities = state_attr('binary_sensor.indoor_low_temperature_alert', 'entity_id') -%} {%- if entities != none -%} @@ -276,7 +276,7 @@ alert: message: | HVAC Mode: {{ states('climate.thermostat') }} HVAC State: {{ state_attr('climate.thermostat', 'hvac_action') }} - Target: {{ states('input_number.thermostat_target_temperature', with_unit=true) }} + Target: {{ states('sensor.indoor_temperature_target', with_unit=true) }} Temperature: {{ states('sensor.indoor_temperature', with_unit=true) }} {%- set entities = state_attr('binary_sensor.indoor_high_temperature_alert', 'entity_id') -%} {%- if entities != none -%} diff --git a/packages/unavailable_entities.yaml b/packages/unavailable_entities.yaml index 906f6ddca..8e4cff318 100644 --- a/packages/unavailable_entities.yaml +++ b/packages/unavailable_entities.yaml @@ -16,14 +16,13 @@ template: {% set entities = state_attr('group.unavailable_entities', 'entity_id') %} {{ entities | count if entities != none else -1 }} -# OPTIONAL - Uncomment and add individual entities you want to ignore to this group. +# REQUIRED - Add individual entities to ignore to this group. group: ignored_entities: - entities: -# - sensor.example_ignored_entity + entities: [] +# REQUIRED - This is required to create and update the monitored entities group. Sensor updates once every minute. automation: - # REQUIRED - This is required to create and update the monitored entities group - id: update_unavailable_entities_group alias: "Update Unavailable Entities Group" description: "Update unavailable entities group." @@ -52,40 +51,10 @@ automation: | selectattr('state', 'in', ['unknown', 'unavailable']) | rejectattr('domain', 'in', ['button', 'conversation', 'event', 'group', 'image', 'input_button', 'input_text', 'remote', 'tts', 'scene', 'stt']) - | rejectattr('entity_id', 'in', state_attr('group.ignored_entities', 'entity_id') | default([])) + | rejectattr('entity_id', 'in', state_attr('group.ignored_entities', 'entity_id')) | map(attribute='entity_id') | list | sort }} - # OPTIONAL - Example automation to demonstrate how you can utilize this sensor, other examples in examples folder. - # - id: unavailable_entities_notification - # alias: "Unavailable Entities Notification" - # description: "Create persistent notification if unavailable entities, dismiss if none." - # mode: restart - # trigger: - # - trigger: state - # entity_id: sensor.unavailable_entities - # to: - # condition: - # - condition: template - # alias: "Sensor state is a valid numerical value" - # value_template: > - # {{ is_number(trigger.from_state.state) - # and is_number(trigger.to_state.state) }} - # action: - # - if: - # - condition: numeric_state - # entity_id: sensor.unavailable_entities - # below: 1 - # then: - # - action: persistent_notification.dismiss - # data: - # notification_id: unavailable_entities - # else: - # - action: persistent_notification.create - # data: - # notification_id: unavailable_entities - # title: "Unavailable Entities" - # message: "{{ state_attr('group.unavailable_entities', 'entity_id') | join('\n') }}" - + # OPTIONAL - Example automation to demonstrate how you can utilize this sensor, see example folder for more. - id: unavailable_entities_notification alias: "Unavailable Entities Notification" description: "Create persistent notification if unavailable entities, dismiss if none." @@ -93,8 +62,8 @@ automation: trigger: - trigger: state entity_id: sensor.unavailable_entities - attribute: entity_id to: ~ + for: 5 # prevent blank notifications condition: - condition: template alias: "Sensor state is a valid numerical value" @@ -102,37 +71,18 @@ automation: {{ is_number(trigger.from_state.state) and is_number(trigger.to_state.state) }} action: - - service: persistent_notification.create - data: - notification_id: unavailable_entities - title: "Unavailable Entities" - message: > - {% set ns = namespace(result=[]) %} - {% for s in expand(state_attr('sensor.unavailable_entities', 'entity_id')) %} - {% set ns.result = ns.result + [ - device_attr(s.entity_id, "name") ~ "|" ~ device_id(s.entity_id) ~ "|- **" ~ s.name ~ "**\n" - ~ " - *entity_id*: " ~ s.entity_id ~ "\n" - ~ " - *state*: " ~ s.state ~ "\n" - ] - %} - {% endfor %} - {% set ns.result = ns.result | sort %} - {% set lastdev = namespace( id="" ) %} - {% set tarr = ns.result %} - {% set ns.result = [] %} - {% for item in tarr %} - {% set dev = namespace( id="" ) %} - {% set entity = namespace( data="" ) %} - {% set dev.id = item.split("|")[1] %} - {% set entity.data = item.split("|")[2] %} - {% if lastdev.id != dev.id %} - {% if dev.id != 'None' %} - {% set ns.result = ns.result + [ "**" ~ device_attr(dev.id, "name") ~ "**" ] %} - {% else %} - {% set ns.result = ns.result + [ "**Non-Device Entities**" ] %} - {% endif %} - {% set lastdev.id = dev.id %} - {% endif %} - {% set ns.result = ns.result + [ entity.data ] %} - {% endfor %} - {{ ns.result | join('\n') }} \ No newline at end of file + - if: + - condition: numeric_state + entity_id: sensor.unavailable_entities + below: 1 + then: + - action: persistent_notification.dismiss + data: + notification_id: unavailable_entities + else: + - action: persistent_notification.create + data: + notification_id: unavailable_entities + title: "Unavailable Entities" + message: "{{ state_attr('group.unavailable_entities', 'entity_id') | join('\n') }}" + diff --git a/packages/weather.yaml b/packages/weather.yaml index 253883229..70af905d0 100644 --- a/packages/weather.yaml +++ b/packages/weather.yaml @@ -21,6 +21,9 @@ homeassistant: alert.precipitation: icon: mdi:weather-snowy-rainy category: weather + tts_repeat: true + tts_timeout: 240 + quiet_play: true alert.outdoor_high_temperature: icon: mdi:thermometer-alert category: weather @@ -240,7 +243,7 @@ alert: lightning: name: "Lightning" title: "Lightning Alert" - message: "Strikes: {{ states('sensor.lightning_count') }} - Distance: {{ states('sensor.lightning_last_strike_distance', with_unit=true) }}" + message: "Strikes: {{ states('sensor.lightning_count') }} - Distance: {{ states('sensor.lightning_distance', with_unit=true) }}" done_message: clear_notification entity_id: binary_sensor.lightning_alert state: "on" diff --git a/scripts/schedule/bedtime.yaml b/scripts/schedule/bedtime.yaml index 2b7664bfa..529378f0f 100644 --- a/scripts/schedule/bedtime.yaml +++ b/scripts/schedule/bedtime.yaml @@ -66,92 +66,7 @@ bedtime: data: variables: quiet_play: true - message: | - {%- from 'schedule.jinja' import list_events %} - {%- from 'speech.jinja' import iarticle %} - {%- from 'speech.jinja' import plural_qty %} - {%- set wake_time = states('sensor.next_waketime') | as_datetime %} - {%- set alarm_time = states('sensor.alarm_clock_next_alarm') | as_datetime - if has_value('sensor.alarm_clock_next_alarm') else none %} - {%- set day_reset = today_at(states('input_datetime.day_reset')) %} - {%- set wake_display = state_attr('sensor.next_waketime', '12hour') %} - {%- set source = state_attr('sensor.alarm_clock_next_alarm', 'source') %} - {%- if is_state('input_boolean.bedtime_delayed', 'on') %} - It's almost bedtime but you've elected to stay up late. - Turn the bedtime delay off if you're going to bed now. - {%- else %} - {%- if warn_time > 0 %} - Hey there! Bedtime is in {{ plural_qty('minute', warn_time, false) }}! - Turn on the bedtime delay if you'd like to stay up a bit longer. - {%- endif -%} - {%- endif %} - {%- if is_state('binary_sensor.jason_home', 'on') %} - {%- if is_state('binary_sensor.jason_phone_connected', 'off') %} - Jason your mobile phone is not connected. Did you let the battery die? - {%- elif is_state('jason_phone_battery_alert', 'on') %} - Jason you need to plug in your phone. Your battery level is only {{ states('sensor.jphone_battery_level') }} percent. - {%- endif %} - {%- endif %} - {%- if wake_time == alarm_clock_next_alarm %} - Tomorrow's wake time is at {{ wake_display }}. An alarm has been set on - {%- if source in ['Auto', 'Manual', 'Nap'] %} the {{ source }} alarm clock - {%- elif source == 'Jason Phone' %} Jason's mobile phone - {%- else %} the {{ source }} - {%- endif %} - {%- if source in ['Auto', 'Manual', 'Nap'] -%} - , and will play on the {{ states('select.alarm_clock_media_player_' ~ source | lower) }}{% endif %}. - {%- elif alarm_time != none %} - Tomorrow's alarm clock has been set for {{ state_attr('sensor.alarm_clock_next_alarm', '12hour') }} on - {%- if source == 'Jason Phone' %} Jason's mobile phone - {%- else %} the {{ source }} alarm clock - {%- endif %} - {%- elif wake_time != none %} - Tomorrow's wake time will be at {{ wake_display }}, but there has been no alarm clock set - {%- endif %}. - {%- if wake_time == none - or ((now() > wake_time and is_state('binary_sensor.work_tomorrow', 'on') and is_state('input_boolean.workday_morning', 'off')) - or (now() < wake_time and is_state('binary_sensor.work_today', 'on') and is_state('input_boolean.workday_morning', 'off')) - or (now() > wake_time and is_state('binary_sensor.work_tomorrow', 'off') and is_state('input_boolean.weekend_morning', 'off')) - or (now() < wake_time and is_state('binary_sensor.work_today', 'off') and is_state('input_boolean.weekend_morning', 'off')) - or ( is_state('binary_sensor.owner_home', 'off') and is_state('input_boolean.guest_morning', 'off'))) %} - Just a heads up, - {{- ' there is no wake time set for tomorrow, so the ' if wake_display == 'off' else ' the ' -}} - morning routine has been disabled. Don't forget to set the occupancy mode and disarm the house alarm in the morning! - {%- endif %} - {%- if agenda is defined %} - {%- set events = agenda['calendar.jazzyisj']['events'] %} - {%- if events | count > 0 %} - These are your upcoming calendar events. - {{ list_events(agenda['calendar.jazzyisj']['events']) }} - {%- else %} - There are no upcoming events on your calendar. - {%- endif %} - {%- endif %} - {%- set high = iif(now() < day_reset, states('sensor.outdoor_high_temperature'), - states('sensor.outdoor_high_temperature_tomorrow')) | int('unknown')%} - {%- set condition = iif(now() < day_reset, states('sensor.condition_today'), - states('sensor.condition_tomorrow')) | replace('partlycloudy', 'partly cloudy') %} - {%- set pop = iif(now() < day_reset, states('sensor.precipitation_probability_today'), - states('sensor.precipitation_probability_tomorrow')) | int('unknown') %} - Tommorow will be {{ condition }} with a high of {{ plural_qty('degree', high, false) }} and {{ iif(pop == 0, 'no', iarticle(pop) ~ ' percent') }} chance of precipitation. - {%- if now() >= day_reset and is_state_attr('sensor.next_garbage_day', 'display', 'Tomorrow') - or now() < day_reset and is_state_attr('sensor.next_garbage_day', 'display', 'Today') - and is_state('input_boolean.garbage_alert', 'on') %} - {%- set waste = 'garbage' %} - {%- endif %} - {%- if now() >= day_reset and is_state_attr('sensor.next_recycle_day', 'display', 'Tomorrow') - or now() < day_reset and is_state_attr('sensor.next_recycle_day', 'display', 'Today') - and is_state('input_boolean.recycle_alert', 'on') %} - {%- set waste = 'recycle' %} - {%- endif %} - {%- if now() >= day_reset and is_state_attr('sensor.next_yardwaste_day', 'display', 'Tomorrow') - or now() < day_reset and is_state_attr('sensor.next_yardwaste_day', 'display', 'Today') - and is_state('input_boolean.yardwaste_alert', 'on') %} - {%- set waste = 'yard waste' %} - {%- endif %} - {%- if waste is defined %} - Oh. And Jason, one last thing. Did you remember to take out the {{ waste }} today? - {%- endif %} + message: !include /config/include/bedtime_report.yaml continue_on_error: true - wait_template: "{{ is_state('input_boolean.bedtime_delayed', 'on') }}" diff --git a/templates/climate.yaml b/templates/climate.yaml index 622be66d3..9b4e317da 100644 --- a/templates/climate.yaml +++ b/templates/climate.yaml @@ -74,9 +74,9 @@ # entity default 999 so never lower than threshold when unknown/unavailable entity_id: > {% set entities = namespace(value=[]) %} - {% set thresh = states('input_number.low_temperature_threshold') | int %} + {% set thresh = states('input_number.low_temperature_threshold') | float %} {% set sensors = expand('group.indoor_temperature_sensors') %} - {% for item in sensors if states(item.entity_id) | int(999) < thresh | int %} + {% for item in sensors if states(item.entity_id) | float(999) < thresh %} {% set entities.value = entities.value + [item.entity_id] %} {% endfor %} {{ entities.value }} @@ -188,7 +188,14 @@ or is_number(states('sensor.living_room_temperature')) or is_number(states('sensor.bedroom_temperature')) }} - # indoor temperature relative to outdoor temperature + - name: "Indoor Temperature Target" + unique_id: indoor_temperature_target # req for statistics + device_class: temperature + state_class: measurement + unit_of_measurement: °C + state: "{{ states('input_number.thermostat_target_temperature') }}" + + # indoor/outdoor temperature differeance - name: "Indoor Temperature Differential" unique_id: indoor_temperature_differential device_class: temperature @@ -223,7 +230,7 @@ or is_number(states('sensor.living_room_humidity')) or is_number(states('sensor.bedroom_humidity')) }} - # indoor humidity relative to outdoor humidity + # indoor/outdoor humidity differeance - name: "Indoor Humidity Differential" unique_id: indoor_humidity_differential device_class: humidity diff --git a/templates/schedule/calendar.yaml b/templates/schedule/calendar.yaml index 7f2864103..7072a0c92 100644 --- a/templates/schedule/calendar.yaml +++ b/templates/schedule/calendar.yaml @@ -147,11 +147,11 @@ {% else %} mdi:trash-can {% endif %} state: > - {% set garbage = states('sensor.next_garbage_day') | as_datetime | as_local + {% set garbage = as_datetime(states('sensor.next_garbage_day')) if has_value('sensor.next_garbage_day') else none %} - {% set recycle = states('sensor.next_recycle_day') | as_datetime | as_local + {% set recycle = as_datetime(states('sensor.next_recycle_day')) if has_value('sensor.next_recycle_day') else none %} - {% set yardwaste = states('sensor.next_yardwaste_day') | as_datetime | as_local + {% set yardwaste = as_datetime(states('sensor.next_yardwaste_day')) if has_value('sensor.next_yardwaste_day') else none %} {% set types = [garbage, recycle, yardwaste] %} {% set active = namespace(types=[]) %} @@ -178,14 +178,14 @@ {% elif next == states('sensor.next_yardwaste_day') %} yardwaste {% endif %} - #MIDNIGHT add day_reset to prevent alerts night before, as_local to add tz + #MIDNIGHT add day_reset to prevent alerts night before after midnight, as_local to add tz - name: "Next Garbage Day" unique_id: next_garbage_day icon: mdi:trash-can device_class: timestamp state: > {% if state_attr('calendar.garbage', 'start_time') != none %} - {{ state_attr('calendar.garbage', 'start_time') | as_datetime | as_local + {{ as_datetime(as_timestamp(state_attr('calendar.garbage', 'start_time'))) + as_timedelta(states('input_datetime.day_reset')) }} {% else %} {{ none }} {% endif %} @@ -199,14 +199,14 @@ {% endif %} {% endif %} - # add day_reset to prevent alerts night before, as_local to add tz + #MIDNIGHT add day_reset to prevent alerts night before after midnight, as_timestamp to add tz - name: "Next Recycle Day" unique_id: next_recycle_day icon: mdi:recycle device_class: timestamp state: > {% if state_attr('calendar.recycle', 'start_time') != none %} - {{ state_attr('calendar.recycle', 'start_time') | as_datetime | as_local + {{ as_datetime(as_timestamp(state_attr('calendar.recycle', 'start_time'))) + as_timedelta(states('input_datetime.day_reset')) }} {% else %} {{ none }} {% endif %} @@ -220,14 +220,14 @@ {% endif %} {% endif %} - # add day_reset to prevent alerts night before, as_local to add tz + #MIDNIGHT add day_reset to prevent alerts night before after midnight, as_timestamp to add tz - name: "Next Yardwaste Day" unique_id: next_yardwaste_day icon: mdi:pine-tree device_class: timestamp state: > {% if state_attr('calendar.yardwaste', 'start_time') != none %} - {{ state_attr('calendar.yardwaste', 'start_time') | as_datetime | as_local + {{ as_datetime(as_timestamp(state_attr('calendar.yardwaste', 'start_time'))) + as_timedelta(states('input_datetime.day_reset')) }} {% else %} {{ none }} {% endif %} @@ -246,14 +246,14 @@ {{ start - now() < timedelta(days=3) and start - now() > timedelta(days=1) }} {% endif %} - # add day_reset to prevent alerts night before, as_local to add tz + #MIDNIGHT add day_reset to prevent alerts night before after midnight, as_local to add tz - name: "Next Holiday" unique_id: next_holiday icon: mdi:calendar-heart device_class: timestamp state: > {% if state_attr('calendar.canada_on', 'start_time') != none %} - {{ state_attr('calendar.canada_on', 'start_time') | as_datetime | as_local + {{ as_datetime(as_timestamp(state_attr('calendar.canada_on', 'start_time'))) + as_timedelta(states('input_datetime.day_reset')) }} {% else %} {{ none }} {% endif %} diff --git a/templates/schedule/commute.yaml b/templates/schedule/commute.yaml index 4d4c9c026..f4d746612 100644 --- a/templates/schedule/commute.yaml +++ b/templates/schedule/commute.yaml @@ -114,7 +114,7 @@ {% set commute_time = states('input_number.commute_time') | int(-1) %} {% set travel_time = states('sensor.jason_time_to_work') | int(commute_time) %} {% set time = [commute_time, travel_time] | max %} - {{ states('sensor.arrive_work_time_target') | as_datetime - timedelta(minutes=time) + {{ as_datetime(states('sensor.arrive_work_time_target')) - timedelta(minutes=time) if is_state('binary_sensor.work_today', 'on') and has_value('sensor.arrive_work_time_target') and time > -1 else none }} attributes: @@ -133,14 +133,14 @@ {% from 'speech.jinja' import twelve_hour %} {{ twelve_hour(this.entity_id) }} leave_min: > - {{ ((states('sensor.leave_home_time') | as_timestamp - now().timestamp()) / 60) | int + {{ ((as_timestamp(states('sensor.leave_home_time')) - now().timestamp()) / 60) | int if has_value('sensor.leave_home_time') else none }} - name: "Car Start Time" unique_id: car_start_time device_class: timestamp state: > - {{ (states('sensor.leave_home_time') | as_datetime).replace(second=0, microsecond=0) - timedelta(minutes=15) + {{ (as_datetime(states('sensor.leave_home_time'))).replace(second=0, microsecond=0) - timedelta(minutes=15) if is_state('binary_sensor.owner_home', 'on') and has_value('sensor.leave_home_time') else none }} - name: "Arrive Work Time" @@ -156,12 +156,11 @@ late_time: > {% if is_state('binary_sensor.work_today', 'on') and has_value('sensor.arrive_work_time') - and has_value('sensor.arrive_work_time_target') %} - {% set arrive = states('sensor.arrive_work_time') | as_datetime %} - {% set target = states('sensor.arrive_work_time_target') | as_datetime %} - {% if not is_state('person.jason', 'work') - and now() - arrive < timedelta(hours = 1) - and arrive > target %} + and has_value('sensor.arrive_work_time_target') + and not is_state('person.jason', 'work') %} + {% set arrive = as_datetime(states('sensor.arrive_work_time')) %} + {% set target = as_datetime(states('sensor.arrive_work_time_target')) %} + {% if now() - arrive < timedelta(hours = 1) and arrive > target %} {{ arrive - target }} {% endif %} {% endif %} diff --git a/templates/schedule/schedule.yaml b/templates/schedule/schedule.yaml index 23dc328a9..3d30c3a75 100644 --- a/templates/schedule/schedule.yaml +++ b/templates/schedule/schedule.yaml @@ -308,7 +308,7 @@ {% elif bedtime > waketime > now() %} {% set bedtime = bedtime - timedelta(days=1) %} {% endif %} {% endif %} - {{ bedtime.isoformat() if bedtime > now() else bedtime + timedelta(days=1) }} + {{ bedtime if bedtime > now() else bedtime + timedelta(days=1) }} attributes: 12hour: > {% from 'speech.jinja' import twelve_hour %} diff --git a/templates/schedule/work_schedule.yaml b/templates/schedule/work_schedule.yaml index bf36238fe..6d2b6fead 100644 --- a/templates/schedule/work_schedule.yaml +++ b/templates/schedule/work_schedule.yaml @@ -84,11 +84,11 @@ # holiday start within 1 day and holiday end > 1 day away # calendar dates not tz aware - use as_local to add tz state: > - {% set start = state_attr('calendar.work_holiday', 'start_time') %} - {% set end = state_attr('calendar.work_holiday', 'end_time') %} + {% set start = as_datetime(state_attr('calendar.work_holiday', 'start_time'), none) %} + {% set end = as_datetime(state_attr('calendar.work_holiday', 'end_time'), none) %} {% if start != none and end != none %} - {% set holiday_tomorrow = start | as_datetime | as_local - now() < timedelta(days=1, minutes=1) - and end | as_datetime | as_local - now() > timedelta(days=1, minutes=1) %} + {% set holiday_tomorrow = as_local(start) - now() < timedelta(days=1, minutes=1) + and as_local(end) - now() > timedelta(days=1, minutes=1) %} {% else %} {% set holiday_tomorrow = false %} {% endif %} {% if is_state('input_boolean.work_schedule', 'on') %} diff --git a/templates/weather/weather.yaml b/templates/weather/weather.yaml index dda1aefb6..ad9dab467 100644 --- a/templates/weather/weather.yaml +++ b/templates/weather/weather.yaml @@ -73,7 +73,7 @@ - name: Weather Forecasts unique_id: weather_forecasts #TEMP while testing device_class: timestamp - state: "{{ now().isoformat() }}" + state: "{{ utcnow() }}" attributes: envcan_hourly: "{% if hourly is defined and hourly['weather.windsor_forecast'] is defined %}{{ hourly['weather.windsor_forecast']['forecast'] }}{% endif %}" envcan_daily: "{% if daily is defined and daily['weather.windsor_forecast'] is defined %}{{ daily['weather.windsor_forecast']['forecast'] }}{% endif %}" @@ -101,7 +101,7 @@ visibility_unit: "{{ state_attr('sensor.visibility', 'unit_of_measurement') }}" precipitation: "{{ states('sensor.precipitation_accumulation_today') }}" precipitation_unit: "{{ state_attr('sensor.precipitation_accumulation_today', 'unit_of_measurement') }}" - updated: "{{ now().isoformat() }}" + updated: "{{ utcnow() }}" # use pirateweather, weatherflow first, no precipitation in envcan forecast: > {% if daily is defined %} @@ -375,20 +375,20 @@ - action: input_number.set_value target: - entity_id: input_number.lightning_last_strike_distance + entity_id: input_number.lightning_distance data: - value: "{{ now() }}" + value: "{{ states('sensor.home_lightning_distance') | int }}" sensor: - - name: "Lightning Last Strike Distance" - unique_id: lightning_last_strike_distance + - name: "Lightning Distance" + unique_id: lightning_distance icon: mdi:clock-star-four-points device_class: distance state_class: measurement unit_of_measurement: km - state: "{{ states('input_number.lightning_last_strike_distance') | int }}" + state: "{{ states('input_number.lightning_distance') | int }}" attributes: provider: "Blitzortung" - availability: "{{ has_value('input_number.lightning_last_strike_distance') }}" + availability: "{{ has_value('input_number.lightning_distance') }}" - trigger: - trigger: homeassistant @@ -409,7 +409,7 @@ target: entity_id: input_text.lightning_last_strike data: - value: "{{ now() }}" + value: "{{ utcnow() }}" sensor: - name: "Lightning Last Strike" unique_id: lightning_last_strike @@ -580,26 +580,26 @@ unique_id: outdoor_temperature_above_normal state: > {{ states('sensor.outdoor_apparent_temperature') | int - > (states('sensor.windsor_normal_high_temperature') | int + > (states('sensor.outdoor_normal_high_temperature') | int + states('input_number.outdoor_temperature_above_normal_threshold') | int) }} attributes: provider: "Environment Canada" availability: > {{ is_number(states('sensor.outdoor_apparent_temperature')) - and is_number(states('sensor.windsor_normal_high_temperature')) }} + and is_number(states('sensor.outdoor_normal_high_temperature')) }} - name: "Outdoor Temperature Below Normal" unique_id: outdoor_temperature_below_normal state: > {{ states('sensor.outdoor_apparent_temperature') | int - < (states('sensor.windsor_normal_low_temperature') | int + < (states('sensor.outdoor_normal_low_temperature') | int - states('input_number.outdoor_temperature_below_normal_threshold') | int) and is_state('input_boolean.weather_alerts', 'on') }} attributes: provider: "Environment Canada" availability: > {{ is_number(states('sensor.outdoor_apparent_temperature')) - and is_number(states('sensor.windsor_normal_low_temperature')) }} + and is_number(states('sensor.outdoor_normal_low_temperature')) }} - name: "Outdoor High Temperature Alert" unique_id: outdoor_high_temperature_alert @@ -659,7 +659,7 @@ {% set time = states('sensor.precipitation_start') | as_datetime if has_value('sensor.precipitation_start') else none %} {{ is_state('binary_sensor.precipitation_active', 'off') - and time != none and time > now() and time - now() < timedelta(hours=2) }} + and time != none and time > utcnow() and time - utcnow() < timedelta(hours=2) }} - name: "Precipitation Likely Next 24 Hours" # next 24 hours unique_id: precipitation_likely_next_24_hours @@ -669,14 +669,14 @@ if has_value('sensor.precipitation_start') else none %} {{ is_state('binary_sensor.precipitation_active', 'off') and is_state('binary_sensor.precipitation_likely_soon', 'off') - and time != none and time > now() and time - now() < timedelta(hours=24) }} + and time != none and time > utcnow() and time - utcnow() < timedelta(hours=24) }} - name: "Precipitation Alert" unique_id: precipitation_alert icon: mdi:weather-snowy-rainy # prevent multiple triggers scattered showers, no delay after restart delay_off: > - {% set update = true if now() - states('sensor.uptime') | as_datetime + {% set update = true if utcnow() - states('sensor.uptime') | as_datetime < timedelta(minutes=5) else false %} {{ iif(update, 0, 3600) }} state: > @@ -690,18 +690,16 @@ - name: "Lightning" unique_id: lightning icon: mdi:weather-lightning - state: "{{ states('sensor.lightning_count') | int(-1) > 0 }}" - availability: "{{ is_number(states('sensor.lightning_count')) }}" + state: "{{ states('sensor.lightning_count') | int > 0 }}" + availability: "{{ states('sensor.lightning_count') | int(-1) >= 0 }}" - name: "Lightning Alert" unique_id: lightning_alert icon: mdi:flash-alert device_class: safety state: > - {{ is_number(states('sensor.lightning_last_strike_distance')) - and is_number(states('sensor.lightning_count')) - and states('sensor.lightning_last_strike_distance') | int < 5 - and states('sensor.lightning_count') | int > 0 }} + {{ states('sensor.lightning_distance') | int(-1) < 10 + and states('sensor.lightning_count') | int(-1) > 0 }} ############################################################################### ## Wind @@ -712,8 +710,8 @@ device_class: safety delay_on: 300 delay_off: > - {% set update = true if now() - states('sensor.uptime') | as_datetime < timedelta(minutes=5) - or now() - states.input_number.wind_alert_threshold.last_changed + {% set update = true if utcnow() - states('sensor.uptime') | as_datetime < timedelta(minutes=5) + or utcnow() - states.input_number.wind_alert_threshold.last_changed < timedelta(seconds=60) else false %} {{ iif(update, 0, 3600) }} state: > @@ -927,6 +925,17 @@ provider: "Pirate Weather" availability: "{{ has_value('sensor.pirateweather_daytime_high_temperature_time_0d') }}" + - name: "Outdoor Normal High Temperature" + unique_id: outdoor_normal_high_temperature # req envcan no state class for statistics for apex graphs + icon: mdi:sun-thermometer + device_class: temperature + state_class: measurement + unit_of_measurement: °C + state: "{{ states('sensor.windsor_normal_high_temperature') }}" + attributes: + provider: "Environment Canada" + availability: "{{ is_number(states('sensor.windsor_normal_high_temperature')) }}" + - name: "Outdoor High Temperature Differential" unique_id: outdoor_high_temperature_differential icon: mdi:sun-thermometer @@ -935,11 +944,11 @@ unit_of_measurement: °C state: > {{ states('sensor.outdoor_high_temperature') | int - - states('sensor.windsor_normal_high_temperature') | int }} + - states('sensor.outdoor_normal_high_temperature') | int }} attributes: provider: "Environment Canada" availability: > - {{ is_number(states('sensor.windsor_normal_high_temperature')) + {{ is_number(states('sensor.outdoor_normal_high_temperature')) and is_number(states('sensor.outdoor_high_temperature')) }} - name: "Outdoor Low Temperature" @@ -993,6 +1002,17 @@ provider: "Pirate Weather" availability: "{{ has_value('sensor.pirateweather_daily_low_temperature_time_1d') }}" + - name: "Outdoor Normal Low Temperature" + unique_id: outdoor_normal_low_temperature # req envcan no state class for statistics for apex graphs + icon: mdi:snowflake-thermometer + device_class: temperature + state_class: measurement + unit_of_measurement: °C + state: "{{ states('sensor.windsor_normal_low_temperature') }}" + attributes: + provider: "Environment Canada" + availability: "{{ is_number(states('sensor.windsor_normal_low_temperature')) }}" + - name: "Outdoor Low Temperature Differential" unique_id: outdoor_low_temperature_differential icon: mdi:snowflake-thermometer @@ -1001,11 +1021,11 @@ unit_of_measurement: °C state: > {{ states('sensor.outdoor_low_temperature') | int - - states('sensor.windsor_normal_low_temperature') | int }} + - states('sensor.outdoor_normal_low_temperature') | int }} attributes: provider: "Environment Canada" availability: > - {{ is_number(states('sensor.windsor_normal_low_temperature')) + {{ is_number(states('sensor.outdoor_normal_low_temperature')) and is_number(states('sensor.outdoor_low_temperature')) }} ############################################################################### @@ -1023,6 +1043,23 @@ {{ is_state('binary_sensor.tempest_integration_connected', 'on') and is_number(states('sensor.tempest_st_00057689_humidity')) }} + - name: "Outdoor Humidity Level" + unique_id: outdoor_humidity_level + icon: mdi:water-percent + device_class: enum + state: > + {% set humidity = states('sensor.outdoor_humidity') | float %} + {% if humidity >= 80 %} Very Humid + {% elif humidity >= 60 %} Humid + {% elif humidity >= 30 %} Comfortable + {% elif humidity >= 20 %} Dry + {% else %} Very Dry + {% endif %} + attributes: + options: "{{ ['Very Humid', 'Humid', 'Comfortable', 'Dry', 'Very Dry'] }}" + provider: "{{ state_attr('sensor.outdoor_humidity', 'provider') }}" + availability: "{{ is_number(states('sensor.outdoor_humidity')) }}" + - name: "Outdoor Humidity Today" unique_id: outdoor_humidity_today device_class: humidity @@ -1089,6 +1126,48 @@ provider: "{{ state_attr('sensor.dew_point', 'provider') }}" availability: "{{ is_number(states('sensor.dew_point')) }}" + - name: "Dew Point Today" + unique_id: dew_point_today + icon: mdi:thermometer-water + device_class: temperature + state_class: measurement + unit_of_measurement: °C + state: > + {% set dew_point = namespace(value=[]) %} + {% set forecast = state_attr('sensor.hourly_weather', 'forecast') %} + {% for item in forecast if utcnow().day == as_datetime(item.datetime).day %} + {% set dew_point.value = dew_point.value + [item.dew_point] %} + {% endfor %} + {{ dew_point.value | min }} + attributes: + provider: "Daily Weather" + availability: > + {{ state_attr('sensor.hourly_weather', 'forecast') != none + and state_attr('sensor.hourly_weather', 'forecast')[0] is defined + and state_attr('sensor.hourly_weather', 'forecast')[0].dew_point is defined + and is_number(state_attr('sensor.hourly_weather', 'forecast')[0].dew_point) }} + + - name: "Dew Point Tomorrow" + unique_id: dew_point_tomorrow + icon: mdi:thermometer-water + device_class: temperature + state_class: measurement + unit_of_measurement: °C + state: > + {% set dew_point = namespace(value=[]) %} + {% set forecast = state_attr('sensor.hourly_weather', 'forecast') %} + {% for item in forecast if utcnow().day + 1 == as_datetime(item.datetime).day %} + {% set dew_point.value = dew_point.value + [item.dew_point] %} + {% endfor %} + {{ dew_point.value | min }} + attributes: + provider: "Daily Weather" + availability: > + {{ state_attr('sensor.hourly_weather', 'forecast') != none + and state_attr('sensor.hourly_weather', 'forecast')[0] is defined + and state_attr('sensor.hourly_weather', 'forecast')[0].dew_point is defined + and is_number(state_attr('sensor.hourly_weather', 'forecast')[0].dew_point) }} + ############################################################################### ## Precipitation ############################################################################### @@ -1367,7 +1446,9 @@ {% if condition | contains('snow') %} snow {% elif states('sensor.tempest_st_00057689_rain_intensity') | float(0) > 0 and (condition | contains('rain') - or condition | contains('pouring')) %} rain + or condition | contains('pouring') + or condition | contains('lightning') + or condition | contains('hail')) %} rain {% elif states('sensor.precipitation_intensity') | float(0) > 0 %} {% if is_state('binary_sensor.freezing', 'off') %} rain {% else %} snow @@ -1376,6 +1457,37 @@ {% endif %} availability: "{{ has_value('sensor.current_condition') }}" + - name: "Precipitation Type Expected" + unique_id: precipitation_type_expected + icon: > + {% set type = states(this.entity_id) %} + {% if type == 'rain' %} mdi:weather-pouring + {% elif type == 'snow' %} mdi:weather-snowy + {% else %} mdi:weather-rainy + {% endif %} + state: > + {% set expected = namespace(value=none) %} + {% if is_state('binary_sensor.precipitation_active', 'on') + or is_state('binary_sensor.precipitation_likely_soon', 'on') + or is_state('binary_sensor.precipitation_likely_next_24_hours', 'on') %} + {% set forecast = state_attr('sensor.hourly_weather', 'forecast') %} + {% for item in forecast %} + {% set condition = item.condition %} + {% if condition | contains('snow') %} + {% set expected.value = 'snow' %} + {% break %} + {% elif condition | contains('rain') + or condition | contains('pouring') + or condition | contains('lightning') + or condition | contains('hail') %} + {% set expected.value = 'rain' %} + {% break %} + {% endif %} + {% endfor %} + {% endif %} + {{ expected.value if expected.value != none else 'snow' if is_state('binary_sensor.freezing', 'on') else 'rain' }} + availability: "{{ state_attr('sensor.hourly_weather', 'forecast') not in [none, []] }}" + - name: "Precipitation Start" # next 24 hours unique_id: precipitation_start icon: mdi:weather-pouring @@ -1391,6 +1503,7 @@ and item.precipitation_probability | int(-1) >= 40 and (item.condition | contains('rain') or item.condition | contains('snow') + or item.condition | contains('pouring') or item.condition | contains('storm')) %} {% set time.value = item.datetime %} {% break %} @@ -1402,24 +1515,6 @@ 12hour: > {% from 'speech.jinja' import twelve_hour %} {{ twelve_hour(this.entity_id) }} - type: > - {% set forecast = state_attr('sensor.hourly_envcan', 'forecast') %} - {% set type = namespace(value=none) %} - {% if is_state('binary_sensor.precipitation_active', 'on') %} - {% set type.value = states('sensor.precipitation_type') %} - {% else %} - {% for item in forecast %} - {% if loop.index0 < 12 and item.precipitation_probability | int(-1) >= 30 %} - {% if item.condition | contains('rain') or item.condition | contains('storm') %} - {% set type.value = 'rain' %} - {% elif item.condition | contains('snow') %} - {% set type.value = 'snow' %} - {% endif %} - {% break %} - {% endif %} - {% endfor %} - {% endif %} - {{ type.value }} provider: "Environment Canada" # more accurate that pirate, not synced with forecast sensor availability: "{{ state_attr('sensor.hourly_envcan', 'forecast') not in ['', none] }}" @@ -1433,7 +1528,7 @@ state: "{{ states('sensor.pirateweather_nearest_storm_bearing') }}" attributes: provider: "Pirate Weather" - availability: "{{ is_number(states('sensor.pirateweather_nearest_storm_bearing')) }}" + availability: "{{ states('sensor.pirateweather_nearest_storm_bearing') | int(-1) >= 0 }}" # filter erroreous negative values - name: "Nearest Storm Full Direction" unique_id: nearest_storm_full_direction @@ -1453,7 +1548,7 @@ state: "{{ states('sensor.pirateweather_nearest_storm_distance') | int }}" attributes: provider: "Pirate Weather" - availability: "{{ is_number(states('sensor.pirateweather_nearest_storm_distance')) }}" + availability: "{{ states('sensor.pirateweather_nearest_storm_distance') | int(-1) >= 0 }}" # filter erroreous negative values - name: "Lightning Count" unique_id: lightning_count @@ -1525,7 +1620,7 @@ state: "{{ states('sensor.pirateweather_wind_speed') | int }}" attributes: provider: "Pirate Weather" # tempest not accurate - availability: "{{ is_number(states('sensor.pirateweather_wind_speed')) }}" + availability: "{{ states('sensor.pirateweather_wind_speed') | int(-1) >= 0 }}" # filter erroreous negative values - name: "Wind Speed Today" unique_id: wind_speed_today @@ -1566,7 +1661,8 @@ state: "{{ states('sensor.pirateweather_wind_gust') | int }}" attributes: provider: "Pirate Weather" # tempest not accurate - availability: "{{ is_number(states('sensor.pirateweather_wind_gust')) }}" + availability: "{{ states('sensor.pirateweather_wind_gust') | int(-1) >= 0 }}" # filter erroreous negative values + - name: "Wind Gust Today" unique_id: wind_gust_today @@ -1620,7 +1716,7 @@ state: "{{ states('sensor.pirateweather_wind_bearing') | int }}" attributes: provider: "Pirate Weather" # tempest not accurate - availability: "{{ is_number(states('sensor.pirateweather_wind_bearing')) }}" + availability: "{{ states('sensor.pirateweather_wind_bearing') | int(-1) >= 0 }}" # filter erroreous negative values - name: "Wind Direction" unique_id: wind_direction @@ -1671,23 +1767,26 @@ ############################################################################### - name: "Cloud Coverage" unique_id: cloud_coverage - icon: mdi:cloud + icon: > + {% from 'weather.jinja' import cloud_icon %} + {{ cloud_icon(states(this.entity_id)) }} state_class: measurement unit_of_measurement: "%" state: "{{ states('sensor.pirateweather_cloud_coverage') | int }}" attributes: provider: "Pirate Weather" # not provided by local - # filter erroreous negative values - availability: "{{ states('sensor.pirateweather_cloud_coverage') | int(-1) > 0 }}" + availability: "{{ states('sensor.pirateweather_cloud_coverage') | int(-1) >= 0 }}" # filter erroreous negative values - name: "Cloud Coverage Description" unique_id: cloud_coverage_description - icon: mdi:cloud + icon: > + {% from 'weather.jinja' import cloud_icon %} + {{ cloud_icon(states('sensor.cloud_coverage')) }} state: > - {% set cloud = states('sensor.cloud_coverage') | int %} + {% set cloud = states('sensor.cloud_coverage') | int(-1) %} {% if cloud > 80 %} Cloudy {% elif cloud > 50 %} Mostly Cloudy - {% elif cloud > 10 %} Partly Cloudy + {% elif cloud > 20 %} Partly Cloudy {% else %} Clear {% endif %} attributes: @@ -1696,7 +1795,9 @@ - name: "Cloud Coverage Today" unique_id: cloud_coverage_today - icon: mdi:cloud + icon: > + {% from 'weather.jinja' import cloud_icon %} + {{ cloud_icon(states(this.entity_id)) }} state_class: measurement unit_of_measurement: "%" state: "{{ state_attr('sensor.daily_weather', 'forecast')[0].cloud_coverage | int }}" @@ -1710,7 +1811,9 @@ - name: "Cloud Coverage Tomorrow" unique_id: cloud_coverage_tomorrow - icon: mdi:cloud + icon: > + {% from 'weather.jinja' import cloud_icon %} + {{ cloud_icon(states(this.entity_id)) }} state_class: measurement unit_of_measurement: "%" state: "{{ state_attr('sensor.daily_weather', 'forecast')[1].cloud_coverage | int }}" @@ -1777,15 +1880,6 @@ provider: "OpenUV" availability: "{{ is_number(states('sensor.max_uv_index')) }}" - - name: "Ozone Level" - unique_id: ozone_level - device_class: aqi - state_class: measurement - state: "{{ states('sensor.current_ozone_level') }}" - attributes: - provider: "OpenUV" - availability: "{{ is_number(states('sensor.current_ozone_level')) }}" - ############################################################################### ## Air Quality ############################################################################### @@ -1855,63 +1949,66 @@ ############################################################################### ## Smoke Risk ############################################################################### - - name: "Atmospheric Smoke" - unique_id: atmospheric_smoke + - name: "Smoke Level" + unique_id: smoke_level icon: mdi:smoke + device_class: pm25 state_class: measurement unit_of_measurement: "µg/m³" - state: "{{ states('sensor.pirateweather_smoke') | int }}" + state: "{{ states('sensor.pirateweather_smoke') | float }}" attributes: provider: "Pirate Weather" - availability: "{{ is_number(states('sensor.pirateweather_smoke')) }}" + availability: "{{ states('sensor.pirateweather_smoke') | float(-1) >= 0 }}" # filter erroreous negative values - name: "Smoke Risk" unique_id: smoke_risk icon: mdi:smoke state: > {% from 'weather.jinja' import smoke_risk %} - {{ smoke_risk(states('sensor.atmospheric_smoke')) }} + {{ smoke_risk(states('sensor.smoke_level')) }} attributes: - provider: "Pirate Weather" - availability: "{{ is_number(states('sensor.atmospheric_smoke')) }}" + provider: "{{ state_attr('sensor.smoke_level', 'provider') }}" + availability: "{{ is_number(states('sensor.smoke_level')) }}" - name: "Smoke Level Today" unique_id: smoke_level_today icon: mdi:smoke + device_class: pm25 unit_of_measurement: "µg/m³" - state: "{{ states('sensor.pirateweather_smoke_max_0d') }}" + state: "{{ states('sensor.pirateweather_smoke_max_0d') | float }}" attributes: provider: "Pirate Weather" - availability: "{{ is_number(states('sensor.pirateweather_smoke_max_0d')) }}" + availability: "{{ states('sensor.pirateweather_smoke_max_0d') | float(-1) >= 0 }}" # filter erroreous negative values - name: "Smoke Risk Today" unique_id: smoke_risk_today icon: mdi:smoke state: > {% from 'weather.jinja' import smoke_risk %} - {{ smoke_risk(states('sensor.pirateweather_smoke_max_0d') | int ) }} + {{ smoke_risk(states('sensor.smoke_level_today') | float ) }} attributes: - provider: "Pirate Weather" - availability: "{{ is_number(states('sensor.pirateweather_smoke_max_0d')) }}" + provider: "{{ state_attr('sensor.smoke_level_today', 'provider') }}" + availability: "{{ is_number(states('sensor.smoke_level_today')) }}" - name: "Smoke Level Tomorrow" unique_id: smoke_level_tomorrow icon: mdi:smoke + device_class: pm25 unit_of_measurement: "µg/m³" - state: "{{ states('sensor.pirateweather_smoke_max_1d') }}" + state: "{{ states('sensor.pirateweather_smoke_max_1d') | float }}" attributes: provider: "Pirate Weather" - availability: "{{ is_number(states('sensor.pirateweather_smoke_max_1d')) }}" + availability: "{{ states('sensor.pirateweather_smoke_max_1d') | float(-1) >= 0 }}" # filter erroreous negative values - name: "Smoke Risk Tomorrow" unique_id: smoke_risk_tomorrow icon: mdi:smoke state: > {% from 'weather.jinja' import smoke_risk %} - {{ smoke_risk(states('sensor.pirateweather_smoke_max_1d') | int ) }} + {{ smoke_risk(states('sensor.smoke_level_tomorrow') | float ) }} attributes: - provider: "Pirate Weather" - availability: "{{ is_number(states('sensor.pirateweather_smoke_max_1d')) }}" + provider: "{{ state_attr('sensor.smoke_level_tomorrow', 'provider') }}" + availability: "{{ is_number(states('sensor.smoke_level_tomorrow')) }}" ############################################################################### ## Fire Index @@ -1923,7 +2020,7 @@ state: "{{ states('sensor.pirateweather_fire_index') | int }}" attributes: provider: "Pirate Weather" - availability: "{{ is_number(states('sensor.pirateweather_fire_index')) }}" + availability: "{{ states('sensor.pirateweather_fire_index') | int(-1) >= 0 }}" # filter erroreous negative values - name: "Fire Risk" unique_id: fire_risk @@ -1936,10 +2033,10 @@ - name: "Fire Index Today" unique_id: fire_index_today icon: mdi:fire - state: "{{ states('sensor.pirateweather_fire_index_max_0d') }}" + state: "{{ states('sensor.pirateweather_fire_index_max_0d') | int }}" attributes: provider: "Pirate Weather" - availability: "{{ is_number(states('sensor.pirateweather_fire_index_max_0d')) }}" + availability: "{{ states('sensor.pirateweather_fire_index_max_0d') | int(-1) >= 0 }}" # filter erroreous negative values - name: "Fire Risk Today" unique_id: fire_risk_today @@ -1952,15 +2049,15 @@ - name: "Fire Index Tomorrow" unique_id: fire_index_tomorrow icon: mdi:fire - state: "{{ states('sensor.pirateweather_fire_index_max_1d') }}" + state: "{{ states('sensor.pirateweather_fire_index_max_1d') | int }}" attributes: provider: "Pirate Weather" - availability: "{{ is_number(states('sensor.pirateweather_fire_index_max_1d')) }}" + availability: "{{ states('sensor.pirateweather_fire_index_max_1d') | int(-1) >= 0 }}" # filter erroreous negative values - name: "Fire Risk Tomorrow" unique_id: fire_risk_tomorrow icon: mdi:fire - state: "{{ states('sensor.pirateweather_fire_risk_level_1d') }}" + state: "{{ states('sensor.pirateweather_fire_risk_level_1d')}}" attributes: provider: "Pirate Weather" availability: "{{ has_value('sensor.pirateweather_fire_risk_level_1d') }}" diff --git a/ui/button/climate/thermostat.yaml b/ui/button/climate/thermostat.yaml index 60f8ab068..c13d13e49 100644 --- a/ui/button/climate/thermostat.yaml +++ b/ui/button/climate/thermostat.yaml @@ -19,7 +19,7 @@ label: > else var hvac_mode = states['climate.thermostat'].state; var hvac_state = states['sensor.thermostat_hvac_state'].state; - var temp = (Math.round(states['input_number.thermostat_target_temperature'].state * 10) / 10) + var temp = (Math.round(states['sensor.indoor_temperature_target'].state * 10) / 10) if ((hvac_mode == 'heat_cool' && hvac_state == 'heating') || (hvac_mode == 'heat_cool' && hvac_state == 'cooling') diff --git a/ui/button/layout/weather_sensors.yaml b/ui/button/layout/weather_sensors.yaml index df6aa612d..d95afb156 100644 --- a/ui/button/layout/weather_sensors.yaml +++ b/ui/button/layout/weather_sensors.yaml @@ -8,13 +8,13 @@ cards: - !include /config/ui/button/weather/temperature.yaml - !include /config/ui/button/weather/humidity.yaml - !include /config/ui/button/weather/wind.yaml + - !include /config/ui/button/weather/cloud_cover.yaml - !include /config/ui/button/weather/precipitation.yaml - !include /config/ui/button/weather/lightning.yaml - - !include /config/ui/button/weather/cloud_cover.yaml - !include /config/ui/button/weather/pressure.yaml - - !include /config/ui/button/weather/air_quality.yaml - !include /config/ui/button/weather/uv.yaml + - !include /config/ui/button/weather/air_quality.yaml - !include /config/ui/button/weather/allergy.yaml - !include /config/ui/button/weather/asthma.yaml - !include /config/ui/button/weather/flu.yaml diff --git a/ui/button/weather/cloud_cover.yaml b/ui/button/weather/cloud_cover.yaml index 3aef30e4c..8c8b54131 100644 --- a/ui/button/weather/cloud_cover.yaml +++ b/ui/button/weather/cloud_cover.yaml @@ -9,13 +9,43 @@ icon: > var cloud = parseInt(states['sensor.cloud_coverage'].state); if (isNaN(cloud)) return 'var(--entity-disabled-color)'; - else if (cloud > 70) - return 'mdi:cloud'; - else if (cloud > 30) + else if (cloud < 20) + return 'mdi:cloud-outline'; + else if (cloud < 50) return 'mdi:weather-partly-cloudy'; + else if (cloud < 80) + return 'mdi:clouds'; else - return 'mdi:weather-cloudy'; + return 'mdi:cloud'; ]]] +styles: + icon: + - color: > + [[[ + var cloud = parseInt(states['sensor.cloud_coverage'].state); + if (isNaN(cloud)) + return 'var(--entity-disabled-color)'; + else if (cloud < 10) + return 'var(--state-icon-color)'; + else if (cloud < 20) + return 'rgb(146, 208, 239)'; + else if (cloud < 30) + return 'rgb(144, 192, 223)'; + else if (cloud < 40) + return 'rgb(140, 179, 206)'; + else if (cloud < 50) + return 'rgb(136, 165, 189)'; + else if (cloud < 60) + return 'rgb(131, 151, 172)'; + else if (cloud < 70) + return 'rgb(125, 138, 155)'; + else if (cloud < 80) + return 'rgb(117, 125, 138)'; + else if (cloud < 90) + return 'rgb(109, 113, 121)'; + else + return 'rgb(100, 101, 104)'; + ]]] tap_action: action: navigate navigation_path: atmospheric-conditions diff --git a/ui/button/weather/humidity.yaml b/ui/button/weather/humidity.yaml index 587e64552..8ce3eaf38 100644 --- a/ui/button/weather/humidity.yaml +++ b/ui/button/weather/humidity.yaml @@ -11,25 +11,41 @@ styles: var humidity = parseInt(states['sensor.outdoor_humidity'].state); if (isNaN(humidity)) return 'var(--entity-disabled-color)'; + else if (humidity < 10) + return 'rgb(200, 254, 0)'; + else if (humidity < 20) + return 'rgb(200, 254, 0)'; + else if (humidity < 30) + return 'rgb(129, 254, 0)'; + else if (humidity < 40) + return 'rgb(58, 253, 0)'; + else if (humidity < 50) + return 'rgb(0, 253, 12)'; + else if (humidity < 60) + return 'rgb(0, 253, 82)'; + else if (humidity < 70) + return 'rgb(0, 253, 153)'; + else if (humidity < 80) + return 'rgb(0, 253, 223)'; + else if (humidity < 90) + return 'rgb(0, 210, 253)'; + else if (humidity < 100) + return 'rgb(0, 143, 219)'; else - if (humidity == 100) - return 'rgb(0, 70, 253)'; - else if (humidity > 90) - return 'rgb(0, 143, 219)'; - else if (humidity> 80) - return 'rgb(0, 210, 253)'; - else if (humidity > 70) - return 'rgb(0, 253, 223)'; - else if (humidity < 10) - return 'rgb(200, 254, 0)'; - else if (humidity < 20) - return 'rgb(200, 254, 0)'; - else if (humidity < 30) - return 'rgb(129, 254, 0)'; - else if (humidity < 40) - return 'rgb(58, 253, 0)'; - else - return 'var(--state-icon-color)'; + return 'rgb(0, 70, 253)'; + ]]] + card: + - background-color: > + [[[ + var humidity = parseInt(states['sensor.outdoor_humidity'].state); + if (isNaN(humidity)) + return 'var(--entity-button-disabled-color)'; + else if (humidity < 30) + return 'var(--entity-button-low-humdity-color)'; + else if (humidity > 60) + return 'var(--entity-button-high-humdity-color)'; + else + return 'var(--ha-card-background)'; ]]] tap_action: action: navigate diff --git a/ui/button/weather/lightning.yaml b/ui/button/weather/lightning.yaml index e50942c24..0e65a36d3 100644 --- a/ui/button/weather/lightning.yaml +++ b/ui/button/weather/lightning.yaml @@ -21,9 +21,10 @@ styles: card: - background-color: > [[[ - if (states['alert.lightning'].state == 'off' - || states['alert.blitzortung_connected'].state == 'off') - return 'var(--entity-button-alert-off-color)'; + if (states['alert.blitzortung_connected'].state != 'idle') + return 'var(--entity-button-critical-color)'; + else if (states['binary_sensor.lightning_alert'].state == 'on') + return 'var(--entity-button-alert-color)'; else return 'var(--ha-card-background)'; ]]] diff --git a/ui/button/weather/precipitation.yaml b/ui/button/weather/precipitation.yaml index 8d3bfd066..78f499cb6 100644 --- a/ui/button/weather/precipitation.yaml +++ b/ui/button/weather/precipitation.yaml @@ -6,7 +6,10 @@ template: weather_button entity: sensor.precipitation_type state_display: > [[[ - return states['sensor.precipitation_type'].state.toUpperCase(); + if (states['binary_sensor.precipitation_active'].state == 'off') + return states['sensor.precipitation_start'].attributes['12hour'] + else + return states['sensor.precipitation_type'].state.toUpperCase(); ]]] styles: icon: diff --git a/ui/button/weather/pressure.yaml b/ui/button/weather/pressure.yaml index c78e6060d..582b49caf 100644 --- a/ui/button/weather/pressure.yaml +++ b/ui/button/weather/pressure.yaml @@ -8,6 +8,46 @@ icon: > [[[ return states['sensor.pressure_trend'].attributes['icon']; ]]] +styles: + icon: + - color: > + [[[ + var pressure = parseInt(states['sensor.barometric_pressure'].state); + if (isNaN(pressure)) + return 'var(--entity-disabled-color)'; + else if (pressure < 950) + return 'rgb(8, 16, 48)'; + else if (pressure < 976) + return 'rgb(0, 32, 96)'; + else if (pressure < 986) + return 'rgb(0, 52, 146)'; + else if (pressure < 995) + return 'rgb(0, 90, 148)'; + else if (pressure < 1002) + return 'rgb(0, 117, 146)'; + else if (pressure < 1007) + return 'rgb(26, 140, 147)'; + else if (pressure < 1011) + return 'rgb(103, 162, 155)'; + else if (pressure < 1013) + return 'rgb(155, 183, 172)'; + else if (pressure < 1015) + return 'rgb(182, 182, 182)'; + else if (pressure < 1019) + return 'rgb(176, 174, 152)'; + else if (pressure < 1024) + return 'rgb(167, 147, 107)'; + else if (pressure < 1030) + return 'rgb(163, 116, 67)'; + else if (pressure < 1038) + return 'rgb(159, 81, 44)'; + else if (pressure < 1046) + return 'rgb(142, 47, 57)'; + else if (pressure < 1080) + return 'rgb(111, 24, 64)'; + else + return 'rgb(48, 8, 24)'; + ]]] tap_action: action: navigate navigation_path: atmospheric-conditions diff --git a/ui/button/weather/temperature.yaml b/ui/button/weather/temperature.yaml index ad246f7a5..e76d0de56 100644 --- a/ui/button/weather/temperature.yaml +++ b/ui/button/weather/temperature.yaml @@ -15,23 +15,46 @@ styles: var temp = parseInt(states['sensor.outdoor_temperature'].state); if (isNaN(temp)) return 'var(--entity-disabled-color)'; - else if (states['binary_sensor.outdoor_high_temperature_alert'].state == 'on') - return 'var(--entity-high-temp-color)'; - else if (states['binary_sensor.outdoor_low_temperature_alert'].state == 'on') - return 'var(--entity-low-temp-color)'; - else if (states['binary_sensor.outdoor_temperature_above_normal'].state == 'on') - return 'rgb(247, 96, 2)'; - else if (states['binary_sensor.outdoor_temperature_below_normal'].state == 'on') - return 'rgb(114, 185, 187)'; + else if (temp < -20) + return 'rgb(143, 89, 169)'; + else if (temp < -15) + return 'rgb(157, 219, 217)'; + else if (temp < -10) + return 'rgb(106, 191, 181)'; + else if (temp < -5) + return 'rgb(100, 166, 189)'; + else if (temp < -0) + return 'rgb(93, 133, 198)'; + else if (temp < 5) + return 'rgb(68, 125, 99)'; + else if (temp < 10) + return 'rgb(128, 147, 24)'; + else if (temp < 15) + return 'rgb(209, 212, 78)'; + else if (temp < 20) + return 'rgb(243, 183, 4)'; + else if (temp < 25) + return 'rgb(250, 223, 86)'; + else if (temp < 30) + return 'rgb(232, 83, 25)'; + else if (temp < 35) + return 'rgb(209, 54, 54)'; + else if (temp < 40) + return 'rgb(177, 67, 45)'; else - return 'var(--state-icon-color)'; + return 'rgb(71, 14, 0)'; ]]] card: - background-color: > [[[ - if (states['alert.outdoor_high_temperature'].state == 'off' - || states['alert.outdoor_low_temperature'].state == 'off') - return 'var(--entity-button-alert-off-color)'; + if (states['binary_sensor.outdoor_high_temperature_alert'].state == 'on') + return 'var(--entity-button-high-temp-color)'; + else if (states['binary_sensor.outdoor_low_temperature_alert'].state == 'on') + return 'var(--entity-button-low-temp-color)'; + else if (states['binary_sensor.outdoor_temperature_above_normal'].state == 'on') + return 'rgba(247, 96, 2, 0.3)'; + else if (states['binary_sensor.outdoor_temperature_below_normal'].state == 'on') + return 'rgba(114, 185, 187, 0.3)'; else return 'var(--ha-card-background)'; ]]] diff --git a/ui/button/weather/wind.yaml b/ui/button/weather/wind.yaml index 5540461e7..79657704c 100644 --- a/ui/button/weather/wind.yaml +++ b/ui/button/weather/wind.yaml @@ -10,19 +10,11 @@ state_display: > return states['sensor.wind_speed'].state + '-' + states['sensor.wind_gust'].state + ' km/h'; ]]] styles: - icon: - - color: > - [[[ - if (states['binary_sensor.wind_alert'].state == 'on') - return 'var(--entity-severe-color)'; - else - return 'var(--state-icon-color)'; - ]]] card: - background-color: > [[[ - if (states['alert.wind'].state == 'off') - return 'var(--entity-button-alert-off-color)'; + if (states['binary_sensor.wind_alert'].state == 'on') + return 'var(--entity-button-alert-color)'; else return 'var(--ha-card-background)'; ]]] diff --git a/ui/button/weather/wind_conditions.yaml b/ui/button/weather/wind_conditions.yaml deleted file mode 100644 index cdfc55092..000000000 --- a/ui/button/weather/wind_conditions.yaml +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################### -## Wind Conditions Button -############################################################################### -type: custom:button-card -entity: sensor.wind_bearing -triggers_update: - - sensor.wind_speed - - sensor.wind_gust - - sensor.wind_bearing -show_name: false -show_entity_picture: true -show_state: false -show_label: true -label: "[[[ return states['sensor.wind_beaufort_display'].state; ]]]" -styles: - grid: - - grid-template-areas: '"i" "l"' - - grid-template-rows: 1fr 40px - - grid-template-columns: 1fr - - column-gap: 0 - - row-gap: 0 - icon: - - padding: 0 - - margin: 0 - label: - - padding: 0 - - margin: 0 - - justify-self: center - - font-size: 14px - - font-weight: normal - - color: var(--primary-text-color); - card: - - background-color: var(--ha-card-background); - - height: 100% - - padding-top: 15px - - border: 1 -tap_action: - action: navigate - navigation_path: wind -double_tap_action: - action: navigate - navigation_path: wind-map diff --git a/ui/card/alarm/door_sensors.yaml b/ui/card/alarm/door_sensors.yaml index fb03fe4f4..be88f81c7 100644 --- a/ui/card/alarm/door_sensors.yaml +++ b/ui/card/alarm/door_sensors.yaml @@ -12,7 +12,7 @@ cards: {{ door_icon('binary_sensor.front_door') }} icon_color: > {% from 'door.jinja' import door_icon_color %} - {{ door_color('binary_sensor.front_door') }} + {{ door_icon_color('binary_sensor.front_door') }} badge_icon: > {% from 'door.jinja' import door_badge %} {{ door_badge('binary_sensor.front_door') }} @@ -50,7 +50,7 @@ cards: {{ door_icon('binary_sensor.side_door') }} icon_color: > {% from 'door.jinja' import door_icon_color %} - {{ door_color('binary_sensor.side_door') }} + {{ door_icon_color('binary_sensor.side_door') }} badge_icon: > {% from 'door.jinja' import door_badge %} {{ door_badge('binary_sensor.side_door') }} @@ -88,7 +88,7 @@ cards: {{ door_icon('binary_sensor.back_door') }} icon_color: > {% from 'door.jinja' import door_icon_color %} - {{ door_color('binary_sensor.back_door') }} + {{ door_icon_color('binary_sensor.back_door') }} badge_icon: > {% from 'door.jinja' import door_badge %} {{ door_badge('binary_sensor.back_door') }} @@ -126,7 +126,7 @@ cards: {{ door_icon('binary_sensor.patio_door') }} icon_color: > {% from 'door.jinja' import door_icon_color %} - {{ door_color('binary_sensor.patio_door') }} + {{ door_icon_color('binary_sensor.patio_door') }} badge_icon: > {% from 'door.jinja' import door_badge %} {{ door_badge('binary_sensor.patio_door') }} @@ -164,7 +164,7 @@ cards: {{ door_icon('binary_sensor.garage_side_door') }} icon_color: > {% from 'door.jinja' import door_icon_color %} - {{ door_color('binary_sensor.garage_side_door') }} + {{ door_icon_color('binary_sensor.garage_side_door') }} badge_icon: > {% from 'door.jinja' import door_badge %} {{ door_badge('binary_sensor.garage_side_door') }} @@ -202,7 +202,7 @@ cards: {{ door_icon('binary_sensor.garage_side_back_door') }} icon_color: > {% from 'door.jinja' import door_icon_color %} - {{ door_color('binary_sensor.garage_side_back_door') }} + {{ door_icon_color('binary_sensor.garage_side_back_door') }} badge_icon: > {% from 'door.jinja' import door_badge %} {{ door_badge('binary_sensor.garage_side_back_door') }} diff --git a/ui/card/alarm/window/bedroom_front.yaml b/ui/card/alarm/window/bedroom_front.yaml index 723d723c0..70716c047 100644 --- a/ui/card/alarm/window/bedroom_front.yaml +++ b/ui/card/alarm/window/bedroom_front.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.bedroom_front_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.bedroom_front_window') }} + {{ window_icon_color('binary_sensor.bedroom_front_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.bedroom_front_window') }} diff --git a/ui/card/alarm/window/bedroom_side.yaml b/ui/card/alarm/window/bedroom_side.yaml index d7d8627a3..346da01eb 100644 --- a/ui/card/alarm/window/bedroom_side.yaml +++ b/ui/card/alarm/window/bedroom_side.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.bedroom_side_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.bedroom_side_window') }} + {{ window_icon_color('binary_sensor.bedroom_side_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.bedroom_side_window') }} diff --git a/ui/card/alarm/window/downstairs_kitchen.yaml b/ui/card/alarm/window/downstairs_kitchen.yaml index 945f87128..aff20f52e 100644 --- a/ui/card/alarm/window/downstairs_kitchen.yaml +++ b/ui/card/alarm/window/downstairs_kitchen.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.downstairs_kitchen_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.downstairs_kitchen_window') }} + {{ window_icon_color('binary_sensor.downstairs_kitchen_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.downstairs_kitchen_window') }} diff --git a/ui/card/alarm/window/family_room.yaml b/ui/card/alarm/window/family_room.yaml index 85c9ee8c4..3d22aefb1 100644 --- a/ui/card/alarm/window/family_room.yaml +++ b/ui/card/alarm/window/family_room.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.family_room_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.family_room_window') }} + {{ window_icon_color('binary_sensor.family_room_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.family_room_window') }} diff --git a/ui/card/alarm/window/kitchen.yaml b/ui/card/alarm/window/kitchen.yaml index 41a12743c..2d8f0b5ea 100644 --- a/ui/card/alarm/window/kitchen.yaml +++ b/ui/card/alarm/window/kitchen.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.kitchen_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.kitchen_window') }} + {{ window_icon_color('binary_sensor.kitchen_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.kitchen_window') }} diff --git a/ui/card/alarm/window/kitchen_sink.yaml b/ui/card/alarm/window/kitchen_sink.yaml index 65ba8c636..89024bfa4 100644 --- a/ui/card/alarm/window/kitchen_sink.yaml +++ b/ui/card/alarm/window/kitchen_sink.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.kitchen_sink_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.kitchen_sink_window') }} + {{ window_icon_color('binary_sensor.kitchen_sink_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.kitchen_sink_window') }} diff --git a/ui/card/alarm/window/laundry_room.yaml b/ui/card/alarm/window/laundry_room.yaml index 4aff21880..e221c114a 100644 --- a/ui/card/alarm/window/laundry_room.yaml +++ b/ui/card/alarm/window/laundry_room.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.laundry_room_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.laundry_room_window') }} + {{ window_icon_color('binary_sensor.laundry_room_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.laundry_room_window') }} diff --git a/ui/card/alarm/window/living_room_1.yaml b/ui/card/alarm/window/living_room_1.yaml index cd2c96609..5e36f3f4a 100644 --- a/ui/card/alarm/window/living_room_1.yaml +++ b/ui/card/alarm/window/living_room_1.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.living_room_1_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.living_room_1_window') }} + {{ window_icon_color('binary_sensor.living_room_1_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.living_room_1_window') }} diff --git a/ui/card/alarm/window/living_room_2.yaml b/ui/card/alarm/window/living_room_2.yaml index ff5c4d9ba..d8dab9e43 100644 --- a/ui/card/alarm/window/living_room_2.yaml +++ b/ui/card/alarm/window/living_room_2.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.living_room_2_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.living_room_2_window') }} + {{ window_icon_color('binary_sensor.living_room_2_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.living_room_2_window') }} diff --git a/ui/card/alarm/window/living_room_3.yaml b/ui/card/alarm/window/living_room_3.yaml index 33ff14f42..cdce1ac53 100644 --- a/ui/card/alarm/window/living_room_3.yaml +++ b/ui/card/alarm/window/living_room_3.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.living_room_3_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.living_room_3_window') }} + {{ window_icon_color('binary_sensor.living_room_3_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.living_room_3_window') }} diff --git a/ui/card/alarm/window/living_room_4.yaml b/ui/card/alarm/window/living_room_4.yaml index 825b50032..08a912b5d 100644 --- a/ui/card/alarm/window/living_room_4.yaml +++ b/ui/card/alarm/window/living_room_4.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.living_room_4_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.living_room_4_window') }} + {{ window_icon_color('binary_sensor.living_room_4_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.living_room_4_window') }} diff --git a/ui/card/alarm/window/master_bathroom.yaml b/ui/card/alarm/window/master_bathroom.yaml index f69a761ba..5927dc46c 100644 --- a/ui/card/alarm/window/master_bathroom.yaml +++ b/ui/card/alarm/window/master_bathroom.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.master_bathroom_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.master_bathroom_window') }} + {{ window_icon_color('binary_sensor.master_bathroom_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.master_bathroom_window') }} diff --git a/ui/card/alarm/window/master_bedroom.yaml b/ui/card/alarm/window/master_bedroom.yaml index ec4a23d24..ebc729862 100644 --- a/ui/card/alarm/window/master_bedroom.yaml +++ b/ui/card/alarm/window/master_bedroom.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.master_bedroom_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.master_bedroom_window') }} + {{ window_icon_color('binary_sensor.master_bedroom_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.master_bedroom_window') }} diff --git a/ui/card/alarm/window/office.yaml b/ui/card/alarm/window/office.yaml index 235b8350f..691e51068 100644 --- a/ui/card/alarm/window/office.yaml +++ b/ui/card/alarm/window/office.yaml @@ -8,7 +8,7 @@ icon: > {{ window_icon('binary_sensor.office_window') }} icon_color: > {% from 'window.jinja' import window_icon_color %} - {{ window_color('binary_sensor.office_window') }} + {{ window_icon_color('binary_sensor.office_window') }} badge_icon: > {% from 'window.jinja' import window_badge %} {{ window_badge('binary_sensor.office_window') }} diff --git a/ui/card/climate/climate_settings.yaml b/ui/card/climate/climate_settings.yaml index 28aff40a6..cf20d9da3 100644 --- a/ui/card/climate/climate_settings.yaml +++ b/ui/card/climate/climate_settings.yaml @@ -53,10 +53,10 @@ entities: padding: 5 head: type: custom:template-entity-row - entity: input_number.thermostat_target_temperature + entity: sensor.indoor_temperature_target icon: mdi:thermometer name: "Thermostat Target" - state: "{{ states('input_number.thermostat_target_temperature', with_unit=true) }}" + state: "{{ states('sensor.indoor_temperature_targete', with_unit=true) }}" tap_action: action: more-info entities: diff --git a/ui/card/lock/entry_locks.yaml b/ui/card/lock/entry_locks.yaml index 34e7128c8..a457ef083 100644 --- a/ui/card/lock/entry_locks.yaml +++ b/ui/card/lock/entry_locks.yaml @@ -12,7 +12,7 @@ cards: {{ lock_icon('lock.front_door_lock') }} icon_color: > {% from 'lock.jinja' import lock_icon_color %} - {{ lock_color('lock.front_door_lock') }} + {{ lock_icon_color('lock.front_door_lock') }} badge_icon: > {% from 'lock.jinja' import lock_badge %} {{ lock_badge('lock.front_door_lock') }} @@ -52,7 +52,7 @@ cards: {{ lock_icon('lock.back_door_lock') }} icon_color: > {% from 'lock.jinja' import lock_icon_color %} - {{ lock_color('lock.back_door_lock') }} + {{ lock_icon_color('lock.back_door_lock') }} badge_icon: > {% from 'lock.jinja' import lock_badge %} {{ lock_badge('lock.back_door_lock') }} @@ -92,7 +92,7 @@ cards: {{ lock_icon('lock.side_door_lock') }} icon_color: > {% from 'lock.jinja' import lock_icon_color %} - {{ lock_color('lock.side_door_lock') }} + {{ lock_icon_color('lock.side_door_lock') }} badge_icon: > {% from 'lock.jinja' import lock_badge %} {{ lock_badge('lock.side_door_lock') }} @@ -132,7 +132,7 @@ cards: {{ lock_icon('lock.garage_door_lock') }} icon_color: > {% from 'lock.jinja' import lock_icon_color %} - {{ lock_color('lock.garage_door_lock') }} + {{ lock_icon_color('lock.garage_door_lock') }} badge_icon: > {% from 'lock.jinja' import lock_badge %} {{ lock_badge('lock.garage_door_lock') }} diff --git a/ui/card/weather/current_conditions.yaml b/ui/card/weather/current_conditions.yaml index f25af26f4..8c7804646 100644 --- a/ui/card/weather/current_conditions.yaml +++ b/ui/card/weather/current_conditions.yaml @@ -11,7 +11,7 @@ entities: state: "{{ states('sensor.current_condition') | title }}" card_mod: style: > - {% from 'weather.jinja' import condition_icon_color %} + {% from 'weather.jinja' import condition_color %} {{ condition_color(states('sensor.current_condition')) }} - type: custom:fold-entity-row @@ -29,26 +29,52 @@ entities: secondary: > {{- states('sensor.outdoor_temperature', with_unit=true) }} {%- if states('sensor.outdoor_temperature') | int(-1) != states('sensor.outdoor_apparent_temperature') | int(-1) %} - ({{ states('sensor.outdoor_apparent_temperature') }}) + | Feels Like: {{ states('sensor.outdoor_apparent_temperature', with_unit=true) }} {%- endif %} - {{- ' Trend: ' ~ states('sensor.outdoor_temperature_trend') }} card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(states('sensor.outdoor_temperature')) }} entities: !include /config/ui/card/weather/include/outdoor_temperature_entities.yaml + - entity: sensor.outdoor_temperature_trend + name: "Temperature Trend" + card_mod: + style: | + :host { + --paper-item-icon-color: + {% if has_value('sensor.outdoor_temperature_trend') %} + {% set trend = states('sensor.outdoor_temperature_trend') %} + {% if trend == 'Rising' %} var(--entity-heating-color) + {% elif trend == 'Falling' %} var(--entity-cooling-color) + {% else %} var(--state-icon-color) + {% endif %} + {% else %} var(--entity-disabled-color) + {% endif %} + ; + } + + - type: custom:template-entity-row + entity: sensor.dew_point + name: "Dew Point" + state: "{{ states('sensor.dew_point_comfort_level') | title }}" + secondary: "{{ states('sensor.dew_point', with_unit=true) }}" + card_mod: + style: > + {% from 'weather.jinja' import temp_color %} + {{ temp_color(states('sensor.dew_point')) }} + - type: custom:fold-entity-row padding: 10 head: type: custom:template-entity-row entity: sensor.outdoor_humidity name: "Humidity" - state: "{{ states('sensor.dew_point_comfort_level') | title }}" + state: "{{ states('sensor.outdoor_humidity_level') | title }}" secondary: "{{ states('sensor.outdoor_humidity', with_unit=true) }}" card_mod: style: > - {% from 'weather.jinja' import humidity_icon %} + {% from 'weather.jinja' import humidity_color %} {{ humidity_color(states('sensor.outdoor_humidity')) }} entities: !include /config/ui/card/weather/include/outdoor_humidity_entities.yaml @@ -56,15 +82,29 @@ entities: padding: 10 head: type: custom:template-entity-row - entity: sensor.barometric_pressure - name: "Barometric Pressure" - state: "{{ states('sensor.barometric_pressure_description') | title }}" - secondary: "{{ states('sensor.barometric_pressure', with_unit=true) ~ ': ' ~ states('sensor.pressure_trend') }}" + entity: sensor.wind_speed + name: "Wind Conditions" + state: "{{ states('sensor.wind_beaufort_display') }}" + secondary: > + {{ states('sensor.wind_direction') ~ ' (' ~ states('sensor.wind_speed') ~ '/' ~ states('sensor.wind_gust', with_unit=true) }}) card_mod: style: > - {% from 'weather.jinja' import pressure_icon %} - {{ pressure_color(states('sensor.barometric_pressure')) }} - entities: !include /config/ui/card/weather/include/barometric_pressure_entities.yaml + {% from 'weather.jinja' import wind_color %} + {{ wind_color(states('sensor.wind_gust')) }} + entities: !include /config/ui/card/weather/include/wind_entities.yaml + + - type: custom:fold-entity-row + padding: 10 + head: + type: custom:template-entity-row + entity: sensor.cloud_coverage + state: "{{ states('sensor.cloud_coverage_description') }}" + secondary: "{{ states('sensor.cloud_coverage', with_unit=true) }}" + card_mod: + style: > + {% from 'weather.jinja' import cloud_color %} + {{ cloud_color(states('sensor.cloud_coverage')) }} + entities: !include /config/ui/card/weather/include/cloud_entities.yaml - type: custom:fold-entity-row padding: 10 @@ -78,21 +118,26 @@ entities: secondary: "Probability: {{ states('sensor.precipitation_probability', with_unit = true) }}" card_mod: style: > - {% from 'weather.jinja' import pop_icon %} - {{ pop_color(states('sensor.precipitation_probability')) }} + {% if is_state('binary_sensor.precipitation_active', 'on') %} + {% from 'weather.jinja' import precipitation_color %} + {{ precipitation_color(states('sensor.precipitation_type')) }} + {% else %} + {% from 'weather.jinja' import pop_color %} + {{ pop_color(states('sensor.precipitation_probability')) }} + {% endif %} entities: !include /config/ui/card/weather/include/precipitation_entities.yaml - type: conditional conditions: - - condition: or + - condition: and conditions: - condition: numeric_state entity: sensor.nearest_storm_distance above: 0 - - condition: state - entity: sensor.nearest_storm_bearing - state_not: unknown + - condition: numeric_state + entity: sensor.nearest_storm_distance + below: 100 row: type: custom:fold-entity-row padding: 10 @@ -100,61 +145,59 @@ entities: entities: - !include /config/ui/card/weather/include/storm_radar.yaml - - type: custom:fold-entity-row - padding: 10 - head: - type: custom:template-entity-row - entity: binary_sensor.lightning - name: "Lightning" - state: "{{ iif(is_state('binary_sensor.lightning', 'on'), 'Yes', 'No') }}" - secondary: > - {%- set strikes = states('sensor.lightning_count') | int(-1) %} - {%- set distance = states('sensor.lightning_last_strike_distance') | int(-1) %} - {%- if strikes > 0 -%} - Strikes: {{ strikes }} - {%- endif %} - {%- if distance > 0 -%} - {{- ' | ' if strikes > 0 -}} Distance: {{ distance }} - {%- endif %} - active: "{{ is_state('binary_sensor.lightning', 'on') }}" #BUG not working - card_mod: #BUGFIX - style: | - :host { - --paper-item-icon-color: - {% if is_state('binary_sensor.lightning', 'on') %} var(--state-active-color) - {% else %} var(--state-icon-color) - {% endif %} - ; - } - entities: !include /config/ui/card/weather/include/lightning_entities.yaml + - type: conditional + conditions: + - condition: or + conditions: + - condition: numeric_state + entity: sensor.lightning_count + above: 0 - - type: custom:fold-entity-row - padding: 10 - head: - type: custom:template-entity-row - entity: sensor.wind_speed - name: "Wind Conditions" - state: "{{ states('sensor.wind_beaufort_display') }}" - secondary: > - {{ states('sensor.wind_direction') ~ ' (' ~ states('sensor.wind_speed') ~ '/' ~ states('sensor.wind_gust', with_unit=true) }}) - card_mod: - style: > - {% from 'weather.jinja' import wind_icon %} - {{ wind_color(states('sensor.wind_gust')) }} - entities: !include /config/ui/card/weather/include/wind_entities.yaml + - condition: state + entity: binary_sensor.lightning + state: "on" + row: + type: custom:fold-entity-row + padding: 10 + head: + type: custom:template-entity-row + entity: binary_sensor.lightning + name: "Lightning" + state: "{{ iif(is_state('binary_sensor.lightning', 'on'), 'Yes', 'No') }}" + secondary: > + {%- set strikes = states('sensor.lightning_count') | int(-1) %} + {%- set distance = states('sensor.lightning_distance') | int(-1) %} + {%- if strikes > 0 -%} + Strikes: {{ strikes }} + {%- endif %} + {%- if distance > 0 -%} + {{- ' | ' if strikes > 0 -}} Distance: {{ distance }} + {%- endif %} + active: "{{ is_state('binary_sensor.lightning', 'on') }}" #BUG not working + card_mod: #BUGFIX + style: | + :host { + --paper-item-icon-color: + {% if is_state('binary_sensor.lightning', 'on') %} var(--state-active-color) + {% else %} var(--state-icon-color) + {% endif %} + ; + } + entities: !include /config/ui/card/weather/include/lightning_entities.yaml - type: custom:fold-entity-row padding: 10 head: type: custom:template-entity-row - entity: sensor.cloud_coverage - state: "{{ states('sensor.cloud_coverage_description') }}" - secondary: "{{ states('sensor.cloud_coverage', with_unit=true) }}" + entity: sensor.barometric_pressure + name: "Barometric Pressure" + state: "{{ states('sensor.barometric_pressure_description') | title }}" + secondary: "{{ states('sensor.barometric_pressure', with_unit=true) ~ ': ' ~ states('sensor.pressure_trend') }}" card_mod: style: > - {% from 'weather.jinja' import cloud_icon %} - {{ cloud_color(states('sensor.cloud_coverage')) }} - entities: !include /config/ui/card/weather/include/cloud_entities.yaml + {% from 'weather.jinja' import pressure_color %} + {{ pressure_color(states('sensor.barometric_pressure')) }} + entities: !include /config/ui/card/weather/include/barometric_pressure_entities.yaml - type: custom:template-entity-row entity: sensor.uv_index @@ -163,7 +206,7 @@ entities: secondary: "UV Index: {{ states('sensor.uv_index') }}" card_mod: style: > - {% from 'weather.jinja' import uv_index_icon %} + {% from 'weather.jinja' import uv_index_color %} {{ uv_index_color(states('sensor.uv_index')) }} - type: custom:fold-entity-row @@ -176,7 +219,7 @@ entities: secondary: "AQI: {{ states('sensor.air_quality_index') }}" card_mod: style: > - {% from 'weather.jinja' import aqi_index_icon %} + {% from 'weather.jinja' import aqi_index_color %} {{ aqi_index_color(states('sensor.air_quality_index')) }} entities: !include /config/ui/card/weather/include/air_quality_entities.yaml @@ -187,18 +230,18 @@ entities: secondary: "Fire Index: {{ states('sensor.fire_index') }}" card_mod: style: > - {% from 'weather.jinja' import fire_index_icon %} + {% from 'weather.jinja' import fire_index_color %} {{ fire_index_color(states('sensor.fire_index')) }} - type: custom:template-entity-row - entity: sensor.atmospheric_smoke + entity: sensor.smoke_level name: "Smoke Risk" state: "{{ states('sensor.smoke_risk') }}" - secondary: "Smoke Level: {{ states('sensor.atmospheric_smoke', with_unit=true) }}" + secondary: "Smoke Level: {{ states('sensor.smoke_level', with_unit=true) }}" card_mod: style: > - {% from 'weather.jinja' import smoke_level_icon %} - {{ smoke_level_color(states('sensor.atmospheric_smoke')) }} + {% from 'weather.jinja' import smoke_level_color %} + {{ smoke_level_color(states('sensor.smoke_level')) }} - type: custom:template-entity-row entity: sensor.allergy_index_today @@ -207,7 +250,7 @@ entities: secondary: "Allergy Index: {{ states('sensor.allergy_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.allergy_index_today')) }} - type: custom:template-entity-row @@ -217,7 +260,7 @@ entities: secondary: "Asthma Index: {{ states('sensor.asthma_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.asthma_index_today')) }} - type: custom:template-entity-row @@ -227,7 +270,7 @@ entities: secondary: "Flu Index: {{ states('sensor.cold_flu_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.cold_flu_index_today')) }} - entity: sensor.pirateweather_time diff --git a/ui/card/weather/include/air_quality_entities.yaml b/ui/card/weather/include/air_quality_entities.yaml index 90a430c21..f091d15e4 100644 --- a/ui/card/weather/include/air_quality_entities.yaml +++ b/ui/card/weather/include/air_quality_entities.yaml @@ -8,45 +8,45 @@ secondary: "Index: {{ states('sensor.air_quality_index') }}" card_mod: style: > - {% from 'weather.jinja' import aqi_index_icon %} + {% from 'weather.jinja' import aqi_index_color %} {{ aqi_index_color(states('sensor.air_quality_index')) }} - entity: sensor.ozone_index card_mod: style: > - {% from 'weather.jinja' import aqi_index_icon %} + {% from 'weather.jinja' import aqi_index_color %} {{ aqi_index_color(states('sensor.ozone_index')) }} - entity: sensor.carbon_monoxide card_mod: style: > - {% from 'weather.jinja' import aqi_index_icon %} + {% from 'weather.jinja' import aqi_index_color %} {{ aqi_index_color(states('sensor.carbon_monoxide')) }} - entity: sensor.nitrogen_dioxide card_mod: style: > - {% from 'weather.jinja' import aqi_index_icon %} + {% from 'weather.jinja' import aqi_index_color %} {{ aqi_index_color(states('sensor.nitrogen_dioxide')) }} - entity: sensor.sulphur_dioxide card_mod: style: > - {% from 'weather.jinja' import aqi_index_icon %} + {% from 'weather.jinja' import aqi_index_color %} {{ aqi_index_color(states('sensor.sulphur_dioxide')) }} - entity: sensor.particulate_matter_2_5 card_mod: style: > - {% from 'weather.jinja' import aqi_index_icon %} + {% from 'weather.jinja' import aqi_index_color %} {{ aqi_index_color(states('sensor.particulate_matter_2_5')) }} -- entity: sensor.atmospheric_smoke +- entity: sensor.smoke_level name: "Smoke" card_mod: style: > - {% from 'weather.jinja' import smoke_level_icon %} - {{ smoke_level_color(states('sensor.atmospheric_smoke')) }} + {% from 'weather.jinja' import smoke_level_color %} + {{ smoke_level_color(states('sensor.smoke_level')) }} - type: conditional conditions: diff --git a/ui/card/weather/include/allergy_entities.yaml b/ui/card/weather/include/allergy_entities.yaml index c4e7778e7..b8fea6464 100644 --- a/ui/card/weather/include/allergy_entities.yaml +++ b/ui/card/weather/include/allergy_entities.yaml @@ -8,7 +8,7 @@ secondary: "Index: {{ states('sensor.allergy_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.allergy_index_today')) }} - type: custom:template-entity-row @@ -18,14 +18,14 @@ secondary: "Index: {{ states('sensor.allergy_index_tomorrow') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.allergy_index_tomorrow')) }} - entity: sensor.allergy_index_forecasted_average name: "Forcasted Average" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.allergy_index_forecasted_average')) }} - type: conditional diff --git a/ui/card/weather/include/asthma_entities.yaml b/ui/card/weather/include/asthma_entities.yaml index 7ea065c3f..ec28fea04 100644 --- a/ui/card/weather/include/asthma_entities.yaml +++ b/ui/card/weather/include/asthma_entities.yaml @@ -8,7 +8,7 @@ secondary: "Index: {{ states('sensor.asthma_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.asthma_index_today')) }} - type: custom:template-entity-row @@ -18,14 +18,14 @@ secondary: "Index: {{ states('sensor.asthma_index_tomorrow') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.asthma_index_tomorrow')) }} - entity: sensor.asthma_index_forecasted_average name: "Forcasted Average" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.asthma_index_forecasted_average')) }} - type: conditional diff --git a/ui/card/weather/include/barometric_pressure_entities.yaml b/ui/card/weather/include/barometric_pressure_entities.yaml index c25997c22..6960b8a03 100644 --- a/ui/card/weather/include/barometric_pressure_entities.yaml +++ b/ui/card/weather/include/barometric_pressure_entities.yaml @@ -11,7 +11,7 @@ {%- endif %} card_mod: style: > - {% from 'weather.jinja' import pressure_icon %} + {% from 'weather.jinja' import pressure_color %} {{ pressure_color(states('sensor.barometric_pressure')) }} - type: button diff --git a/ui/card/weather/include/cloud_entities.yaml b/ui/card/weather/include/cloud_entities.yaml index a1632605b..ba0f0f6ef 100644 --- a/ui/card/weather/include/cloud_entities.yaml +++ b/ui/card/weather/include/cloud_entities.yaml @@ -4,7 +4,7 @@ - entity: sensor.cloud_coverage card_mod: style: > - {% from 'weather.jinja' import cloud_icon %} + {% from 'weather.jinja' import cloud_color %} {{ cloud_color(states('sensor.cloud_coverage')) }} - entity: sensor.fog_probability diff --git a/ui/card/weather/include/flu_entities.yaml b/ui/card/weather/include/flu_entities.yaml index 0bd0f3a67..e9860f36b 100644 --- a/ui/card/weather/include/flu_entities.yaml +++ b/ui/card/weather/include/flu_entities.yaml @@ -8,14 +8,14 @@ secondary: "Index: {{ states('sensor.cold_flu_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.cold_flu_index_today')) }} - entity: sensor.cold_flu_forecasted_average name: "Forcasted Average" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.cold_flu_forecasted_average')) }} - type: conditional diff --git a/ui/card/weather/include/lightning_entities.yaml b/ui/card/weather/include/lightning_entities.yaml index 934486ec5..e140bc141 100644 --- a/ui/card/weather/include/lightning_entities.yaml +++ b/ui/card/weather/include/lightning_entities.yaml @@ -4,7 +4,7 @@ - entity: sensor.lightning_count name: "Lightning Strikes" -- entity: sensor.lightning_last_strike_distance +- entity: sensor.lightning_distance name: "Last Strike Distance" - entity: sensor.lightning_last_strike diff --git a/ui/card/weather/include/nearest_storm_entity.yaml b/ui/card/weather/include/nearest_storm_entity.yaml index d0042fb3e..cb4f8f33e 100644 --- a/ui/card/weather/include/nearest_storm_entity.yaml +++ b/ui/card/weather/include/nearest_storm_entity.yaml @@ -9,4 +9,16 @@ state: "{{ states('sensor.nearest_storm_distance', with_unit=true) }}" secondary: > {% if has_value('sensor.nearest_storm_full_direction') %} Direction: {{ states('sensor.nearest_storm_full_direction') }} - {% endif %} \ No newline at end of file + {% endif %} +card_mod: + style: | + :host { + --paper-item-icon-color: + {% if is_number(states('sensor.nearest_storm_distance')) %} + {% if states('sensor.nearest_storm_distance') | int < 25 %} var(--state-active-color) + {% else %} var(--state-icon-color) + {% endif %} + {% else %} var(--entity-disabled-color) + {% endif %} + ; + } \ No newline at end of file diff --git a/ui/card/weather/include/outdoor_humidity_entities.yaml b/ui/card/weather/include/outdoor_humidity_entities.yaml index a02e4db98..d640697b2 100644 --- a/ui/card/weather/include/outdoor_humidity_entities.yaml +++ b/ui/card/weather/include/outdoor_humidity_entities.yaml @@ -5,7 +5,7 @@ name: "Humidity" card_mod: style: > - {% from 'weather.jinja' import humidity_icon %} + {% from 'weather.jinja' import humidity_color %} {{ humidity_color(states('sensor.outdoor_humidity')) }} - type: button diff --git a/ui/card/weather/include/outdoor_temperature_entities.yaml b/ui/card/weather/include/outdoor_temperature_entities.yaml index f2855645a..50221a44c 100644 --- a/ui/card/weather/include/outdoor_temperature_entities.yaml +++ b/ui/card/weather/include/outdoor_temperature_entities.yaml @@ -1,52 +1,69 @@ ############################################################################### ## Outdoor Temperature Entities ############################################################################### +- type: conditional + conditions: + - condition: state + entity: alert.outdoor_high_temperature + state_not: idle + row: + entity: alert.outdoor_high_temperature + name: "High Temperature Alert" + +- type: conditional + conditions: + - condition: state + entity: alert.outdoor_low_temperature + state_not: idle + row: + entity: alert.outdoor_low_temperature + name: "Low Temperature Alert" + - type: custom:template-entity-row entity: sensor.outdoor_temperature name: "Temperature" icon: mdi:thermometer state: "{{ states('sensor.outdoor_temperature', with_unit=true) }}" - secondary: "{{ states('sensor.outdoor_temperature_trend') | title }}" - card_mod: - style: > - {% from 'weather.jinja' import temp_icon %} - {{ temp_color(states('sensor.outdoor_temperature')) }} - -- entity: sensor.outdoor_temperature_level - name: "Relative Temperature" + secondary: "{{ states('sensor.outdoor_temperature_level') }}" card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(states('sensor.outdoor_temperature')) }} - entity: sensor.outdoor_apparent_temperature name: "Feels Like" card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(states('sensor.outdoor_apparent_temperature')) }} -- entity: sensor.dew_point - name: "Dew Point" +- entity: sensor.outdoor_temperature_trend + name: "Temperature Trend" card_mod: - style: > - {% from 'weather.jinja' import temp_icon %} - {{ temp_color(states('sensor.dew_point')) }} + style: | + :host { + --paper-item-icon-color: + {% if has_value('sensor.outdoor_temperature_trend') %} + {% set trend = states('sensor.outdoor_temperature_trend') %} + {% if trend == 'Rising' %} var(--entity-heating-color) + {% elif trend == 'Falling' %} var(--entity-cooling-color) + {% else %} var(--state-icon-color) + {% endif %} + {% else %} var(--entity-disabled-color) + {% endif %} + ; + } -- entity: sensor.dew_point_comfort_level - name: "Dew Point Comfort" +- type: custom:template-entity-row + entity: sensor.dew_point + name: "Dew Point" + state: "{{ states('sensor.dew_point', with_unit=true) }}" + secondary: "Comfort Level: {{ states('sensor.dew_point_comfort_level') }}" card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(states('sensor.dew_point')) }} -- entity: sensor.outdoor_temperature_daily_average - name: "Daily Average" - card_mod: - style: > - {% from 'weather.jinja' import temp_icon %} - {{ temp_color(states('sensor.outdoor_temperature_daily_average')) }} - - type: custom:template-entity-row entity: sensor.outdoor_temperature_daily_high name: "High Temp (Last 24)" @@ -60,7 +77,7 @@ {%- endif %} card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(states('sensor.outdoor_temperature_daily_high')) }} - type: custom:template-entity-row @@ -76,9 +93,16 @@ {%- endif %} card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(states('sensor.outdoor_temperature_daily_low')) }} +- entity: sensor.outdoor_temperature_daily_average + name: "Average (Last 24)" + card_mod: + style: > + {% from 'weather.jinja' import temp_color %} + {{ temp_color(states('sensor.outdoor_temperature_daily_average')) }} + - type: custom:template-entity-row entity: sensor.tempest_st_00057689_temperature name: "High Temp (All Time)" @@ -89,48 +113,22 @@ | timestamp_custom('%Y-%m-%d at %-I:%M %p', true, 'unknown') }} card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(state_attr('sensor.tempest_st_00057689_temperature', 'max_all')) }} - type: custom:template-entity-row entity: sensor.tempest_st_00057689_temperature name: "Low Temp (All Time)" - icon: mdi:sun-thermometer + icon: mdi:snowflake-thermometer state: "{{ state_attr('sensor.tempest_st_00057689_temperature', 'min_all') }} °C" secondary: > {{ state_attr('sensor.tempest_st_00057689_temperature', 'min_all_time') | as_timestamp('unknown') | timestamp_custom('%Y-%m-%d at %-I:%M %p', true, 'unknown') }} card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(state_attr('sensor.tempest_st_00057689_temperature', 'min_all')) }} -- type: conditional - conditions: - - condition: state - entity: binary_sensor.freezing - state: "on" - row: - entity: binary_sensor.freezing - -- type: conditional - conditions: - - condition: state - entity: alert.outdoor_high_temperature - state_not: idle - row: - entity: alert.outdoor_high_temperature - name: "High Temperature Alert" - -- type: conditional - conditions: - - condition: state - entity: alert.outdoor_low_temperature - state_not: idle - row: - entity: alert.outdoor_low_temperature - name: "Low Temperature Alert" - - type: button entity: sensor.outdoor_temperature name: "Temperature Map" diff --git a/ui/card/weather/include/precipitation_entities.yaml b/ui/card/weather/include/precipitation_entities.yaml index 04ad991d0..bbac9e1dd 100644 --- a/ui/card/weather/include/precipitation_entities.yaml +++ b/ui/card/weather/include/precipitation_entities.yaml @@ -24,8 +24,22 @@ secondary: > {%- set exp = states('sensor.precipitation_expected_today') %} {%- if is_number(exp) and exp | float(-1) > 0 -%} - Expected: {{ '%0.1f' | format(exp) | float(-1) }} mm + Accumulation: {{ '%0.1f' | format(exp) | float(-1) }} mm {%- endif %} + card_mod: + style: > + {% from 'weather.jinja' import precipitation_color %} + {{ precipitation_color(states('sensor.precipitation_type')) }} + +- type: custom:template-entity-row + entity: sensor.precipitation_probability + name: "Probability" + state: "{{ states('sensor.precipitation_probability', with_unit=true) }}" + secondary: "Next 24h: {{ states('sensor.precipitation_probability_next_24_hours', with_unit=true) }}" + card_mod: + style: > + {% from 'weather.jinja' import pop_color %} + {{ pop_color(states('sensor.precipitation_probability')) }} - type: conditional conditions: @@ -36,17 +50,17 @@ type: custom:template-entity-row entity: binary_sensor.precipitation_likely_soon name: > - {% set type = state_attr('sensor.precipitation_start', 'type') %} - {{ iif(type in ['rain', 'snow', 'ice'], type | title, 'Precipitation') }} Likely Soon + {% set type = states('sensor.precipitation_type_expected') %} + {{ iif(type in ['rain', 'snow'], type | title, 'Precipitation') }} Likely Soon icon: mdi:weather-snowy-rainy - state: > - {%- if has_value('sensor.precipitation_start') %} - {{ state_attr('sensor.precipitation_start', '12hour') }} - {%- endif %} + state: "{{ state_attr('sensor.precipitation_start', '12hour') }}" secondary: > - {%- if is_number(states('sensor.precipitation_expected_today')) %} - Expected: {{ '%0.1f' | format(states('sensor.precipitation_expected_today') | float(-1)) }} mm - {%- endif %} + {% set tomorrow = now().day < as_datetime(states('sensor.precipitation_start')).day | default(false) %} + {% if is_number(iif(tomorrow, states('sensor.precipitation_expected_tomorrow'), + states('sensor.precipitation_expected_today'))) %} + Accumulation: {{ '%0.1f' | format(iif(tomorrow, states('sensor.precipitation_expected_tomorrow'), + states('sensor.precipitation_expected_today')) | float(-1)) }} mm + {% endif %} active: "{{ is_state('binary_sensor.precipitation_likely_soon', 'on') }}" #BUG not working card_mod: #BUGFIX #BUG not working in conditional row style: | @@ -67,18 +81,16 @@ type: custom:template-entity-row entity: binary_sensor.precipitation_likely_next_24_hours name: > - {% set type = state_attr('sensor.precipitation_start', 'type') %} - {{ iif(type in ['rain', 'snow', 'ice'], type | title, 'Precipitation') }} Likely Next 24 Hours + {% set type = states('sensor.precipitation_type_expected') %} + {{ iif(type in ['rain', 'snow'], type | title, 'Precipitation') }} Likely Next 24 Hours icon: mdi:weather-snowy-rainy - state: > - {% if has_value('sensor.precipitation_start') %} - {{ state_attr('sensor.precipitation_start', '12hour') }} - {% elif states('sensor.precipitation_probability_today') | int(-1) > 30 %} - {{ states('sensor.precipitation_probability_today', with_unit=true) }} - {% endif %} + state: "{{ state_attr('sensor.precipitation_start', '12hour') }}" secondary: > - {% if is_number(states('sensor.precipitation_expected_today')) %} - Expected: {{ '%0.1f' | format(states('sensor.precipitation_expected_today') | float(-1)) }} mm + {% set tomorrow = now().day < as_datetime(states('sensor.precipitation_start')).day | default(false) %} + {% if is_number(iif(tomorrow, states('sensor.precipitation_expected_tomorrow'), + states('sensor.precipitation_expected_today'))) %} + Accumulation: {{ '%0.1f' | format(iif(tomorrow, states('sensor.precipitation_expected_tomorrow'), + states('sensor.precipitation_expected_today')) | float(-1)) }} mm {% endif %} active: "{{ is_state('binary_sensor.precipitation_likely_next_24_hours', 'on') }}" #BUG not working card_mod: #BUGFIX #BUG not working in conditional row @@ -109,28 +121,9 @@ {%- endif %} active: "{{ is_state('binary_sensor.precipitation_active', 'on') }}" #BUG not working card_mod: #BUGFIX #BUG not working in conditional row - style: | - :host { - --paper-item-icon-color: - {% if is_state('binary_sensor.precipitation_active', 'on') %} var(--state-active-color) - {% else %} var(--state-icon-color) - {% endif %} - ; - } - -- type: conditional - conditions: - - condition: state - entity: sensor.precipitation_start - state_not: unknown - row: - entity: sensor.precipitation_start - -- type: custom:template-entity-row - entity: sensor.precipitation_probability - name: "Probability" - state: "{{ states('sensor.precipitation_probability', with_unit=true) }}" - secondary: "Next 24h: {{ states('sensor.precipitation_probability_next_24_hours', with_unit=true) }}" + style: > + {% from 'weather.jinja' import precipitation_color %} + {{ precipitation_color(states('sensor.precipitation_type')) }} - type: conditional conditions: @@ -291,8 +284,8 @@ entity: sensor.precipitation_accumulation_yesterday above: 0 row: - - entity: sensor.precipitation_accumulation_yesterday - name: "Precipitation Yesterday" + entity: sensor.precipitation_accumulation_yesterday + name: "Precipitation Yesterday" - type: conditional conditions: @@ -333,22 +326,6 @@ action: navigate navigation_path: rain-radar -- type: button - name: "Cloud Radar" - icon: mdi:weather-cloudy - action_name: "VIEW" - tap_action: - action: navigate - navigation_path: cloud-radar - -- type: button - name: "Satellite" - icon: mdi:satellite - action_name: "VIEW" - tap_action: - action: navigate - navigation_path: ventusky-satellite - - type: button name: "Rain Viewer" icon: mdi:weather-rainy diff --git a/ui/card/weather/include/uv_entities.yaml b/ui/card/weather/include/uv_entities.yaml index f9e53f032..23a7f7e3d 100644 --- a/ui/card/weather/include/uv_entities.yaml +++ b/ui/card/weather/include/uv_entities.yaml @@ -8,7 +8,7 @@ secondary: "Index: {{ states('sensor.uv_index') }}" card_mod: style: > - {% from 'weather.jinja' import uv_index_icon %} + {% from 'weather.jinja' import uv_index_color %} {{ uv_index_color(states('sensor.uv_index')) }} - type: custom:template-entity-row @@ -18,7 +18,7 @@ secondary: "Index: {{ states('sensor.uv_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import uv_index_icon %} + {% from 'weather.jinja' import uv_index_color %} {{ uv_index_color(states('sensor.uv_index_today')) }} - type: conditional diff --git a/ui/card/weather/include/weather_condition_colors.yaml b/ui/card/weather/include/weather_condition_colors.yaml index e9c554901..6bc38ed99 100644 --- a/ui/card/weather/include/weather_condition_colors.yaml +++ b/ui/card/weather/include/weather_condition_colors.yaml @@ -5,7 +5,7 @@ clear-night: background: rgb(47, 19, 92) foreground: rgb(174, 186, 207) cloudy: - background: rgb(79, 80, 82) + background: rgb(100, 100, 100) foreground: rgb(173, 176, 184) fog: background: rgb(113, 99, 128) @@ -24,41 +24,25 @@ partlycloudy: foreground: rgb(232, 235, 87) rainy: background: rgb(2, 33, 94) - foreground: rgb(97, 197, 250) + foreground: rgb(33, 145, 237) pouring: - background: rgb(4, 61, 176) + background: rgb(12, 36, 150) foreground: rgb(97, 197, 250) snowy: - background: rgb(255, 255, 255) - foreground: rgb(18, 161, 158) + background: rgb(51, 66, 71) + foreground: rgb(27, 147, 227) snowy-rainy: - background: rgb(255, 255, 255) - foreground: rgb(4, 61, 176) + background: rgb(51, 66, 71) + foreground: rgb(12, 36, 150) sunny: background: rgb(140, 200, 255) foreground: rgb(232, 235, 87) windy: - background: rgb(61, 135, 58) + background: rgb(103, 130, 127) foreground: rgb(232, 235, 87) windy-variant: - background: rgb(117, 145, 116) + background: rgb(103, 130, 127) foreground: rgb(176, 176, 176) exceptional: background: rgb(117, 145, 116) foreground: rgb(255, 255, 255) - -# {%- if condition == 'sunny' %} rgb(232, 235, 87) -# {%- elif condition == 'clear-night' %} rgb(47, 19, 92) -# {%- elif condition == 'fog' %} -# {%- elif condition == 'partlycloudy' %} rgb(90, 116, 158) -# {%- elif condition == 'cloudy' %} -# {%- elif condition == 'rainy' %} rgb(4, 61, 176) -# {%- elif condition == 'pouring' %} rgb(2, 33, 94) -# {%- elif condition == 'snowy' %} rgb(255, 255, 255) -# {%- elif condition == 'hail' %} -# {%- elif condition == 'lighting' %} -# {%- elif condition == 'lightning-rainy' %} -# {%- elif condition == 'snowy-rainy' %} rgb(82, 193, 196) -# {%- elif condition == 'windy' %} rgb(61, 135, 58) -# {%- elif condition == 'windy-variant' %} rgb(117, 145, 116) -# {%- elif condition == 'exceptional' %} rgb(158, 27, 51) \ No newline at end of file diff --git a/ui/card/weather/include/wind_entities.yaml b/ui/card/weather/include/wind_entities.yaml index d8a03c765..770802acf 100644 --- a/ui/card/weather/include/wind_entities.yaml +++ b/ui/card/weather/include/wind_entities.yaml @@ -5,21 +5,21 @@ name: "Speed" card_mod: style: > - {% from 'weather.jinja' import wind_icon %} + {% from 'weather.jinja' import wind_color %} {{ wind_color(states('sensor.wind_speed')) }} - entity: sensor.wind_gust name: "Gust" card_mod: style: > - {% from 'weather.jinja' import wind_icon %} + {% from 'weather.jinja' import wind_color %} {{ wind_color(states('sensor.wind_gust')) }} - entity: sensor.wind_lull name: "Lull" card_mod: style: > - {% from 'weather.jinja' import wind_icon %} + {% from 'weather.jinja' import wind_color %} {{ wind_color(states('sensor.wind_lull')) }} - entity: sensor.wind_beaufort_display diff --git a/ui/card/weather/today_forecast.yaml b/ui/card/weather/today_forecast.yaml index 4e3d077f0..9c2cc9400 100644 --- a/ui/card/weather/today_forecast.yaml +++ b/ui/card/weather/today_forecast.yaml @@ -11,7 +11,7 @@ entities: state: "{{ states('sensor.condition_today') | title }}" card_mod: style: > - {% from 'weather.jinja' import condition_icon_color %} + {% from 'weather.jinja' import condition_color %} {{ condition_color(states('sensor.condition_today')) }} - type: custom:template-entity-row @@ -25,7 +25,7 @@ entities: {%- endif %} {{ state_attr('sensor.outdoor_high_temperature_time', '12hour') }} card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(states('sensor.outdoor_high_temperature')) }} - type: custom:template-entity-row @@ -39,16 +39,41 @@ entities: {%- endif %} {{ state_attr('sensor.outdoor_low_temperature_time', '12hour') }} card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(states('sensor.outdoor_low_temperature')) }} + - entity: sensor.dew_point_today + name: "Dew Point" + card_mod: + style: > + {% from 'weather.jinja' import temp_color %} + {{ temp_color(states('sensor.dew_point_today')) }} + - entity: sensor.outdoor_humidity_today name: "Humidity" card_mod: style: > - {% from 'weather.jinja' import humidity_icon %} + {% from 'weather.jinja' import humidity_color %} {{ humidity_color(states('sensor.outdoor_humidity_today')) }} + - type: custom:template-entity-row + entity: sensor.wind_speed_today + name: "Wind Speed" + icon: mdi:weather-windy + state: "{{ states('sensor.wind_speed_today', with_unit=true) }}" + secondary: "Gusts: {{ states('sensor.wind_gust_today', with_unit=true) }}" + card_mod: + style: > + {% from 'weather.jinja' import wind_color %} + {{ wind_color(states('sensor.wind_gust_today')) }} + + - entity: sensor.cloud_coverage_today + name: "Cloud Coverage" + card_mod: + style: > + {% from 'weather.jinja' import cloud_color %} + {{ cloud_color(states('sensor.cloud_coverage_today')) }} + - type: custom:fold-entity-row head: type: custom:template-entity-row @@ -62,7 +87,7 @@ entities: {%- endif %} card_mod: style: > - {% from 'weather.jinja' import pop_icon %} + {% from 'weather.jinja' import pop_color %} {{ pop_color(states('sensor.precipitation_probability_today')) }} entities: - entity: sensor.max_precipitation_intensity_today @@ -101,24 +126,6 @@ entities: ; } - - type: custom:template-entity-row - entity: sensor.wind_speed_today - name: "Wind Speed" - icon: mdi:weather-windy - state: "{{ states('sensor.wind_speed_today', with_unit=true) }}" - secondary: "Gusts: {{ states('sensor.wind_gust_today', with_unit=true) }}" - card_mod: - style: > - {% from 'weather.jinja' import wind_icon %} - {{ wind_color(states('sensor.wind_gust_today')) }} - - - entity: sensor.cloud_coverage_today - name: "Cloud Coverage" - card_mod: - style: > - {% from 'weather.jinja' import cloud_icon %} - {{ cloud_color(states('sensor.cloud_coverage_today')) }} - - type: custom:template-entity-row entity: sensor.uv_risk_today name: "UV Risk" @@ -126,7 +133,7 @@ entities: secondary: "UV Index: {{ states('sensor.uv_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import uv_index_icon %} + {% from 'weather.jinja' import uv_index_color %} {{ uv_index_color(states('sensor.uv_index_today')) }} - type: custom:template-entity-row @@ -136,7 +143,7 @@ entities: secondary: "Fire Index: {{ states('sensor.fire_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import fire_index_icon %} + {% from 'weather.jinja' import fire_index_color %} {{ fire_index_color(states('sensor.fire_index_today')) }} - type: custom:template-entity-row @@ -146,7 +153,7 @@ entities: secondary: "Smoke Level: {{ states('sensor.smoke_level_today', with_unit=true) }}" card_mod: style: > - {% from 'weather.jinja' import smoke_level_icon %} + {% from 'weather.jinja' import smoke_level_color %} {{ smoke_level_color(states('sensor.smoke_level_today')) }} - type: custom:template-entity-row @@ -156,7 +163,7 @@ entities: secondary: "Allergy Index: {{ states('sensor.allergy_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.allergy_index_today')) }} - type: custom:template-entity-row @@ -166,7 +173,7 @@ entities: secondary: "Asthma Index: {{ states('sensor.asthma_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.asthma_index_today')) }} - type: custom:template-entity-row @@ -176,7 +183,7 @@ entities: secondary: "Flu Index: {{ states('sensor.cold_flu_index_today') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.cold_flu_index_today')) }} - type: attribute diff --git a/ui/card/weather/tomorrow_forecast.yaml b/ui/card/weather/tomorrow_forecast.yaml index 57a0a73e0..f3222dfb1 100644 --- a/ui/card/weather/tomorrow_forecast.yaml +++ b/ui/card/weather/tomorrow_forecast.yaml @@ -11,7 +11,7 @@ entities: state: "{{ states('sensor.condition_tomorrow') | title }}" card_mod: style: > - {% from 'weather.jinja' import condition_icon_color %} + {% from 'weather.jinja' import condition_color %} {{ condition_color(states('sensor.condition_tomorrow')) }} - type: custom:template-entity-row @@ -25,7 +25,7 @@ entities: {%- endif %} {{ state_attr('sensor.outdoor_high_temperature_time_tomorrow', '12hour') }} card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(states('sensor.outdoor_high_temperature_tomorrow')) }} - type: custom:template-entity-row @@ -39,16 +39,41 @@ entities: {%- endif %} {{ state_attr('sensor.outdoor_low_temperature_time_tomorrow', '12hour') }} card_mod: style: > - {% from 'weather.jinja' import temp_icon %} + {% from 'weather.jinja' import temp_color %} {{ temp_color(states('sensor.outdoor_low_temperature_tomorrow')) }} + - entity: sensor.dew_point_tomorrow + name: "Dew Point" + card_mod: + style: > + {% from 'weather.jinja' import temp_color %} + {{ temp_color(states('sensor.dew_point_tomorrow')) }} + - entity: sensor.outdoor_humidity_tomorrow name: "Humidity" card_mod: style: > - {% from 'weather.jinja' import humidity_icon %} + {% from 'weather.jinja' import humidity_color %} {{ humidity_color(states('sensor.outdoor_humidity_tomorrow')) }} + - type: custom:template-entity-row + entity: sensor.wind_speed_tomorrow + name: "Wind Speed" + icon: mdi:weather-windy + state: "{{ states('sensor.wind_speed_tomorrow', with_unit=true) }}" + secondary: "Gusts: {{ states('sensor.wind_gust_tomorrow', with_unit=true) }}" + card_mod: + style: > + {% from 'weather.jinja' import wind_color %} + {{ wind_color(states('sensor.wind_gust_tomorrow')) }} + + - entity: sensor.cloud_coverage_tomorrow + name: "Cloud Coverage" + card_mod: + style: > + {% from 'weather.jinja' import cloud_color %} + {{ cloud_color(states('sensor.cloud_coverage_tomorrow')) }} + - type: custom:fold-entity-row head: type: custom:template-entity-row @@ -62,7 +87,7 @@ entities: {%- endif %} card_mod: style: > - {% from 'weather.jinja' import pop_icon %} + {% from 'weather.jinja' import pop_color %} {{ pop_color(states('sensor.precipitation_probability_tomorrow')) }} entities: - entity: sensor.max_precipitation_intensity_tomorrow @@ -101,24 +126,6 @@ entities: ; } - - type: custom:template-entity-row - entity: sensor.wind_speed_tomorrow - name: "Wind Speed" - icon: mdi:weather-windy - state: "{{ states('sensor.wind_speed_tomorrow', with_unit=true) }}" - secondary: "Gusts: {{ states('sensor.wind_gust_tomorrow', with_unit=true) }}" - card_mod: - style: > - {% from 'weather.jinja' import wind_icon %} - {{ wind_color(states('sensor.wind_gust_tomorrow')) }} - - - entity: sensor.cloud_coverage_tomorrow - name: "Cloud Coverage" - card_mod: - style: > - {% from 'weather.jinja' import cloud_icon %} - {{ cloud_color(states('sensor.cloud_coverage_tomorrow')) }} - - type: custom:template-entity-row entity: sensor.fire_index_tomorrow name: "Fire Risk" @@ -126,7 +133,7 @@ entities: secondary: "Fire Index: {{ states('sensor.fire_index_tomorrow') }}" card_mod: style: > - {% from 'weather.jinja' import fire_index_icon %} + {% from 'weather.jinja' import fire_index_color %} {{ fire_index_color(states('sensor.fire_index_tomorrow')) }} - type: custom:template-entity-row @@ -136,7 +143,7 @@ entities: secondary: "Smoke Level: {{ states('sensor.smoke_level_tomorrow', with_unit=true) }}" card_mod: style: > - {% from 'weather.jinja' import smoke_level_icon %} + {% from 'weather.jinja' import smoke_level_color %} {{ smoke_level_color(states('sensor.smoke_level_tomorrow')) }} - type: custom:template-entity-row @@ -146,7 +153,7 @@ entities: secondary: "Allergy Index: {{ states('sensor.allergy_index_tomorrow') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.allergy_index_tomorrow')) }} - type: custom:template-entity-row @@ -156,7 +163,7 @@ entities: secondary: "Asthma Index: {{ states('sensor.asthma_index_tomorrow') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.asthma_index_tomorrow')) }} - type: custom:template-entity-row @@ -166,7 +173,7 @@ entities: secondary: "Flu Index: {{ states('sensor.cold_flu_forecasted_average') }}" card_mod: style: > - {% from 'weather.jinja' import iqvia_index_icon %} + {% from 'weather.jinja' import iqvia_index_color %} {{ iqvia_index_color(states('sensor.cold_flu_forecasted_average')) }} - type: attribute diff --git a/ui/card/weather/weather_forecast.yaml b/ui/card/weather/weather_forecast.yaml index 544e272f5..fdd132382 100644 --- a/ui/card/weather/weather_forecast.yaml +++ b/ui/card/weather/weather_forecast.yaml @@ -20,7 +20,7 @@ cards: card: !include /config/ui/button/weather/envcan_alert.yaml - type: custom:hourly-weather - entity: sensor.hourly_weather + entity: sensor.hourly_envcan # most accurate conditions next 12 hr forecast_type: hourly num_segments: 12 name: "" @@ -30,8 +30,8 @@ cards: hide_hours: false hide_temperatures: false show_wind: false - show_precipitation_amounts: true - show_precipitation_probability: false + show_precipitation_amounts: false + show_precipitation_probability: true colors: !include /config/ui/card/weather/include/weather_condition_colors.yaml card_mod: class: sub_card diff --git a/ui/card/weather/weather_forecast_mini.yaml b/ui/card/weather/weather_forecast_mini.yaml index 1d32138fa..0cd4ce7e3 100644 --- a/ui/card/weather/weather_forecast_mini.yaml +++ b/ui/card/weather/weather_forecast_mini.yaml @@ -20,7 +20,7 @@ cards: card: !include /config/ui/button/weather/envcan_alert.yaml - type: custom:hourly-weather - entity: sensor.hourly_weather + entity: sensor.hourly_envcan # most accurate conditions next 12 hr forecast_type: hourly num_segments: 12 name: "" diff --git a/ui/dashboard/subview/weather/weather_comparison.yaml b/ui/dashboard/subview/weather/weather_comparison.yaml index d8c9f8c27..67101539d 100644 --- a/ui/dashboard/subview/weather/weather_comparison.yaml +++ b/ui/dashboard/subview/weather/weather_comparison.yaml @@ -4,20 +4,31 @@ title: "Weather Comparison" icon: mdi:weather-pouring path: weather-comparison +type: panel subview: true cards: - - !include /config/ui/history/weather/outdoor_temperature_comparison.yaml - - !include /config/ui/history/weather/outdoor_apparent_temperature_comparison.yaml - - !include /config/ui/history/weather/high_temperature_comparison.yaml - - !include /config/ui/history/weather/low_temperature_comparison.yaml - - !include /config/ui/history/weather/outdoor_humidity_comparison.yaml - - !include /config/ui/history/weather/pressure_comparison.yaml - - !include /config/ui/history/weather/wind_speed_comparison.yaml - - !include /config/ui/history/weather/wind_gust_comparison.yaml - - !include /config/ui/history/weather/wind_bearing_comparison.yaml - - !include /config/ui/history/weather/precipitation_probability_comparison.yaml - - !include /config/ui/history/weather/precipitation_intensity_comparison.yaml - - !include /config/ui/history/weather/precipitation_today_comparison.yaml - - !include /config/ui/history/weather/precipitation_yesterday_comparison.yaml - - !include /config/ui/history/weather/precipitation_type_comparison.yaml - - !include /config/ui/history/weather/current_condition_comparison.yaml + - type: grid + columns: 4 + square: false + cards: + - !include /config/ui/history/weather/outdoor_temperature_comparison.yaml + - !include /config/ui/history/weather/outdoor_apparent_temperature_comparison.yaml + - !include /config/ui/history/weather/high_temperature_comparison.yaml + - !include /config/ui/history/weather/low_temperature_comparison.yaml + + - !include /config/ui/history/weather/outdoor_humidity_comparison.yaml + - !include /config/ui/history/weather/pressure_comparison.yaml + - !include /config/ui/history/weather/wind_speed_comparison.yaml + - !include /config/ui/history/weather/wind_gust_comparison.yaml + + - !include /config/ui/history/weather/wind_bearing_comparison.yaml + - !include /config/ui/history/weather/precipitation_probability_comparison.yaml + - !include /config/ui/history/weather/precipitation_intensity_comparison.yaml + - !include /config/ui/history/weather/precipitation_today_comparison.yaml + + - !include /config/ui/history/weather/precipitation_yesterday_comparison.yaml + - !include /config/ui/history/weather/precipitation_type_comparison.yaml + - !include /config/ui/history/weather/current_condition_comparison.yaml + - !include /config/ui/history/weather/lightning_count_comparison.yaml + + - !include /config/ui/history/weather/lightning_distance_comparison.yaml \ No newline at end of file diff --git a/ui/dashboard/subview/weather/wind.yaml b/ui/dashboard/subview/weather/wind.yaml index b9b82cce2..439750c14 100644 --- a/ui/dashboard/subview/weather/wind.yaml +++ b/ui/dashboard/subview/weather/wind.yaml @@ -59,7 +59,7 @@ sections: - !include /config/ui/graph/weather/wind_detail.yaml - type: grid - columns: 2 + columns: 3 square: false grid_options: columns: full diff --git a/ui/gauge/cloud_cover.yaml b/ui/gauge/cloud_cover.yaml index 02bf3810d..b1e139d86 100644 --- a/ui/gauge/cloud_cover.yaml +++ b/ui/gauge/cloud_cover.yaml @@ -10,17 +10,17 @@ max: 100 segments: - from: 0 label: "Clear" - color: rgb(3, 190, 252) + color: var(--state-icon-color) - - from: 10 + - from: 20 label: "Partly Cloudy" - color: rgb(181, 221, 235) + color: rgb(144, 192, 223) - from: 50 label: "Mostly Cloudy" - color: rgb(165, 190, 199) + color: rgb(131, 151, 172) - from: 80 label: "Cloudy" - color: rgb(101, 111, 115) + color: rgb(109, 113, 121) diff --git a/ui/gauge/smoke_risk.yaml b/ui/gauge/smoke_risk.yaml index bcc86f90b..db702fc7b 100644 --- a/ui/gauge/smoke_risk.yaml +++ b/ui/gauge/smoke_risk.yaml @@ -3,7 +3,7 @@ ############################################################################### type: gauge name: "Smoke" -entity: sensor.atmospheric_smoke +entity: sensor.smoke_level needle: true min: -10 max: 300 diff --git a/ui/graph/climate/climate_summary_month.yaml b/ui/graph/climate/climate_summary_month.yaml index b57a441ce..6ced19388 100644 --- a/ui/graph/climate/climate_summary_month.yaml +++ b/ui/graph/climate/climate_summary_month.yaml @@ -78,10 +78,12 @@ series: yaxis_id: indoor statistics: type: max + period: hour + align: end stroke_width: 3 color: rgb(171, 78, 63) - - entity: input_number.thermostat_target_temperature # doesn't work with statistics + - entity: sensor.indoor_temperature_target name: "Target" yaxis_id: indoor curve: stepline @@ -92,6 +94,8 @@ series: yaxis_id: outdoor statistics: type: max + period: hour + align: end stroke_width: 2 opacity: 0.7 color_threshold: !include /config/ui/graph/include/temperature_line_color.yaml @@ -100,6 +104,8 @@ series: yaxis_id: humidity statistics: type: max + period: hour + align: end color_threshold: !include /config/ui/graph/include/humidity_line_color.yaml - entity: sensor.thermostat_cool_daily_runtime diff --git a/ui/graph/climate/climate_summary_week.yaml b/ui/graph/climate/climate_summary_week.yaml index 9d2a3b6e0..05298f7e5 100644 --- a/ui/graph/climate/climate_summary_week.yaml +++ b/ui/graph/climate/climate_summary_week.yaml @@ -81,7 +81,7 @@ series: color: rgb(235, 52, 52) opacity: 0.7 - - entity: input_number.thermostat_target_temperature + - entity: sensor.indoor_temperature_target name: "Target" yaxis_id: indoor curve: stepline diff --git a/ui/graph/climate/indoor_temperature.yaml b/ui/graph/climate/indoor_temperature.yaml index 1857d6858..8a73401d0 100644 --- a/ui/graph/climate/indoor_temperature.yaml +++ b/ui/graph/climate/indoor_temperature.yaml @@ -11,7 +11,7 @@ yaxis: min: ~15 max: ~30 series: - - entity: input_number.thermostat_target_temperature + - entity: sensor.indoor_temperature_target yaxis_id: temperature group_by: func: raw diff --git a/ui/graph/climate/indoor_temperature_detail.yaml b/ui/graph/climate/indoor_temperature_detail.yaml index 1812938ad..698e43e5d 100644 --- a/ui/graph/climate/indoor_temperature_detail.yaml +++ b/ui/graph/climate/indoor_temperature_detail.yaml @@ -18,7 +18,7 @@ yaxis: fontWeight: normal series: - - entity: input_number.thermostat_target_temperature + - entity: sensor.indoor_temperature_target name: "Target" yaxis_id: temperature show: diff --git a/ui/graph/climate/spa_summary_week.yaml b/ui/graph/climate/spa_summary_week.yaml index f2e4c31f2..02162ae50 100644 --- a/ui/graph/climate/spa_summary_week.yaml +++ b/ui/graph/climate/spa_summary_week.yaml @@ -34,6 +34,7 @@ yaxis: apex_config: decimalsInFloat: 1 tickAmount: 5 + forceNiceScale: true labels: show: true title: @@ -42,10 +43,12 @@ yaxis: - id: hours opposite: true - max: ~6 + min: 0 + max: ~5 apex_config: decimalsInFloat: 0 tickAmount: 5 + forceNiceScale: true labels: show: true title: diff --git a/ui/graph/graph_templates.yaml b/ui/graph/graph_templates.yaml index c259f6c03..19b215755 100644 --- a/ui/graph/graph_templates.yaml +++ b/ui/graph/graph_templates.yaml @@ -50,6 +50,10 @@ default: curve: smooth stroke_width: 2 opacity: 1 + statistics: + type: max + period: hour + align: end fill_raw: "null" show: in_header: false @@ -85,6 +89,10 @@ mini: in_chart: true legend_value: false name_in_header: false + statistics: + type: max + period: 5minute + align: start group_by: func: max duration: 15min @@ -113,7 +121,7 @@ climate_mini: weather_detail: config_templates: default update_interval: 15min - graph_span: 7d # any more renders graphs incorrectly + graph_span: 7d #BUG any more renders graphs incorrectly apex_config: chart: height: 600px @@ -140,5 +148,8 @@ weather_detail: group_by: func: max duration: 1h + weather_mini: config_templates: mini + + diff --git a/ui/graph/include/temperature_area_color.yaml b/ui/graph/include/temperature_area_color.yaml index e63c2a532..272e31ff2 100644 --- a/ui/graph/include/temperature_area_color.yaml +++ b/ui/graph/include/temperature_area_color.yaml @@ -1,67 +1,60 @@ ############################################################################### ## Temperature Area Colors (Apex Graphs) # https://www.windy.com/colors?temp, 42.505,-88.451, 6 -############################################################################### -- value: -29 # -20 - color: rgb(151, 143, 195) - opacity: 0.5 +############################################################################### opacity: 0.5 -- value: -23 # -10 - color: rgb(146, 143, 187) +- value: -25 # -13F + color: rgb(143, 89, 169) opacity: 0.5 -- value: -17 # 0 - color: rgb(151, 196, 216) +- value: -20 # -4F + color: rgb(157, 219, 217) opacity: 0.5 -- value: -12 # 10 - color: rgb(139, 205, 207) +- value: -15 # 5F + color: rgb(106, 191, 181) opacity: 0.5 -- value: -7 # 20 - color: rgb(114, 185, 187) +- value: -10 # 14F + color: rgb(100, 166, 189) opacity: 0.5 -- value: -1 # 30 - color: rgb(112, 143, 169) +- value: -5 # 23F + color: rgb(93, 133, 198) opacity: 0.5 -- value: 4 # 40 - color: rgb(79, 139, 72) +- value: 0 # 32F + color: rgb(68, 125, 99) opacity: 0.5 -- value: 10 # 50 - color: rgb(125, 143, 40) +- value: 5 # 41F + color: rgb(128, 147, 24) opacity: 0.5 -- value: 15 # 60 - color: rgb(176, 162, 12) +- value: 10 # 50F + color: rgb(209, 212, 78) opacity: 0.5 -- value: 21 # 70 - color: rgb(214, 172, 8) +- value: 15 # 59F + color: rgb(243, 183, 4) opacity: 0.5 -- value: 26 # 80 - color: rgb(239, 148, 7) +- value: 20 # 68F + color: rgb(250, 223, 86) opacity: 0.5 -- value: 29 # 85 - color: rgb(247, 96, 2) +- value: 25 # 77F + color: rgb(232, 83, 25) opacity: 0.5 -- value: 32 # 90 - color: rgb(204, 74, 19) +- value: 30 # 86F + color: rgb(209, 54, 54) opacity: 0.5 -- value: 35 # 95 - color: rgb(192, 66, 18) +- value: 35 # 95F + color: rgb(177, 67, 45) opacity: 0.5 -- value: 38 # 100 - color: rgb(147, 38, 8) - opacity: 0.5 - -- value: 43 # 110 - color: rgb(177, 67, 45) - opacity: 0.5 +- value: 40 # 104F + color: rgb(71, 14, 0) + opacity: 0.5 \ No newline at end of file diff --git a/ui/graph/include/temperature_line_color.yaml b/ui/graph/include/temperature_line_color.yaml index 18b26a041..486515644 100644 --- a/ui/graph/include/temperature_line_color.yaml +++ b/ui/graph/include/temperature_line_color.yaml @@ -39,7 +39,8 @@ color: rgb(209, 54, 54) - value: 35 # 95F - color: rgb(71, 14, 0) + color: rgb(177, 67, 45) - value: 40 # 104F - color: rgb(177, 67, 45) + color: rgb(71, 14, 0) + diff --git a/ui/graph/weather/air_quality_detail.yaml b/ui/graph/weather/air_quality_detail.yaml index 0627d88e3..bc00a89f9 100644 --- a/ui/graph/weather/air_quality_detail.yaml +++ b/ui/graph/weather/air_quality_detail.yaml @@ -57,37 +57,43 @@ series: - entity: sensor.air_quality_index name: "AQI" yaxis_id: aqi - stroke_width: 3 + stroke_width: 5 color: rgb(255, 255, 255) - entity: sensor.air_quality_index - name: "AQI" + name: " " yaxis_id: aqi type: area stroke_width: 0 - color: rgb(50, 50, 50) + color: rgb(255, 255, 255) color_threshold: !include /config/ui/graph/include/air_quality_index_area_color.yaml + - entity: sensor.particulate_matter_2_5 + name: "2.5mm" + yaxis_id: aqi + stroke_width: 3 + - entity: sensor.carbon_monoxide name: "CO" yaxis_id: aqi + stroke_width: 3 - entity: sensor.nitrogen_dioxide name: "NO2" yaxis_id: aqi + stroke_width: 3 - entity: sensor.sulphur_dioxide name: "SO2" yaxis_id: aqi + stroke_width: 3 - entity: sensor.ozone_index name: "Ozone" yaxis_id: aqi + stroke_width: 3 - - entity: sensor.particulate_matter_2_5 - name: "2.5mm" - yaxis_id: aqi - - - entity: sensor.atmospheric_smoke + - entity: sensor.smoke_level name: "Smoke" yaxis_id: smoke + stroke_width: 3 diff --git a/ui/graph/weather/atmospheric_conditions_detail.yaml b/ui/graph/weather/atmospheric_conditions_detail.yaml index 9ea7fb2d8..850162774 100644 --- a/ui/graph/weather/atmospheric_conditions_detail.yaml +++ b/ui/graph/weather/atmospheric_conditions_detail.yaml @@ -21,8 +21,8 @@ now: yaxis: - id: pressure show: true - min: 980 - max: 1035 + min: 930 + max: 1050 apex_config: tickAmount: 5 decimalsInFloat: 0 @@ -155,7 +155,7 @@ series: group_by: duration: 6h stroke_width: 3 - color: rgb(182, 24, 222) + color: rgb(242, 235, 36) - entity: sensor.hourly_weather name: " " @@ -167,7 +167,7 @@ series: return [new Date(entry.datetime).getTime(), entry.pressure]; }); stroke_width: 3 - color: rgb(182, 24, 222) + color: rgb(242, 235, 36) - entity: sensor.outdoor_humidity name: "Humidity" @@ -230,14 +230,7 @@ series: color: rgb(150, 150, 150) color_threshold: !include /config/ui/graph/include/cloud_cover_area_color.yaml - - entity: sensor.ozone_level - name: "Ozone" - yaxis_id: ozone - extend_to: now - stroke_width: 1 - color: rgb(252, 152, 3) - - - entity: sensor.ozone_index #TEST + - entity: sensor.ozone_index name: "Ozone Index" yaxis_id: aqi extend_to: now diff --git a/ui/graph/weather/lightning_detail.yaml b/ui/graph/weather/lightning_detail.yaml index 1f35c3036..d4ca03cc9 100644 --- a/ui/graph/weather/lightning_detail.yaml +++ b/ui/graph/weather/lightning_detail.yaml @@ -82,7 +82,7 @@ series: opacity: 0.7 color: red - - entity: sensor.lightning_last_strike_distance + - entity: sensor.lightning_distance name: "Strike Distance" yaxis_id: distance color: orange diff --git a/ui/graph/weather/precipitation_detail.yaml b/ui/graph/weather/precipitation_detail.yaml index f6ae2d539..3f52281a2 100644 --- a/ui/graph/weather/precipitation_detail.yaml +++ b/ui/graph/weather/precipitation_detail.yaml @@ -22,8 +22,8 @@ now: yaxis: - id: pressure show: true - min: ~1000 - max: ~1035 + min: 930 + max: 1050 apex_config: tickAmount: 5 decimalsInFloat: 0 diff --git a/ui/graph/weather/temperature_detail.yaml b/ui/graph/weather/temperature_detail.yaml index 32550d1a4..946ff1ec9 100644 --- a/ui/graph/weather/temperature_detail.yaml +++ b/ui/graph/weather/temperature_detail.yaml @@ -122,16 +122,16 @@ series: stroke_width: 3 color: rgb(108, 2, 189) - - entity: sensor.windsor_normal_high_temperature + - entity: sensor.outdoor_normal_high_temperature name: "Normal High" yaxis_id: temperature stroke_width: 4 opacity: 0.5 - color: rgb(186, 6, 6) + color: rgb(12, 4, 179) - - entity: sensor.windsor_normal_low_temperature + - entity: sensor.outdoor_normal_low_temperature name: "Normal Low" yaxis_id: temperature stroke_width: 4 opacity: 0.5 - color: rgb(12, 4, 179) \ No newline at end of file + color: rgb(186, 6, 6) \ No newline at end of file diff --git a/ui/history/weather/lightning_count_comparison.yaml b/ui/history/weather/lightning_count_comparison.yaml new file mode 100644 index 000000000..26cd87056 --- /dev/null +++ b/ui/history/weather/lightning_count_comparison.yaml @@ -0,0 +1,16 @@ +############################################################################### +## Lightning History +############################################################################### +type: history-graph +title: "Lightning Count" +hours_to_show: 168 +show_names: true +entities: + - entity: sensor.lightning_count + name: "Current Count" + + - entity: sensor.home_sensors_lightnings_strikes + name: "Weatherflow" + + + diff --git a/ui/history/weather/lightning_distance_comparison.yaml b/ui/history/weather/lightning_distance_comparison.yaml new file mode 100644 index 000000000..eb3a70637 --- /dev/null +++ b/ui/history/weather/lightning_distance_comparison.yaml @@ -0,0 +1,15 @@ +############################################################################### +## Lightning History +############################################################################### +type: history-graph +title: "Lightning Distance" +hours_to_show: 168 +show_names: true +entities: + - entity: sensor.lightning_distance + name: "Current Distance" + + - entity: sensor.home_sensors_distance_last_lightning_strike + name: "Weatherflow" + + diff --git a/ui/history/weather/precipitation_today_comparison.yaml b/ui/history/weather/precipitation_today_comparison.yaml index 4951a78ff..b2faea092 100644 --- a/ui/history/weather/precipitation_today_comparison.yaml +++ b/ui/history/weather/precipitation_today_comparison.yaml @@ -21,7 +21,7 @@ entities: - entity: sensor.precipitation_expected_today name: "Expected" - - entity: sensor.home_sensors_precipitation_today #TEST + - entity: sensor.home_sensors_precipitation_today name: "WF Cloud" - entity: sensor.home_sensors_precipitation_today_checked diff --git a/ui/statistics_graph/smoke_level.yaml b/ui/statistics_graph/smoke_level.yaml index 6d38b8be3..2e9784925 100644 --- a/ui/statistics_graph/smoke_level.yaml +++ b/ui/statistics_graph/smoke_level.yaml @@ -4,7 +4,7 @@ type: statistics-graph title: "Smoke Level" entities: - - entity: sensor.atmospheric_smoke + - entity: sensor.smoke_level name: "Smoke" days_to_show: 365 period: week diff --git a/ui/themes/custom.yaml b/ui/themes/custom.yaml index 9252dbeff..469b31e22 100644 --- a/ui/themes/custom.yaml +++ b/ui/themes/custom.yaml @@ -502,17 +502,24 @@ custom: #STYLE color opacities mush-rgb-state-climate-off: var(--mush-rgb-disabled); # Custom Variables - entity-button-selected-color: rgba(200, 200, 200, 0.3) # light grey - entity-button-primary-color: rgba(100, 162, 217, 0.4) # light blue + entity-button-selected-color: rgba(200, 200, 200, 0.3) # light-grey-color + entity-button-disabled-color: rgba(200, 200, 200, 0.3) # grey-color + entity-button-primary-color: rgba(100, 162, 217, 0.3) # light-blue-color entity-button-active-color: rgba(175, 165, 10, 0.3) # --state-active-color - entity-button-critical-color: rgba(244, 67, 54, 0.2) # --red-color - entity-button-severe-color: rgba(255, 152, 0, 0.2) # --orange-color - entity-button-warning-color: rgba(255, 193, 7, 0.2) # --amber-color - entity-button-minor-color: rgba(255, 235, 59, 0.2) # --yellow-color - entity-button-alert-off-color: rgba(255, 193, 7, 0.2) # --amber-color - entity-button-heating-color: rgba(255, 87, 34, 0.4) # --state-climate-heat-color - entity-button-cooling-color: rgba(33, 150, 243, 0.4) # --state-climate-cool-color - entity-hassio-color: rgb(75, 155, 239) # light blue + entity-button-critical-color: rgba(244, 67, 54, 0.3) # --red-color + entity-button-severe-color: rgba(255, 152, 0, 0.3) # --orange-color + entity-button-warning-color: rgba(255, 193, 7, 0.3) # --amber-color + entity-button-minor-color: rgba(255, 235, 59, 0.3) # --yellow-color + entity-button-alert-color: rgba(255, 235, 59, 0.3) # --yellow-color + entity-button-alert-off-color: rgba(255, 193, 7, 0.3) # --amber-color + entity-button-heating-color: rgba(255, 87, 34, 0.3) # --state-climate-heat-color + entity-button-cooling-color: rgba(33, 150, 243, 0.3) # --state-climate-cool-color + entity-button-high-temp-color: rgba(255, 41, 8, 0.3) # --entity-high-temp-color + entity-button-low-temp-color: rgba(54, 45, 247, 0.3) # --entity-low-temp-color + entity-button-low-humdity-color: rgba(255, 235, 59, 0.3) # --yellow-color + entity-button-high-humdity-color: rgba(100, 162, 217, 0.3) # light blue + + entity-hassio-color: var(--light-blue-color) entity-ok-color: var(--success-color) entity-minor-color: var(--yellow-color) entity-warning-color: var(--amber-color)