Advertisement
tiwing

Current Conditions

Feb 6th, 2025
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 25.46 KB | None | 0 0
  1. type: vertical-stack
  2. cards:
  3.   - type: custom:decluttering-card
  4.     template: normal_title
  5.     variables:
  6.       - content: Current Conditions
  7.       - sub-content: null
  8.   - type: vertical-stack
  9.     cards:
  10.       - square: false
  11.         type: grid
  12.         cards:
  13.           - type: picture-elements
  14.             image: /local/dashboard_photos/transparent/~transparent-1-1.png
  15.             card_mod:
  16.               style: |
  17.                ha-card {
  18.                       background:
  19.                       /* top, transparent red, faked with gradient */
  20.                       linear-gradient(
  21.                         rgba(0, 0, 0, 0.2),
  22.                         rgba(0, 0, 0, 0.1)
  23.                       ),
  24.                       /* bottom, image */
  25.                       url("/local/dashboard_photos/temperature_humidity.jpg");
  26.                       background-size: cover;
  27.                       #background-size: contain;
  28.                       #background-size: auto;
  29.                       #background-size: auto auto;
  30.                       background-repeat: no-repeat;
  31.                       background-position: center left;
  32.                     }
  33.             elements:
  34.               - type: state-label
  35.                 style:
  36.                   transform: none
  37.                   right: 1%
  38.                   top: 1%
  39.                 card_mod:
  40.                   style: |
  41.                     :host {
  42.                         {% set lev = states('sensor.outdoor_front_temp')|float(0) %}
  43.                         {% if lev < -7 %}
  44.                           color: lightblue;
  45.                           text-shadow: 1px 1px 4px blue;
  46.                           font-weight: 600;
  47.                           font-size: 160%;
  48.                         {% elif lev > 27 %}
  49.                           color: crimson;
  50.                           text-shadow: 1px 1px 4px salmon;
  51.                           font-weight: 600;
  52.                           font-size: 160%;
  53.                         {% else %}
  54.                           color: white;
  55.                           font-size: 160%;
  56.                         {% endif %}
  57.                     }
  58.                 entity: sensor.outdoor_front_temp
  59.               - type: conditional
  60.                 conditions:
  61.                   - entity: sensor.outdoor_humidity
  62.                     state_not: unavailable
  63.                 title: humidity
  64.                 elements:
  65.                   - type: state-label
  66.                     style:
  67.                       transform: none
  68.                       right: 1%
  69.                       top: 17%
  70.                       font-size: 155%
  71.                       color: white
  72.                     entity: sensor.outdoor_humidity
  73.               - type: state-label
  74.                 style:
  75.                   transform: none
  76.                   right: 2%
  77.                 card_mod:
  78.                   style: |
  79.                    :host {
  80.                         {% set lev = states('sensor.calc_feels_like')|float(0) %}
  81.                         {% if lev < -7 %}
  82.                           color: lightblue;
  83.                           text-shadow: 1px 1px 4px blue;
  84.                           font-weight: 600;
  85.                           font-size: 150%;
  86.                           top: 50%;
  87.                         {% elif lev > 27 %}
  88.                           color: crimson;
  89.                           text-shadow: 1px 1px 4px salmon;
  90.                           font-weight: 600;
  91.                           font-size: 150%;
  92.                           top: 50%;
  93.                         {% else %}
  94.                           color: white;
  95.                           bottom: 12%;
  96.                         {% endif %}
  97.                     }
  98.                 entity: sensor.calc_feels_like
  99.                 prefix: "Feels: "
  100.               - type: conditional
  101.                 conditions:
  102.                   - entity: sensor.openweathermap_uv_index
  103.                     state_not: unavailable
  104.                 title: uv index
  105.                 elements:
  106.                   - type: state-label
  107.                     style:
  108.                       transform: none
  109.                       right: 2%
  110.                       bottom: 0%
  111.                       font-size: 100%
  112.                       color: silver
  113.                     entity: sensor.openweathermap_uv_index
  114.           - type: picture-elements
  115.             image: /local/dashboard_photos/transparent/~transparent-1-1.png
  116.             card_mod:
  117.               style: |
  118.                ha-card {
  119.                       background:
  120.                       /* top, transparent red, faked with gradient */
  121.                       linear-gradient(
  122.                         rgba(0, 0, 0, 0.2),
  123.                         rgba(0, 0, 0, 0.1)
  124.                       ),
  125.                       /* bottom, image */
  126.                       url("/local/dashboard_photos/wind_turbine_2.jpg");
  127.                       background-size: cover;
  128.                       #background-size: contain;
  129.                       #background-size: auto;
  130.                       #background-size: auto auto;
  131.                       background-repeat: no-repeat;
  132.                     }
  133.             elements:
  134.               - type: conditional
  135.                 conditions:
  136.                   - condition: numeric_state
  137.                     entity: sensor.outdoor_front_pressure
  138.                     above: 4
  139.                 title: pressure
  140.                 elements:
  141.                   - type: state-label
  142.                     style:
  143.                       transform: none
  144.                       left: 1%
  145.                       bottom: 0%
  146.                       font-size: 100%
  147.                     card_mod:
  148.                       style: |
  149.                        :host {
  150.                           color:
  151.                               {% set lev = states('sensor.outdoor_front_pressure')|float(0) %}
  152.                               {% if lev > 70  %}
  153.                                 red
  154.                               {% elif lev > 40 %}
  155.                                 rgb(255,165,0)
  156.                               {% else %}
  157.                                 lightgreen
  158.                               {% endif %};
  159.                         }
  160.                     entity: sensor.outdoor_front_pressure
  161.                     prefix: "Pressure: "
  162.               - type: state-label
  163.                 style:
  164.                   transform: none
  165.                   left: 1%
  166.                   font-size: 100%
  167.                 card_mod:
  168.                   style: |
  169.                    :host {
  170.                           {% set lev = states('sensor.lincoln_wind_gust')|float(0) %}
  171.                               {% if lev <= states('sensor.astroweather_backyard_10m_wind_speed')|float(0) %}
  172.                                 opacity: 0;
  173.                                 top: 999%;
  174.                               {% elif lev > 65  %}
  175.                                 color: red;
  176.                                 top: 10%;
  177.                               {% elif lev > 40 %}
  178.                                 color: rgb(255,165,0);
  179.                                 top: 10%;
  180.                               {% elif lev < 1 %}
  181.                                 opacity: 0;
  182.                                 top: 999%;
  183.                               {% else %}
  184.                                 color: silver;
  185.                                 top: 10%;
  186.                               {% endif %}
  187.                     }
  188.                 entity: sensor.lincoln_wind_gust
  189.                 prefix: "Gust: "
  190.               - type: conditional
  191.                 conditions:
  192.                   - condition: numeric_state
  193.                     entity: sensor.astroweather_backyard_10m_wind_speed
  194.                     above: 0
  195.                 title: wind speed
  196.                 elements:
  197.                   - type: state-label
  198.                     style:
  199.                       left: 50%
  200.                       top: 50%
  201.                       font-size: 200%
  202.                       font-weight: 700
  203.                       color: white
  204.                     entity: sensor.astroweather_backyard_10m_wind_direction
  205.               - type: state-label
  206.                 style:
  207.                   transform: none
  208.                   left: 1%
  209.                   font-size: 100%
  210.                 card_mod:
  211.                   style: |
  212.                    :host {
  213.                           {% set lev = states('sensor.astroweather_backyard_10m_wind_speed')|float(0) %}
  214.                           {% if lev > 50  %}
  215.                             color: red;
  216.                             top: 1%;
  217.                           {% elif lev > 30 %}
  218.                             color: rgb(255,165,0);
  219.                             top: 1%;
  220.                           {% elif lev < 1  %}
  221.                             opacity: 0;
  222.                             top: 999%;
  223.                           {% else %}
  224.                             color: silver;
  225.                             top: 1%;
  226.                           {% endif %}
  227.                     }
  228.                 entity: sensor.astroweather_backyard_10m_wind_speed
  229.                 prefix: "Speed: "
  230.               - type: state-label
  231.                 style:
  232.                   transform: none
  233.                   left: 1%
  234.                   font-size: 100%
  235.                 card_mod:
  236.                   style: |
  237.                    :host {
  238.                           {% set lev = states('sensor.lincoln_chance_of_precip')|float(0) %}
  239.                           {% if lev > 70  %}
  240.                             color: silver;
  241.                             bottom: 10%;
  242.                           {% elif lev > 90 %}
  243.                             color: rgb(255,165,0);
  244.                             bottom: 10%;
  245.                           {% elif lev < 1  %}
  246.                             opacity: 0;
  247.                             top: 999%;
  248.                           {% else %}
  249.                             color: silver;
  250.                             bottom: 10%;
  251.                           {% endif %}
  252.                     }
  253.                 entity: sensor.lincoln_chance_of_precip
  254.                 prefix: "POP: "
  255.         columns: 2
  256.       - type: picture-elements
  257.         image: /local/dashboard_photos/low_horizon_blue_1.jpg
  258.         elements:
  259.           - type: state-label
  260.             title: sun elevation
  261.             style:
  262.               transform: none
  263.               left: 1%
  264.               top: 0%
  265.               font-size: 90%
  266.               font-weight: 700
  267.             entity: sensor.sun_elevation
  268.             prefix: "Elevation: "
  269.           - type: state-label
  270.             title: sun azimuth
  271.             style:
  272.               transform: none
  273.               left: 1%
  274.               top: 9%
  275.               font-size: 90%
  276.               font-weight: 700
  277.             entity: sensor.sun_azimuth
  278.             prefix: "Azimuth: "
  279.             card_mod:
  280.               style: |
  281.                :host {
  282.                   {% set totAz = (180-states('sensor.morning_azimuth')|float(0))*2 %}
  283.                   {% set progress = ( ( (states('sensor.azimuth_display')|float(0) - states('sensor.morning_azimuth')|float(0) ) / totAz) * 100)|float(0)|round(0) %}
  284.                   {% if states('sensor.sun_elevation')|float(0) > -6 %}
  285.                     background-image: linear-gradient(270deg,rgba(28,28,28,1) {{100-progress-3}}%, rgba(28,28,28,0.2) {{100-progress+5}}% ),
  286.                        linear-gradient(90deg, blue 0%, rgb(255,165,0) 12%, yellow 20%, yellow 80%,rgb(255,165,0) 92%, blue 100%);
  287.                   {% endif %}
  288.                  
  289.                   background-size: 100% 4px !important;
  290.                   background-repeat: no-repeat !important;
  291.                   background-position: 0% 75% !important;
  292.                 }
  293.           - type: state-label
  294.             title: dawn
  295.             style:
  296.               transform: none
  297.               left: 1%
  298.               top: 18%
  299.               font-size: 90%
  300.             card_mod:
  301.               style: |
  302.                :host {
  303.                   {% set datetime_value = as_timestamp(state_attr('sun.sun','next_dawn')) | timestamp_custom('%Y-%m-%d %H:%M:%S') %}
  304.                  
  305.                       {# Extract the date from the datetime value #}
  306.                   {% set extracted_date = strptime(datetime_value, '%Y-%m-%d %H:%M:%S').date() %}
  307.  
  308.                       {# Calculate tomorrow's date #}
  309.                   {% set tomorrow_date = (now() + timedelta(days=1)).date() %}
  310.  
  311.                       {# Determine if the extracted date is tomorrow #}
  312.                   {% if extracted_date == tomorrow_date %}
  313.                     opacity: 0.5;
  314.                   {% else %}
  315.                     opacity: 1;
  316.                   {% endif %}
  317.                 }
  318.             entity: sensor.next_dawn
  319.             prefix: "Dawn: "
  320.           - type: state-label
  321.             title: sunrise
  322.             style:
  323.               transform: none
  324.               left: 1%
  325.               top: 27%
  326.               font-size: 90%
  327.             card_mod:
  328.               style: |
  329.                :host {
  330.                   {% set datetime_value = as_timestamp(state_attr('sun.sun','next_rising')) | timestamp_custom('%Y-%m-%d %H:%M:%S') %}
  331.                  
  332.                       {# Extract the date from the datetime value #}
  333.                   {% set extracted_date = strptime(datetime_value, '%Y-%m-%d %H:%M:%S').date() %}
  334.  
  335.                       {# Calculate tomorrow's date #}
  336.                   {% set tomorrow_date = (now() + timedelta(days=1)).date() %}
  337.  
  338.                       {# Determine if the extracted date is tomorrow #}
  339.                   {% if extracted_date == tomorrow_date %}
  340.                     opacity: 0.5;
  341.                   {% else %}
  342.                     opacity: 1;
  343.                   {% endif %}
  344.                 }
  345.             entity: sensor.next_sunrise
  346.             prefix: "Sunrise: "
  347.           - type: state-label
  348.             title: noon
  349.             style:
  350.               transform: none
  351.               left: 1%
  352.               top: 36%
  353.               font-size: 90%
  354.             card_mod:
  355.               style: |
  356.                :host {
  357.                   {% set datetime_value = as_timestamp(state_attr('sun.sun','next_noon')) | timestamp_custom('%Y-%m-%d %H:%M:%S') %}
  358.                  
  359.                       {# Extract the date from the datetime value #}
  360.                   {% set extracted_date = strptime(datetime_value, '%Y-%m-%d %H:%M:%S').date() %}
  361.  
  362.                       {# Calculate tomorrow's date #}
  363.                   {% set tomorrow_date = (now() + timedelta(days=1)).date() %}
  364.  
  365.                       {# Determine if the extracted date is tomorrow #}
  366.                   {% if extracted_date == tomorrow_date %}
  367.                     opacity: 0.5;
  368.                   {% else %}
  369.                     opacity: 1;
  370.                   {% endif %}
  371.                 }
  372.             entity: sensor.next_solar_noon_time
  373.             prefix: "Noon: "
  374.           - type: state-label
  375.             title: sunset
  376.             style:
  377.               transform: none
  378.               left: 1%
  379.               top: 45%
  380.               font-size: 90%
  381.             card_mod:
  382.               style: |
  383.                :host {
  384.                   {% set datetime_value = as_timestamp(state_attr('sun.sun','next_setting')) | timestamp_custom('%Y-%m-%d %H:%M:%S') %}
  385.                  
  386.                       {# Extract the date from the datetime value #}
  387.                   {% set extracted_date = strptime(datetime_value, '%Y-%m-%d %H:%M:%S').date() %}
  388.  
  389.                       {# Calculate tomorrow's date #}
  390.                   {% set tomorrow_date = (now() + timedelta(days=1)).date() %}
  391.  
  392.                       {# Determine if the extracted date is tomorrow #}
  393.                   {% if extracted_date == tomorrow_date %}
  394.                     opacity: 0.5;
  395.                   {% else %}
  396.                     opacity: 1;
  397.                   {% endif %}
  398.                 }
  399.             entity: sensor.next_sunset
  400.             prefix: "Sunset: "
  401.           - type: state-label
  402.             title: dusk
  403.             style:
  404.               transform: none
  405.               left: 1%
  406.               top: 54%
  407.               font-size: 90%
  408.             card_mod:
  409.               style: |
  410.                :host {
  411.                   {% set datetime_value = as_timestamp(state_attr('sun.sun','next_dusk')) | timestamp_custom('%Y-%m-%d %H:%M:%S') %}
  412.                  
  413.                       {# Extract the date from the datetime value #}
  414.                   {% set extracted_date = strptime(datetime_value, '%Y-%m-%d %H:%M:%S').date() %}
  415.  
  416.                       {# Calculate tomorrow's date #}
  417.                   {% set tomorrow_date = (now() + timedelta(days=1)).date() %}
  418.  
  419.                       {# Determine if the extracted date is tomorrow #}
  420.                   {% if extracted_date == tomorrow_date %}
  421.                     opacity: 0.5;
  422.                   {% else %}
  423.                     opacity: 1;
  424.                   {% endif %}
  425.                 }
  426.             entity: sensor.next_dusk
  427.             prefix: "Dusk: "
  428.           - type: state-label
  429.             title: moon elevation
  430.             style:
  431.               transform: none
  432.               right: 1%
  433.               top: 0%
  434.               font-size: 90%
  435.               font-weight: 700
  436.             entity: sensor.astroweather_backyard_moon_altitude
  437.             prefix: "Elevation: "
  438.           - type: state-label
  439.             title: moon azimuth
  440.             style:
  441.               transform: none
  442.               right: 1%
  443.               top: 9%
  444.               font-size: 90%
  445.               font-weight: 700
  446.             entity: sensor.astroweather_backyard_moon_azimuth
  447.             prefix: "Azimuth: "
  448.           - type: state-label
  449.             title: moon phase
  450.             style:
  451.               transform: none
  452.               right: 1%
  453.               top: 18%
  454.               font-size: 90%
  455.               color: silver
  456.             entity: sensor.moon
  457.           - type: state-label
  458.             title: moon illumination
  459.             hold_action:
  460.               action: more-info
  461.               entity: camera.nasa_moon_image
  462.             style:
  463.               transform: none
  464.               right: 1%
  465.               top: 27%
  466.               font-size: 90%
  467.               color: silver
  468.               background: rgba(255,255,255,.0)
  469.             entity: sensor.astroweather_backyard_moon_phase
  470.             prefix: "Illumination: "
  471.           - type: state-label
  472.             title: moonrise
  473.             style:
  474.               transform: none
  475.               right: 1%
  476.               top: 36%
  477.               font-size: 90%
  478.             card_mod:
  479.               style: |
  480.                :host {
  481.                   {% set datetime_value = as_timestamp(states('sensor.astroweather_backyard_moon_next_rising')) | timestamp_custom('%Y-%m-%d %H:%M:%S') %}
  482.                  
  483.                       {# Extract the date from the datetime value #}
  484.                   {% set extracted_date = strptime(datetime_value, '%Y-%m-%d %H:%M:%S').date() %}
  485.  
  486.                       {# Calculate tomorrow's date #}
  487.                   {% set tomorrow_date = (now() + timedelta(days=1)).date() %}
  488.  
  489.                       {# Determine if the extracted date is tomorrow #}
  490.                   {% if (extracted_date == tomorrow_date) or (states('sensor.astroweather_backyard_moon_altitude')|float(0) > 1) %}
  491.                     opacity: 0.5;
  492.                   {% else %}
  493.                     opacity: 1;
  494.                   {% endif %}
  495.                 }
  496.             entity: sensor.next_moonrise
  497.             prefix: "Moonrise: "
  498.           - type: state-label
  499.             title: moonset
  500.             style:
  501.               transform: none
  502.               right: 1%
  503.               top: 45%
  504.               font-size: 90%
  505.             card_mod:
  506.               style: |
  507.                :host {
  508.                   {% set datetime_value = as_timestamp(states('sensor.astroweather_backyard_moon_next_setting')) | timestamp_custom('%Y-%m-%d %H:%M:%S') %}
  509.                  
  510.                       {# Extract the date from the datetime value #}
  511.                   {% set extracted_date = strptime(datetime_value, '%Y-%m-%d %H:%M:%S').date() %}
  512.  
  513.                       {# Calculate tomorrow's date #}
  514.                   {% set tomorrow_date = (now() + timedelta(days=1)).date() %}
  515.  
  516.                       {# Determine if the extracted date is tomorrow #}
  517.                   {% if (states('sensor.astroweather_backyard_moon_altitude')|float(0) < 0) %}
  518.                     opacity: 0.5;
  519.                   {% else %}
  520.                     opacity: 1;
  521.                   {% endif %}
  522.                 }
  523.             entity: sensor.next_moonset
  524.             prefix: "Moonset: "
  525.           - type: image
  526.             tap_action: none
  527.             double_tap_action: none
  528.             hold_action: none
  529.             image: /local/dashboard_photos/sun-icon.png
  530.             style:
  531.               width: 9%
  532.               min-width: 39px
  533.             card_mod:
  534.               style: |
  535.                :host {
  536.                   bottom: {{ (((states('sensor.sun_elevation')|float(0)))+2)|round(1) }}%;
  537.                   left: {{ ((states('sensor.astroweather_backyard_sun_azimuth')|float(0) / 360)*100)|round(1) }}%;
  538.                   opacity:              
  539.                     {% set ele = states('sensor.sun_elevation')|float(0) %}
  540.                     {% set ele_start = -5 %}
  541.                     {% set ele_end = 3 %}
  542.                     {% set ele_range = ele_end - ele_start %}
  543.                     {% set min_opacity = 0.07 %}
  544.                     {% set adj_ele = ele - ele_start %}
  545.                     {% set calc_opacity = adj_ele / ele_range %}
  546.                    
  547.                     {% if ele < ele_start %}
  548.                       {{ min_opacity }};
  549.                     {% elif ele > ele_end %}
  550.                       {{ "1.0" }}
  551.                     {% else %}
  552.                       {% if calc_opacity < min_opacity %}
  553.                         {{ min_opacity }}
  554.                       {% else %}
  555.                         {{ calc_opacity }}
  556.                       {% endif %}
  557.                     {% endif %}
  558.                 }
  559.           - type: image
  560.             tap_action:
  561.               action: more-info
  562.             double_tap_action: none
  563.             hold_action:
  564.               action: more-info
  565.               entity: camera.nasa_moon_image
  566.             camera_image: camera.nasa_moon_image
  567.             entity: sensor.nasa_moon_phase_info
  568.             style:
  569.               width: 5%
  570.               min-width: 28px
  571.             card_mod:
  572.               style: |
  573.                :host {
  574.                   bottom: {{ (((states('sensor.astroweather_backyard_moon_altitude')|float(0)))+7)|round(1) }}%;    
  575.                   left: {{ ((states('sensor.astroweather_backyard_moon_azimuth')|float(0) / 360)*100)|round(1) }}%;
  576.                   opacity:            
  577.                     {% set ele = states('sensor.astroweather_backyard_moon_altitude')|float(0) %}
  578.                     {% set ele_start = -2 %}
  579.                     {% set ele_end = 3 %}
  580.                     {% set ele_range = ele_end - ele_start %}
  581.                     {% set min_opacity = 0.01 %}
  582.                     {% set adj_ele = ele - ele_start %}
  583.                     {% set calc_opacity = adj_ele / ele_range %}
  584.                    
  585.                     {% if ele < ele_start %}
  586.                       {{ min_opacity }};
  587.                     {% elif ele > ele_end %}
  588.                       {{ "1.0" }}
  589.                     {% else %}
  590.                       {% if calc_opacity < min_opacity %}
  591.                         {{ min_opacity }}
  592.                       {% else %}
  593.                         {{ calc_opacity }}
  594.                       {% endif %}
  595.                     {% endif %}
  596.                   {% set comment = "https://community.home-assistant.io/t/display-the-accurate-moon-phase-and-orientation-with-home-assistant-by-gui-only/723099/10" %}
  597.                   border-radius: 50% !important;
  598.                   clip-path: circle(43%) !important;
  599.                 }
  600.           - type: state-label
  601.             style:
  602.               transform: none
  603.               transform-origin: bottom left
  604.               left: 0%
  605.               bottom: 0%
  606.               font-size: 100%
  607.               font-weight: 600
  608.               color: grey
  609.             entity: sensor.dummy_blank_sensor
  610.             prefix: <East
  611.             tap_action: none
  612.             double_tap_action: none
  613.             hold_action: none
  614.           - type: state-label
  615.             style:
  616.               transform: none
  617.               transform-origin: bottom right
  618.               right: 0%
  619.               bottom: 0%
  620.               font-size: 100%
  621.               font-weight: 600
  622.               color: grey
  623.             entity: sensor.dummy_blank_sensor
  624.             tap_action: none
  625.             double_tap_action: none
  626.             hold_action: none
  627.             prefix: West>
  628.           - type: state-label
  629.             title: full moon
  630.             tap_action: none
  631.             double_tap_action: none
  632.             hold_action: none
  633.             style:
  634.               font-size: 120%
  635.               color: lightgreen
  636.               font-weight: 800
  637.             entity: sensor.dummy_blank_sensor
  638.             prefix: "Alert: Warewolves Tonight"
  639.             card_mod:
  640.               style: |
  641.                :host {
  642.                   background: rgba(255,255,255,0.0);
  643.                 {% if is_state('sensor.moon','full_moon') %}
  644.                   opacity: 1;
  645.                   top: 94%;
  646.                   left: 50%;
  647.                 {% else %}
  648.                   opacity: 0;
  649.                   top: -99%;
  650.                   left: -99%;
  651.                 {% endif %}
  652.  
  653.  
  654.  
  655.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement