Advertisement
Thomsen79

Energi_data_service Apex ny

Jan 27th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.80 KB | None | 0 0
  1. type: vertical-stack
  2. cards:
  3. - square: false
  4. columns: 3
  5. type: grid
  6. cards:
  7. - type: custom:mushroom-template-card
  8. card_mod:
  9. style: >
  10. ha-card {
  11. --ha-card-border-radius: 50px;
  12. --ha-card-background: rgba(222, 260, 260, 0.02);
  13. --icon-symbol-size: 40px;
  14. }
  15.  
  16. ha-state-icon {
  17.  
  18. animation: bounce 2.5s cubic-bezier(0.30, 2.40, 0.85, 2.50)
  19. infinite;
  20. transform-origin: 50% 0%;
  21. }
  22.  
  23. @keyframes bounce {
  24.  
  25. 0%, 100% { transform: translateY(0px) scaleY(0.9); }
  26.  
  27. 80% { transform: translateY(3px); }
  28.  
  29. }
  30.  
  31. mushroom-shape-icon {
  32. --shape-color: transparent !important;
  33. --shape-color-disabled: transparent !important;
  34. }
  35. primary: ' Laveste'
  36. secondary: >-
  37. I dag: {{ state_attr("sensor.energi_data_service","today_min").price |
  38. round(2) }} kr
  39.  
  40. I morgen: {% if state_attr("sensor.energi_data_service",
  41. "tomorrow_valid") -%}
  42. {{ state_attr("sensor.energi_data_service","tomorrow_min").price | round(2) }} kr
  43. {%- else -%}
  44.  
  45. N/A
  46.  
  47. {%- endif %}
  48. icon: mdi:transfer-down
  49. multiline_secondary: true
  50. fill_container: false
  51. layout: vertical
  52. icon_color: green
  53. - type: custom:mushroom-template-card
  54. card_mod:
  55. style: >
  56. ha-card {
  57. --ha-card-border-radius: 50px;
  58. --ha-card-background: rgba(222, 260, 260, 0.02);
  59. --icon-symbol-size: 40px;
  60. }
  61.  
  62. ha-state-icon {
  63.  
  64. animation: bounce 2.5s cubic-bezier(0.30, 2.40, 0.85, 2.50)
  65. infinite;
  66. transform-origin: 50% 100%;
  67. }
  68.  
  69. @keyframes bounce {
  70.  
  71. 0%, 100% { transform: translateY(0px) scaleY(0.9); }
  72.  
  73. 80% { transform: translateY(-3px); }
  74.  
  75. }
  76.  
  77. mushroom-shape-icon {
  78. --shape-color: transparent !important;
  79. --shape-color-disabled: transparent !important;
  80. }
  81. primary: Højeste
  82. secondary: >-
  83. I dag: {{ state_attr("sensor.energi_data_service","today_max").price |
  84. round(2) }} kr
  85.  
  86. I morgen: {% if state_attr("sensor.energi_data_service",
  87. "tomorrow_valid") -%}
  88. {{ state_attr("sensor.energi_data_service","tomorrow_max").price | round(2) }} kr
  89. {%- else -%}
  90. N/A
  91. {%- endif %}
  92. icon: mdi:transfer-up
  93. multiline_secondary: true
  94. fill_container: true
  95. layout: vertical
  96. icon_color: red
  97. - type: custom:mushroom-template-card
  98. card_mod:
  99. style: |
  100. ha-card {
  101. --ha-card-border-radius: 50px;
  102. --ha-card-background: rgba(222, 260, 260, 0.02);
  103. --icon-symbol-size: 40px;
  104. }
  105. mushroom-shape-icon {
  106. --shape-color: transparent !important;
  107. --shape-color-disabled: transparent !important;
  108. }
  109. primary: Pris
  110. secondary: >-
  111. Nu: {% set current_price = states('sensor.energi_data_service') %}{{
  112. current_price | round(2) }} kr
  113.  
  114. Total: {{ states('sensor.dagens_pris_for_kobt_strom') | round(2) }} kr
  115. icon: mdi:cash-multiple
  116. multiline_secondary: true
  117. fill_container: true
  118. layout: vertical
  119. icon_color: blue
  120. - type: custom:apexcharts-card
  121. card_mod:
  122. style: |
  123. ha-card {
  124. --ha-card-border-radius: 20px;
  125. --ha-card-background: rgba(222, 260, 260, 0.02);
  126. }
  127. show:
  128. last_updated: false
  129. experimental:
  130. color_threshold: true
  131. apex_config:
  132. chart:
  133. height: 320px
  134. xaxis:
  135. type: datetime
  136. labels:
  137. datetimeFormatter:
  138. hour: H
  139. tickPlacement: 'on'
  140. graph_span: 28h
  141. span:
  142. start: hour
  143. offset: '-1h'
  144. now:
  145. show: true
  146. label: Nu
  147. header:
  148. title: El-priser pr. time(Kr./kWh)+Abn.(83,02kr./mdr.)
  149. show: true
  150. show_states: true
  151. colorize_states: true
  152. yaxis:
  153. - min: ~0
  154. max: '|+0.0|'
  155. decimals: 2
  156. apex_config:
  157. max: auto
  158. tickAmount: 5
  159. series:
  160. - entity: sensor.energi_data_service
  161. color_threshold:
  162. - value: -1
  163. color: darkgreen
  164. opacity: 0.7
  165. - value: 1
  166. color: lightgreen
  167. - value: 2
  168. color: green
  169. opacity: 0.7
  170. - value: 2.5
  171. color: red
  172. - value: 3
  173. color: darkred
  174. name: Lige nu
  175. type: area
  176. show:
  177. in_header: false
  178. header_color_threshold: true
  179. in_chart: true
  180. stroke_width: 2
  181. float_precision: 2
  182. unit: ' kr'
  183. data_generator: |
  184. var today = entity.attributes.raw_today.map((start, index) => {
  185. return [new Date(start["hour"]).getTime(), entity.attributes.raw_today[index]["price"]];
  186. });
  187.  
  188. var extradata = entity.attributes.forecast.map((start, index) => {
  189. return [new Date(start["hour"]).getTime(), entity.attributes.forecast[index]["price"]];
  190. });
  191.  
  192. if (entity.attributes.tomorrow_valid) {
  193. var tomorrow = entity.attributes.raw_tomorrow.map((start, index) => {
  194. return [new Date(start["hour"]).getTime(), entity.attributes.raw_tomorrow[index]["price"]];
  195. });
  196. today = today.concat(tomorrow)
  197. }
  198.  
  199. return today.concat(extradata)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement