Perka

Apex nordpool 48h

Jan 18th, 2026
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. type: custom:apexcharts-card
  2. header:
  3. show: true
  4. title: Elpris SE2 – idag och imorgon (inkl. påslag)
  5. span:
  6. start: day
  7. offset: +0d
  8. graph_span: 48h
  9. now:
  10. show: true
  11. apex_config:
  12. chart:
  13. type: line
  14. stroke:
  15. width: 2
  16. curve: straight
  17. xaxis:
  18. type: datetime
  19. legend:
  20. show: false
  21. tooltip:
  22. x:
  23. format: dd MMM HH:mm
  24. "y":
  25. formatter: |
  26. function (value) {
  27. return value.toFixed(2) + " kr/kWh";
  28. }
  29. yaxis:
  30. - decimals: 2
  31. series:
  32. - entity: sensor.nordpool_se2_prices_48h
  33. name: Elpris (totalt)
  34. type: line
  35. data_generator: |
  36. const data = entity.attributes?.data || [];
  37.  
  38. const paslag = parseFloat(
  39. hass.states['sensor.elpris_rorligt_paslag_inkl_moms']?.state
  40. );
  41. const k = isFinite(paslag) ? paslag : 0;
  42.  
  43. const momsElhandel = parseFloat(
  44. hass.states['input_number.elhandel_spot_moms']?.state
  45. ) / 100;
  46. const m = isFinite(momsElhandel) ? momsElhandel : 0;
  47.  
  48. return data.map(p => {
  49. const spot = Number(p.price);
  50. return [
  51. new Date(p.start).getTime(),
  52. spot * (1 + m) + k
  53. ];
  54. });
  55. - entity: sensor.pelletspris_per_kwh
  56. name: Pelletspris
  57. type: line
  58. data_generator: |
  59. const data = hass.states['sensor.nordpool_se2_prices_48h']
  60. ?.attributes?.data || [];
  61.  
  62. const pellets = parseFloat(
  63. hass.states['sensor.pelletspris_per_kwh']?.state
  64. );
  65.  
  66. if (!isFinite(pellets)) return [];
  67.  
  68. return data.map(p => [
  69. new Date(p.start).getTime(),
  70. pellets
  71. ]);
  72.  
Add Comment
Please, Sign In to add comment