Advertisement
mikalmo

apexchart - yaml (strømpriser)

Nov 14th, 2023
854
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.23 KB | None | 0 0
  1. type: custom:apexcharts-card
  2. header:
  3.   show: true
  4.   title: ''
  5. experimental:
  6.   color_threshold: true
  7. now:
  8.   show: true
  9.   label:
  10.   color: royalblue
  11. graph_span: 2d
  12. span:
  13.   start: day
  14. apex_config:
  15.   dataLabels:
  16.     enabled: true
  17.   legend:
  18.     show: true
  19.   yaxis:
  20.     - id: price
  21.       show: true
  22.       decimalsInFloat: 1
  23.       floating: false
  24.       forceNiceScale: true
  25.       extend_to: end
  26.       min: 0
  27. series:
  28.   - entity: sensor.brutto_strompris
  29.     type: area
  30.     yaxis_id: price
  31.     curve: smooth
  32.     stroke_width: 0
  33.     show:
  34.       legend_value: false
  35.     color_threshold:
  36.       - value: 0
  37.         color: green
  38.       - value: 0.5
  39.         color: limegreen
  40.       - value: 0.8
  41.         color: lightgreen
  42.       - value: 1
  43.         color: gold
  44.       - value: 1.2
  45.         color: orange
  46.       - value: 1.4
  47.         color: darkorange
  48.       - value: 1.6
  49.         color: orangered
  50.       - value: 1.8
  51.         color: red
  52.       - value: 2
  53.         color: darkred
  54.       - value: 2.2
  55.         color: firebrick
  56.       - value: 2.4
  57.         color: darkviolet
  58.       - value: 2.6
  59.         color: indigo
  60.       - value: 2.8
  61.         color: mediumblue
  62.       - value: 3
  63.         color: royalblue
  64.     data_generator: |
  65.      var priceData = entity.attributes.pricedata;
  66.       var data = priceData.map(function(entry) {
  67.         return [new Date(entry.start), entry.value];
  68.       });
  69.       return data;
  70.     extend_to: now
  71.   - entity: sensor.netto_strompris
  72.     type: line
  73.     yaxis_id: price
  74.     curve: smooth
  75.     stroke_width: 2
  76.     show:
  77.       legend_value: false
  78.     color: royalblue
  79.     data_generator: |
  80.      var priceData = entity.attributes.pricedata;
  81.       var data = priceData.map(function(entry) {
  82.         return [new Date(entry.start), entry.value];
  83.       });
  84.       return data;
  85.     extend_to: now
  86.   - entity: sensor.spotpris_strom
  87.     type: line
  88.     name: Spotpris
  89.     yaxis_id: price
  90.     curve: smooth
  91.     stroke_width: 1
  92.     show:
  93.       legend_value: false
  94.     color: grey
  95.     data_generator: |
  96.      var priceData = entity.attributes.pricedata;
  97.       var data = priceData.map(function(entry) {
  98.         return [new Date(entry.start), entry.value];
  99.       });
  100.       return data;
  101.     extend_to: now
  102.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement