Add window weather functionality to dashboards
This commit is contained in:
@@ -1057,6 +1057,10 @@ views:
|
||||
| int %} {% set high =
|
||||
states('sensor.stratton_ave_apparent_temperature') | int %} {{
|
||||
'Threshold Met' if high <= threshold else '' }}
|
||||
- entity: input_number.window_weather_minimum
|
||||
name: Window Minimum
|
||||
- entity: input_number.window_weather_maximum
|
||||
name: Window Maximum
|
||||
show_header_toggle: false
|
||||
state_color: true
|
||||
title: Weather
|
||||
|
||||
@@ -430,6 +430,73 @@ views:
|
||||
entity: binary_sensor.lightning_warning
|
||||
state: 'on'
|
||||
features_position: bottom
|
||||
- type: custom:mushroom-template-card
|
||||
primary: Window Weather
|
||||
tap_action:
|
||||
action: none
|
||||
icon_tap_action:
|
||||
action: none
|
||||
features_position: bottom
|
||||
entity: binary_sensor.window_weather
|
||||
icon: |-
|
||||
{% if is_state('binary_sensor.windows','on') %}
|
||||
mdi:window-open
|
||||
{% else %}
|
||||
mdi:window-closed
|
||||
{% endif %}
|
||||
color: |-
|
||||
{% if is_state(entity,'on') %}
|
||||
{% if is_state('binary_sensor.windows','on') %}
|
||||
var(--cyan-color)
|
||||
{% else %}
|
||||
var(--green-color)
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if is_state('binary_sensor.windows','on') %}
|
||||
var(--error-color)
|
||||
{% else %}
|
||||
var(--disabled-color)
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
secondary: |-
|
||||
{% if is_state(entity,'on') %}
|
||||
It's nice outside!
|
||||
{% else %}
|
||||
Close Windows!
|
||||
{% endif %}
|
||||
badge_icon: >-
|
||||
{% if is_state(entity,'off') and
|
||||
is_state('binary_sensor.windows','on') %}
|
||||
|
||||
mdi:exclamation
|
||||
|
||||
{% elif is_state(entity,'on') and
|
||||
is_state('binary_sensor.windows','on') %}
|
||||
|
||||
mdi:check
|
||||
|
||||
{% endif %}
|
||||
badge_color: >-
|
||||
{% if is_state(entity,'off') and
|
||||
is_state('binary_sensor.windows','on') %}
|
||||
|
||||
var(--error-color)
|
||||
|
||||
{% elif is_state(entity,'on') and
|
||||
is_state('binary_sensor.windows','on') %}
|
||||
|
||||
var(--success-color)
|
||||
|
||||
{% endif %}
|
||||
visibility:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity: binary_sensor.window_weather
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity: binary_sensor.windows
|
||||
state: 'on'
|
||||
column_span: 1
|
||||
- type: grid
|
||||
cards:
|
||||
|
||||
@@ -4276,6 +4276,44 @@ views:
|
||||
- condition: state
|
||||
entity: binary_sensor.windows
|
||||
state: 'on'
|
||||
- type: custom:mushroom-template-badge
|
||||
content: |-
|
||||
{% if is_state(entity,'on') %}
|
||||
It's nice outside!
|
||||
{% else %}
|
||||
Close Windows!
|
||||
{% endif %}
|
||||
icon: |-
|
||||
{% if is_state('binary_sensor.windows','on') %}
|
||||
mdi:window-open
|
||||
{% else %}
|
||||
mdi:window-closed
|
||||
{% endif %}
|
||||
color: |-
|
||||
{% if is_state(entity,'on') %}
|
||||
{% if is_state('binary_sensor.windows','on') %}
|
||||
var(--cyan-color)
|
||||
{% else %}
|
||||
var(--green-color)
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if is_state('binary_sensor.windows','on') %}
|
||||
var(--error-color)
|
||||
{% else %}
|
||||
var(--disabled-color)
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
entity: binary_sensor.window_weather
|
||||
label: Window Weather
|
||||
visibility:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity: binary_sensor.window_weather
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity: binary_sensor.windows
|
||||
state: 'on'
|
||||
- type: custom:mushroom-template-badge
|
||||
content: Check light switches
|
||||
icon: mdi:light-switch
|
||||
|
||||
Reference in New Issue
Block a user