Skip to content

ApexChartsTodayHourlyValues

Luis Miranda edited this page Feb 22, 2023 · 12 revisions

ApexChart: Today's hourly values

Plot the hourly values for an entire day using the values stored in each sensor's day_hours attribute.

Graph showing day's hourly values

type: custom:apexcharts-card
update_interval: 30m
now:
  show: true
span:
  start: day
graph_span: 24h
all_series_config:
  stroke_width: 1
  type: line
  curve: stepline
  group_by:
    func: avg
    duration: 1h
  show:
    extremas: true
    legend_value: false
  data_generator: >
    return ((hs) => hs.map((price, hour) => [ new Date(new
    Date().setHours(hour, 0, 0, 0)), price ]))(entity.attributes.day_hours)
series:
  - entity: sensor.omie_spot_price_pt
    name: Hourly price
  - entity: sensor.omie_adjustment_price_pt
    name: Hourly adjustment
yaxis:
  - id: price
    align_to: 10