Advertisement
Azuria

Untitled

Nov 4th, 2022
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. type: custom:apexcharts-card
  2. apex_config:
  3. chart:
  4. height: 350px
  5. experimental:
  6. color_threshold: true
  7. graph_span: 24h
  8. header:
  9. title: Elpriser pr. time (kr/kWh)
  10. show: true
  11. span:
  12. start: hour
  13. offset: '-2h'
  14. now:
  15. show: true
  16. label: Nu
  17. yaxis:
  18. - min: 0
  19. apex_config:
  20. tickAmount: 9
  21. series:
  22. - entity: sensor.energi_data_service
  23. type: column
  24. data_generator: |
  25. var today = entity.attributes.raw_today.map((start, index) => {
  26. return [new Date(start["hour"]).getTime(), entity.attributes.raw_today[index]["price"]];
  27. });
  28. if (entity.attributes.tomorrow_valid) {
  29. var tomorrow = entity.attributes.raw_tomorrow.map((start, index) => {
  30. return [new Date(start["hour"]).getTime(), entity.attributes.raw_tomorrow[index]["price"]];
  31. });
  32.  
  33. var data = today.concat(tomorrow);
  34. } else {
  35. var data = today
  36. }
  37. return data;
  38. float_precision: 2
  39. color_threshold:
  40. - value: 0
  41. color: green
  42. - value: 2
  43. color: orange
  44. - value: 3.5
  45. color: red
  46. - value: 5
  47. color: darkred
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement