Advertisement
Chrwjensen

Elprisoversigt dashboard card

Dec 22nd, 2024
4
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. type: custom:apexcharts-card
  2. apex_config:
  3. chart:
  4. height: 150px
  5. toolbar:
  6. show: true
  7. offsetY: -27
  8. tools:
  9. selection: true
  10. download: false
  11. zoom: false
  12. zoomin: true
  13. zoomout: true
  14. pan: false
  15. reset: true
  16. zoom:
  17. enabled: true
  18. dataLabels:
  19. enabled: true
  20. style:
  21. fontSize: 10px
  22. colors:
  23. - "#fff"
  24. distributed: true
  25. background:
  26. enabled: false
  27. xaxis:
  28. labels:
  29. format: HH
  30. axisBorder:
  31. show: true
  32. color: grey
  33. plotOptions:
  34. bar:
  35. dataLabels:
  36. position: bottom
  37. maxItems: 32
  38. hideOverflowingLabels: true
  39. orientation: vertical
  40. columnWidth: 90%
  41. all_series_config:
  42. unit: " kr."
  43. experimental:
  44. color_threshold: true
  45. header:
  46. title: Elpriser pr. time (kr/kWh)
  47. show: true
  48. standard_format: false
  49. graph_span: 20h
  50. span:
  51. start: hour
  52. offset: "-0h"
  53. yaxis:
  54. - min: 0
  55. max: ~2
  56. apex_config:
  57. tickAmount: 4
  58. series:
  59. - entity: sensor.energi_data_service
  60. type: column
  61. name: Inkl. afgifter
  62. data_generator: |
  63. var today = entity.attributes.raw_today.map((start, index) => {
  64. return [new Date(start["hour"]).getTime(), entity.attributes.raw_today[index]["price"]];
  65. });
  66. if (entity.attributes.tomorrow_valid) {
  67. var tomorrow = entity.attributes.raw_tomorrow.map((start, index) => {
  68. return [new Date(start["hour"]).getTime(), entity.attributes.raw_tomorrow[index]["price"]];
  69. });
  70.  
  71. var data = today.concat(tomorrow);
  72. } else {
  73. var data = today
  74. }
  75. return data;
  76. float_precision: 2
  77. color_threshold:
  78. - value: 0
  79. color: green
  80. - value: 1.5
  81. color: orange
  82. - value: 3
  83. color: red
  84. - value: 5
  85. color: darkred
  86. show:
  87. legend_value: false
  88. in_header: false
  89. datalabels: true
  90.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement