Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type: vertical-stack
- cards:
- - type: markdown
- content: >
- Hej, {{user}}!
- <ha-icon icon="mdi:power-plug"></ha-icon>El koster lige nu **{{ (state_attr('sensor.energi_data_service',
- 'current_price'))|replace('.',',')}}** kr. - det er **{{
- (state_attr('sensor.energi_data_service', 'current_price') | float * 100
- / (state_attr('sensor.energi_data_service', 'today_mean') | float * 100
- )| float * 100 ) | round (2)|replace('.',',')}} %** sammenlignet med andre
- timer i dag.
- Hvis du vil vaske i dag, så er de billigste timer:
- {% set l=(state_attr('sensor.energi_data_service', 'raw_today'
- )|sort(attribute='price')) %}
- {% set h=(state_attr('sensor.energi_data_service', 'raw_today'
- )|sort(reverse=true, attribute='price')) %}
- <ha-icon icon="mdi:clock-check"></ha-icon>
- Billigste time {{ l[0].hour.time()}}, Pris: {{
- l[0].price|replace('.',',')}} kr.
- <ha-icon icon="mdi:clock-check"></ha-icon> 2. billigste time {{
- l[1].hour.time() }}, Pris: {{ l[1].price|replace('.',',')}} kr.
- <ha-icon icon="mdi:clock-check"></ha-icon> 3. billigste time {{
- l[2].hour.time() }}, Pris: {{ l[2].price|replace('.',',')}} kr.
- <ha-icon icon="mdi:clock-check"></ha-icon> 4. billigste time {{
- l[3].hour.time() }}, Pris: {{ l[3].price|replace('.',',')}} kr.
- <ha-icon icon="mdi:clock-check"></ha-icon> 5. billigste time {{
- l[4].hour.time() }}, Pris: {{ l[4].price|replace('.',',')}} kr.
- Disse er de dyreste timer:
- <ha-icon icon="mdi:clock-alert"></ha-icon> Dyreste
- time {{ h[0].hour.time()}}, Pris: {{ h[0].price|replace('.',',')}} kr.
- <ha-icon icon="mdi:clock-alert"></ha-icon> 2. dyreste time {{
- h[1].hour.time() }}, Pris: {{ h[1].price|replace('.',',')}} kr.
- <ha-icon icon="mdi:clock-alert"></ha-icon> 3. dyreste time {{
- h[2].hour.time() }}, Pris: {{ h[2].price|replace('.',',')}} kr.
- <ha-icon icon="mdi:clock-alert"></ha-icon> 4. dyreste time {{
- h[3].hour.time() }}, Pris: {{ h[3].price|replace('.',',')}} kr.
- <ha-icon icon="mdi:clock-alert"></ha-icon> 5. dyreste time {{
- h[4].hour.time() }}, Pris: {{ h[4].price|replace('.',',')}} kr.
- Gennemsnitsprisen i dag er: **{{ (state_attr('sensor.energi_data_service',
- 'today_mean'))|round(3)|replace('.',',')}}** kr.
- <ha-icon icon="mdi:cash-multiple"></ha-icon> Du sparer **{{(((state_attr('sensor.energi_data_service',
- 'today_mean')) - l[0].price) / (state_attr('sensor.energi_data_service',
- 'today_mean'))| float * 100 ) | round (2)|replace('.',',')}} %** ved at
- vaske i den billigste time i forhold til dagens gennemsnit.
- Eller **{{((h[0].price - l[0].price) / h[0].price| float * 100 ) | round
- (2)|replace('.',',')}} %** i forhold til den dyreste time! <ha-icon
- icon="mdi:alert"></ha-icon>
- title: Elpris i dag
- - type: gauge
- entity: sensor.energi_data_service
- min: 0
- name: Nuværende kWh-pris
- severity:
- green: 1.5
- yellow: 3
- red: 4.5
- needle: true
- unit: kr/kWh
- max: 9
- - type: custom:config-template-card
- entities:
- - sensor.energi_data_service
- - sensor.historic_energy_price_percentiles
- config_templates: default
- variables:
- max_price_threshold: |
- () => {
- return states['sensor.historic_energy_price_percentiles'].attributes['99th']
- }
- get_yellow_threshold: |
- () => {
- return states['sensor.historic_energy_price_percentiles'].attributes['25th']
- }
- get_orange_threshold: |
- () => {
- return states['sensor.historic_energy_price_percentiles'].attributes['75th']
- }
- get_darkred_threshold: |
- () => {
- return states['sensor.historic_energy_price_percentiles'].attributes['95th']
- }
- card:
- type: custom:apexcharts-card
- graph_span: 132h
- span:
- end: day
- offset: +108h
- apex_config:
- chart:
- height: 200px
- grid:
- show: true
- borderColor: rgb(158, 158, 158)
- strokeDashArray: 2
- annotations:
- position: back
- yaxis:
- - 'y': 0
- y2: ${ get_yellow_threshold() }
- fillColor: rgb(76, 175, 80)
- strokeDashArray: 0
- borderColor: '#00000000'
- - 'y': ${ get_yellow_threshold() }
- y2: ${ get_orange_threshold() }
- fillColor: rgb(255, 193, 7)
- strokeDashArray: 0
- borderColor: '#00000000'
- - 'y': ${ get_orange_threshold() }
- y2: ${ get_darkred_threshold() }
- fillColor: rgb(255, 152, 0)
- strokeDashArray: 0
- borderColor: '#00000000'
- - 'y': ${ get_darkred_threshold() }
- y2: ${ max_price_threshold() }
- fillColor: rgb(244, 67, 54)
- strokeDashArray: 0
- borderColor: '#00000000'
- - 'y': ${ max_price_threshold() }
- y2: 100
- fillColor: rgb(255, 0, 0)
- strokeDashArray: 0
- borderColor: '#00000000'
- header:
- show: true
- title: Elpriser pr. time (DKK/kWh)
- show_states: true
- colorize_states: true
- now:
- label: Nu
- show: true
- color: black
- yaxis:
- - min: '|-0.5|'
- max: '|+0.5|'
- apex_config:
- tickAmount: 4
- forceNiceScale: false
- decimalsInFloat: 1
- series:
- - name: Nu
- entity: sensor.energi_data_service
- color: rgb(33, 150, 243)
- float_precision: 2
- data_generator: |
- return [[new Date(), entity.state]]
- show:
- in_chart: false
- - name: Current
- entity: sensor.energi_data_service
- stroke_width: 3
- float_precision: 2
- type: line
- color: rgb(33, 150, 243)
- extend_to: false
- show:
- in_header: false
- data_generator: |
- var today = entity.attributes.raw_today.map((start, index) => {
- return [new Date(start["hour"]).getTime(), entity.attributes.raw_today[index]["price"]];
- });
- var extradata = entity.attributes.forecast.map((start, index) => {
- return [new Date(start["hour"]).getTime(), entity.attributes.forecast[index]["price"]];
- });
- if (entity.attributes.tomorrow_valid) {
- var tomorrow = entity.attributes.raw_tomorrow.map((start, index) => {
- return [new Date(start["hour"]).getTime(), entity.attributes.raw_tomorrow[index]["price"]];
- });
- today = today.concat(tomorrow)
- }
- return today.concat(extradata)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement