Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.4 kB
2
Indexable
Never
type: custom:apexcharts-card
experimental:
  color_threshold: true
graph_span: 48h
update_interval: 10m
apex_config:
  stroke:
    width: 2
header:
  show_states: true
  show: true
span:
  start: day
now:
  show: true
  label: Nu
series:
  - entity: sensor.nordpool_kwh_se3_sek_3_10_0
    yaxis_id: power
    group_by:
      duration: 1h
      func: avg
    extend_to: false
    color: gray
    name: Effekt
    type: line
    curve: stepline
    float_precision: 0
    show:
      in_header: true
  - entity: sensor.nordpool_kwh_se3_sek_3_10_0
    name: Elpris inkl. allt
    type: line
    curve: stepline
    yaxis_id: sek
    extend_to: false
    float_precision: 2
    show:
      in_header: before_now
    data_generator: |
      var today = entity.attributes.raw_today.map((start, index) => {
        return [new Date(start["start"]).getTime(), entity.attributes.raw_today[index]["value"]];
      });
      var tomorrow = []
      if (entity.attributes.raw_tomorrow) {
        tomorrow = entity.attributes.raw_tomorrow.map((start, index) => {
          return [new Date(start["start"]).getTime(), entity.attributes.raw_tomorrow[index]["value"]];
        });
      }
      var values = today.concat(tomorrow).map(v => {
        return [v[0],v[1]+0.783 /* Nätavgift och skatter */+0.1 /* Påslag */];
      });
      return values;
    color_threshold:
      - value: 0.6
        color: blue
      - value: 0.8
        color: '#63ff00'
      - value: 1.1
        color: '#d6ff00'
      - value: 1.4
        color: '#ffff00'
      - value: 1.7
        color: '#ffc100'
      - value: 2.1
        color: '#ff0000'
  - entity: sensor.nordpool_kwh_se3_sek_3_10_0
    name: Elpris Nordpool
    type: line
    curve: stepline
    yaxis_id: sek
    extend_to: false
    show:
      in_header: before_now
      hidden_by_default: true
    float_precision: 2
    data_generator: |
      var today = entity.attributes.raw_today.map((start, index) => {
        return [new Date(start["start"]).getTime(), entity.attributes.raw_today[index]["value"]];
      });
      var tomorrow = []
      if (entity.attributes.raw_tomorrow) {
        tomorrow = entity.attributes.raw_tomorrow.map((start, index) => {
          return [new Date(start["start"]).getTime(), entity.attributes.raw_tomorrow[index]["value"]];
        });
      }
      return today.concat(tomorrow);
yaxis:
  - id: sek
    decimals: 2
  - id: power
    decimals: 0