Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type: custom:apexcharts-card
- card_mod:
- style: |
- ha-card {
- --ha-card-border-radius: 20px;
- --ha-card-background: rgba(222, 255, 255, 0.02);
- }
- show:
- last_updated: false
- experimental:
- color_threshold: true
- apex_config:
- chart:
- height: 320px
- xaxis:
- type: datetime
- labels:
- datetimeFormatter:
- hour: H
- tickPlacement: 'on'
- graph_span: 28h
- span:
- start: hour
- offset: '-1h'
- now:
- show: true
- label: Nu
- header:
- title: El-priser pr. time(Kr./kWh)+Abn.(80,73kr./mdr.)
- show: true
- show_states: true
- colorize_states: true
- yaxis:
- - min: ~0
- max: '|+0.0|'
- decimals: 2
- apex_config:
- max: auto
- tickAmount: 5
- series:
- - entity: sensor.energi_data_service
- color_threshold:
- - value: -1
- color: darkgreen
- opacity: 0.7
- - value: 1
- color: lightgreen
- - value: 2
- color: green
- opacity: 0.7
- - value: 2.5
- color: red
- - value: 3
- color: darkred
- name: Lige nu
- type: area
- curve: smooth
- show:
- in_header: false
- header_color_threshold: true
- in_chart: true
- stroke_width: 2
- float_precision: 2
- unit: ' kr'
- 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