Skeem

lovelace.yaml

May 14th, 2022 (edited)
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 9.74 KB | None | 0 0
  1.  
  2.   - title: Strøm
  3.     icon: mdi:home-lightning-bolt
  4.     panel: true
  5.     cards:
  6.       - type: custom:layout-card
  7.         layout_type: custom:grid-layout
  8.         layout:
  9.           grid-template-columns: auto 450px
  10.           grid-template-rows: auto
  11.           grid-template-areas: |
  12.            "c11 c21"
  13.             "c12 c21"
  14.             "c13 c23"
  15.         max_cols: 2
  16.         cards:
  17.           - type: horizontal-stack
  18.             view_layout:
  19.               grid-area: c11
  20.             cards:
  21.               - type: markdown #custom:useful-markdown-card
  22.                 content: >
  23.                  <table width="100%">
  24.                   <tr><td><br>
  25.                     <font size="3"><center>Dagens strømudgift<br>&nbsp; </center></font>
  26.                   </td></tr>
  27.                   <tr><td>
  28.                     <font size="5"><center>
  29.                     {%- set pris =  (states("sensor.price_daily") | float) -%}
  30.                     {%- set pris =  (pris *100) | int /100 -%}
  31.                     Kr {{ pris }}
  32.                     </center></font>
  33.                   </td></tr>
  34.                   </table>
  35.  
  36.               - type: gauge
  37.                 name: Nuværende strømforbrug
  38.                 entity: sensor.electricity_meter
  39.                 min: 0
  40.                 max: 8
  41.                 severity:
  42.                   green: 0
  43.                   yellow: 1
  44.                   red: 2
  45.  
  46.               - type: gauge
  47.                 name: Nuværende strømudgift
  48.                 min: 0
  49.                 max: 15
  50.                 unit: "Kr/h"
  51.                 entity: sensor.powerprice_rt
  52.                 severity:
  53.                   green: 0
  54.                   yellow: 4
  55.                   red: 10
  56.  
  57.               - type: gauge
  58.                 name: Elforbrug for måneden
  59.                 entity: sensor.samlet_forbrug_for_maneden_2
  60.                 max: 1100
  61.                 severity:
  62.                         green: 0
  63.                         yellow: 825
  64.                         red: 900  
  65.  
  66.               - type: 'custom:config-template-card'
  67.                 entities:
  68.                  - sensor.eloverblik_monthly_statistics
  69.                 card:
  70.                   type: gauge
  71.                   entity: sensor.eloverblik_monthly_statistics
  72.                   max: 35
  73.                   min: 0
  74.                   name: Elforbrug, gns
  75.                   severity:
  76.                     green: 0
  77.                     red: '${states[''sensor.eloverblik_monthly_statistics''].state * 1.1}'
  78.                     yellow: '${states[''sensor.eloverblik_monthly_statistics''].state * 1.05}'
  79.                            
  80.           - type: horizontal-stack
  81.             view_layout:
  82.               grid-area: c12
  83.             cards:
  84.               - type: custom:mini-graph-card
  85.                 name: Strømforbrug time for time
  86.                 hours_to_show: 24
  87.                 aggregate_func: diff
  88.                 #line_width: 2
  89.                 #points_per_hour: 60
  90.                 hour24: true
  91.                 group_by: hour
  92.                 entities:
  93.                 - sensor.energy_hourly
  94.                 show:
  95.                   fill: true
  96.                   graph: bar
  97.                   labels: true
  98.                   legend: true
  99.                 color_thresholds:
  100.                   - value: 0
  101.                     color: rgb(82, 190, 128 )
  102.                   - value: 1
  103.                     color: rgb(244, 208, 63)
  104.                   - value: 2
  105.                     color: rgb(205, 97, 85)
  106.  
  107.               - type: custom:mini-graph-card
  108.                 hours_to_show: 24
  109.                 name: Strømudgift time for time
  110.                 aggregate_func: diff
  111.                 #line_width: 2
  112.                 #points_per_hour: 60
  113.                 hour24: true
  114.                 group_by: hour
  115.                 entities:
  116.                 - sensor.powerprice_hourly
  117.                 show:
  118.                   fill: true
  119.                   graph: bar
  120.                   labels: true
  121.                   legend: true
  122.                 color_thresholds:
  123.                   - value: 0
  124.                     color: rgb(82, 190, 128 )
  125.                   - value: 2
  126.                     color: rgb(244, 208, 63)
  127.                   - value: 4
  128.                     color: rgb(205, 97, 85)
  129.  
  130.               - type: custom:mini-graph-card
  131.                 name: Strømforbrug seneste 7 dage
  132.                 hours_to_show: 168
  133.                 aggregate_func: diff
  134.                 #line_width: 2
  135.                 #points_per_hour: 60
  136.                 hour24: true
  137.                 group_by: date
  138.                 entities:
  139.                 - sensor.energy_monthly
  140.                 show:
  141.                   fill: true
  142.                   graph: bar
  143.                   labels: true
  144.                   legend: true
  145.                 color_thresholds:
  146.                   - value: 0
  147.                     color: rgb(82, 190, 128 )
  148.                   - value: 1
  149.                     color: rgb(244, 208, 63)
  150.                   - value: 2
  151.                     color: rgb(205, 97, 85)
  152.  
  153.           - type: 'custom:config-template-card'
  154.             view_layout:
  155.               grid-area: c13          
  156.             entities:
  157.              - sensor.eloverblik_energy_total
  158.             card:
  159.                 type: custom:mini-graph-card
  160.                 hours_to_show: 744
  161.                 aggregate_func: diff
  162.                 name: Strømudgift løbende måned
  163.                 #line_width: 2
  164.                 #points_per_hour: 60
  165.                 hour24: true
  166.                 group_by: date
  167.                 entities:
  168.                 - sensor.price_monthly
  169.                 show:
  170.                   fill: true
  171.                   graph: bar
  172.                   labels: true
  173.                   legend: true
  174.                 color_thresholds:
  175.                   - value: 0
  176.                     color: rgb(82, 190, 128 )
  177.                   - value: 40
  178.                     color: rgb(244, 208, 63)
  179.                   - value: 60
  180.                     color: rgb(205, 97, 85)
  181.  
  182.             #Apex card #1 - dagens elpriser
  183.           - type: 'custom:config-template-card'
  184.             view_layout:
  185.               grid-area: c21    
  186.             entities:
  187.              - sensor.nordpool_kwh_dk2_dkk_3_095_025
  188.             element:
  189.                 type: custom:apexcharts-card
  190.                 experimental:
  191.                   color_threshold: true
  192.                 graph_span: 24h
  193. #                      title: Strømpriser i dag (kr/kWh)
  194.                 header:
  195.                   title: ${"Strømpriser i dag (kr/kWh) - Nu "+ Math.round(states['sensor.nordpool_kwh_dk2_dkk_3_095_025'].attributes.current_price*10)/10 + " - Gns " + Math.round(states['sensor.nordpool_kwh_dk2_dkk_3_095_025'].attributes.average *10)/10 + " kr/kWh"}
  196.                   show: true
  197.                 span:
  198.                   start: day
  199.                 yaxis:
  200.                  - min: 0
  201.                    max: 8
  202.                    decimals: 1
  203.                    apex_config:
  204.                      tickAmount: 8
  205.                 now:
  206.                   show: true
  207.                   label: Nu
  208.                 series:
  209.                   - entity: sensor.nordpool_kwh_dk2_dkk_3_095_025
  210.                     type: column
  211.                     data_generator: |
  212.                      return entity.attributes.raw_today.map((start, index) => {
  213.                         return [new Date(start["start"]).getTime(), entity.attributes.raw_today[index]["value"]];
  214.                       });
  215.                     float_precision: 2
  216.                     color_threshold:
  217.                       - value: 0
  218.                         color: rgb(82, 190, 128 )
  219.                       - value: 2
  220.                         color: rgb(244, 208, 63)
  221.                       - value: 3
  222.                         color: rgb(205, 97, 85)
  223.                        
  224.             #Apex card #2 - morgendagens elpriser
  225.           - type: conditional
  226.             conditions:
  227.               - entity: sensor.elpris_tomorrow_available
  228.                 state: 'True'
  229.             view_layout:
  230.               grid-area: c23
  231.             card:
  232.               type: custom:apexcharts-card
  233.               experimental:
  234.                 color_threshold: true
  235.               graph_span: 1d
  236.               header:
  237.                 title: Strømpriser i morgen (kr/kWh)
  238.                 show: true
  239.               span:
  240.                 start: day
  241.                 offset: +1d
  242.               yaxis:
  243.                 - min: 0
  244.                   max: 8
  245.                   decimals: 1      
  246.                   apex_config:
  247.                     tickAmount: 8
  248.               series:
  249.                 - entity: sensor.nordpool_kwh_dk2_dkk_3_095_025
  250.                   type: column
  251.                   data_generator: |
  252.                    return entity.attributes.raw_tomorrow.map((start, index) => {
  253.                       return [new Date(start["start"]).getTime(), entity.attributes.raw_tomorrow[index]["value"]];
  254.                     });
  255.                   float_precision: 2
  256.                   color_threshold:
  257.                     - value: 0
  258.                       color: rgb(82, 190, 128 )
  259.                     - value: 2
  260.                       color: rgb(244, 208, 63)
  261.                     - value: 3
  262.                       color: rgb(205, 97, 85)
  263.           - type: conditional
  264.             conditions:
  265.               - entity: sensor.elpris_tomorrow_available
  266.                 state: 'False'
  267.             view_layout:
  268.               grid-area: c23  
  269.             card:
  270.                 type: markdown #custom:useful-markdown-card
  271.                 #view_layout:
  272.                  # grid-area: h1  
  273.                 content: >
  274.                    Strømpriser for i morgen er ikke tilgængelige endnu.<br>
  275.                     Data forventes ca. kl. 1300
  276.                    
Add Comment
Please, Sign In to add comment