I am trying to display electricity forecasts from Amber Electricity (Australia). However it is not displaying the forecast datetimes correctly.
Looking for some help. I’m sure it is something simple I am missing but cannot figure it out.
I am a noob wrt ApexCharts and JavaScript.
This is the sensor data;
sensor.amberelectricity_general_forecast
yaml
state_class: measurement
forecasts:
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T15:30:00+10:00'
per_kwh: 0.25
spot_per_kwh: 0.1
start_time: '2022-02-14T05:00:01+00:00'
end_time: '2022-02-14T05:30:00+00:00'
renewables: 35
spike_status: none
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T16:00:00+10:00'
per_kwh: 0.26
spot_per_kwh: 0.11
start_time: '2022-02-14T05:30:01+00:00'
end_time: '2022-02-14T06:00:00+00:00'
renewables: 34
spike_status: none
range_min: 0.08
range_max: 0.3
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T16:30:00+10:00'
per_kwh: 0.27
spot_per_kwh: 0.12
start_time: '2022-02-14T06:00:01+00:00'
end_time: '2022-02-14T06:30:00+00:00'
renewables: 32
spike_status: none
range_min: 0.08
range_max: 0.35
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T17:00:00+10:00'
per_kwh: 0.26
spot_per_kwh: 0.11
start_time: '2022-02-14T06:30:01+00:00'
end_time: '2022-02-14T07:00:00+00:00'
renewables: 30
spike_status: none
range_min: 0.08
range_max: 0.25
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T17:30:00+10:00'
per_kwh: 0.27
spot_per_kwh: 0.12
start_time: '2022-02-14T07:00:01+00:00'
end_time: '2022-02-14T07:30:00+00:00'
renewables: 28
spike_status: none
range_min: 0.08
range_max: 0.24
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T18:00:00+10:00'
per_kwh: 0.27
spot_per_kwh: 0.12
start_time: '2022-02-14T07:30:01+00:00'
end_time: '2022-02-14T08:00:00+00:00'
renewables: 26
spike_status: none
range_min: 0.09
range_max: 0.23
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T18:30:00+10:00'
per_kwh: 0.29
spot_per_kwh: 0.15
start_time: '2022-02-14T08:00:01+00:00'
end_time: '2022-02-14T08:30:00+00:00'
renewables: 23
spike_status: none
range_min: 0.11
range_max: 0.3
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T19:00:00+10:00'
per_kwh: 0.29
spot_per_kwh: 0.15
start_time: '2022-02-14T08:30:01+00:00'
end_time: '2022-02-14T09:00:00+00:00'
renewables: 20
spike_status: none
range_min: 0.1
range_max: 0.3
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T19:30:00+10:00'
per_kwh: 0.34
spot_per_kwh: 0.19
start_time: '2022-02-14T09:00:01+00:00'
end_time: '2022-02-14T09:30:00+00:00'
renewables: 19
spike_status: none
range_min: 0.11
range_max: 0.3
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T20:00:00+10:00'
per_kwh: 0.35
spot_per_kwh: 0.2
start_time: '2022-02-14T09:30:01+00:00'
end_time: '2022-02-14T10:00:00+00:00'
renewables: 19
spike_status: none
range_min: 0.11
range_max: 0.3
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T20:30:00+10:00'
per_kwh: 0.28
spot_per_kwh: 0.13
start_time: '2022-02-14T10:00:01+00:00'
end_time: '2022-02-14T10:30:00+00:00'
renewables: 19
spike_status: none
range_min: 0.1
range_max: 0.3
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T21:00:00+10:00'
per_kwh: 0.27
spot_per_kwh: 0.12
start_time: '2022-02-14T10:30:01+00:00'
end_time: '2022-02-14T11:00:00+00:00'
renewables: 20
spike_status: none
range_min: 0.09
range_max: 0.3
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T21:30:00+10:00'
per_kwh: 0.26
spot_per_kwh: 0.11
start_time: '2022-02-14T11:00:01+00:00'
end_time: '2022-02-14T11:30:00+00:00'
renewables: 19
spike_status: none
range_min: 0.08
range_max: 0.3
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T22:00:00+10:00'
per_kwh: 0.26
spot_per_kwh: 0.11
start_time: '2022-02-14T11:30:01+00:00'
end_time: '2022-02-14T12:00:00+00:00'
renewables: 19
spike_status: none
range_min: 0.08
range_max: 0.26
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T22:30:00+10:00'
per_kwh: 0.25
spot_per_kwh: 0.11
start_time: '2022-02-14T12:00:01+00:00'
end_time: '2022-02-14T12:30:00+00:00'
renewables: 19
spike_status: none
range_min: 0.08
range_max: 0.26
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T23:00:00+10:00'
per_kwh: 0.24
spot_per_kwh: 0.1
start_time: '2022-02-14T12:30:01+00:00'
end_time: '2022-02-14T13:00:00+00:00'
renewables: 18
spike_status: none
range_min: 0.08
range_max: 0.14
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-14T23:30:00+10:00'
per_kwh: 0.25
spot_per_kwh: 0.1
start_time: '2022-02-14T13:00:01+00:00'
end_time: '2022-02-14T13:30:00+00:00'
renewables: 16
spike_status: none
range_min: 0.08
range_max: 0.15
- duration: 30
date: '2022-02-14'
nem_date: '2022-02-15T00:00:00+10:00'
per_kwh: 0.25
spot_per_kwh: 0.11
start_time: '2022-02-14T13:30:01+00:00'
end_time: '2022-02-14T14:00:00+00:00'
renewables: 15
spike_status: none
range_min: 0.08
range_max: 0.18
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T00:30:00+10:00'
per_kwh: 0.25
spot_per_kwh: 0.1
start_time: '2022-02-14T14:00:01+00:00'
end_time: '2022-02-14T14:30:00+00:00'
renewables: 14
spike_status: none
range_min: 0.08
range_max: 0.13
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T01:00:00+10:00'
per_kwh: 0.24
spot_per_kwh: 0.1
start_time: '2022-02-14T14:30:01+00:00'
end_time: '2022-02-14T15:00:00+00:00'
renewables: 14
spike_status: none
range_min: 0.08
range_max: 0.13
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T01:30:00+10:00'
per_kwh: 0.24
spot_per_kwh: 0.09
start_time: '2022-02-14T15:00:01+00:00'
end_time: '2022-02-14T15:30:00+00:00'
renewables: 14
spike_status: none
range_min: 0.07
range_max: 0.11
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T02:00:00+10:00'
per_kwh: 0.23
spot_per_kwh: 0.09
start_time: '2022-02-14T15:30:01+00:00'
end_time: '2022-02-14T16:00:00+00:00'
renewables: 14
spike_status: none
range_min: 0.05
range_max: 0.1
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T02:30:00+10:00'
per_kwh: 0.23
spot_per_kwh: 0.08
start_time: '2022-02-14T16:00:01+00:00'
end_time: '2022-02-14T16:30:00+00:00'
renewables: 15
spike_status: none
range_min: 0.05
range_max: 0.11
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T03:00:00+10:00'
per_kwh: 0.23
spot_per_kwh: 0.08
start_time: '2022-02-14T16:30:01+00:00'
end_time: '2022-02-14T17:00:00+00:00'
renewables: 15
spike_status: none
range_min: 0.02
range_max: 0.1
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T03:30:00+10:00'
per_kwh: 0.23
spot_per_kwh: 0.08
start_time: '2022-02-14T17:00:01+00:00'
end_time: '2022-02-14T17:30:00+00:00'
renewables: 15
spike_status: none
range_min: 0.02
range_max: 0.1
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T04:00:00+10:00'
per_kwh: 0.23
spot_per_kwh: 0.08
start_time: '2022-02-14T17:30:01+00:00'
end_time: '2022-02-14T18:00:00+00:00'
renewables: 15
spike_status: none
range_min: 0.02
range_max: 0.11
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T04:30:00+10:00'
per_kwh: 0.23
spot_per_kwh: 0.08
start_time: '2022-02-14T18:00:01+00:00'
end_time: '2022-02-14T18:30:00+00:00'
renewables: 14
spike_status: none
range_min: 0.02
range_max: 0.1
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T05:00:00+10:00'
per_kwh: 0.23
spot_per_kwh: 0.08
start_time: '2022-02-14T18:30:01+00:00'
end_time: '2022-02-14T19:00:00+00:00'
renewables: 14
spike_status: none
range_min: 0.04
range_max: 0.11
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T05:30:00+10:00'
per_kwh: 0.25
spot_per_kwh: 0.1
start_time: '2022-02-14T19:00:01+00:00'
end_time: '2022-02-14T19:30:00+00:00'
renewables: 13
spike_status: none
range_min: 0.07
range_max: 0.13
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T06:00:00+10:00'
per_kwh: 0.25
spot_per_kwh: 0.11
start_time: '2022-02-14T19:30:01+00:00'
end_time: '2022-02-14T20:00:00+00:00'
renewables: 12
spike_status: none
range_min: 0.08
range_max: 0.16
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T06:30:00+10:00'
per_kwh: 0.28
spot_per_kwh: 0.13
start_time: '2022-02-14T20:00:01+00:00'
end_time: '2022-02-14T20:30:00+00:00'
renewables: 12
spike_status: none
range_min: 0.09
range_max: 0.3
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T07:00:00+10:00'
per_kwh: 0.27
spot_per_kwh: 0.12
start_time: '2022-02-14T20:30:01+00:00'
end_time: '2022-02-14T21:00:00+00:00'
renewables: 17
spike_status: none
range_min: 0.08
range_max: 0.3
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T07:30:00+10:00'
per_kwh: 0.26
spot_per_kwh: 0.11
start_time: '2022-02-14T21:00:01+00:00'
end_time: '2022-02-14T21:30:00+00:00'
renewables: 22
spike_status: none
range_min: 0.08
range_max: 0.16
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T08:00:00+10:00'
per_kwh: 0.24
spot_per_kwh: 0.09
start_time: '2022-02-14T21:30:01+00:00'
end_time: '2022-02-14T22:00:00+00:00'
renewables: 28
spike_status: none
range_min: 0.07
range_max: 0.14
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T08:30:00+10:00'
per_kwh: 0.24
spot_per_kwh: 0.09
start_time: '2022-02-14T22:00:01+00:00'
end_time: '2022-02-14T22:30:00+00:00'
renewables: 33
spike_status: none
range_min: 0.06
range_max: 0.14
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T09:00:00+10:00'
per_kwh: 0.23
spot_per_kwh: 0.08
start_time: '2022-02-14T22:30:01+00:00'
end_time: '2022-02-14T23:00:00+00:00'
renewables: 37
spike_status: none
range_min: 0.05
range_max: 0.12
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T09:30:00+10:00'
per_kwh: 0.23
spot_per_kwh: 0.08
start_time: '2022-02-14T23:00:01+00:00'
end_time: '2022-02-14T23:30:00+00:00'
renewables: 40
spike_status: none
range_min: 0.06
range_max: 0.12
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T10:00:00+10:00'
per_kwh: 0.22
spot_per_kwh: 0.08
start_time: '2022-02-14T23:30:01+00:00'
end_time: '2022-02-15T00:00:00+00:00'
renewables: 43
spike_status: none
range_min: 0.03
range_max: 0.1
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T10:30:00+10:00'
per_kwh: 0.22
spot_per_kwh: 0.07
start_time: '2022-02-15T00:00:01+00:00'
end_time: '2022-02-15T00:30:00+00:00'
renewables: 44
spike_status: none
range_min: 0.03
range_max: 0.09
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T11:00:00+10:00'
per_kwh: 0.22
spot_per_kwh: 0.07
start_time: '2022-02-15T00:30:01+00:00'
end_time: '2022-02-15T01:00:00+00:00'
renewables: 45
spike_status: none
range_min: 0.03
range_max: 0.09
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T11:30:00+10:00'
per_kwh: 0.22
spot_per_kwh: 0.07
start_time: '2022-02-15T01:00:01+00:00'
end_time: '2022-02-15T01:30:00+00:00'
renewables: 46
spike_status: none
range_min: 0.03
range_max: 0.09
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T12:00:00+10:00'
per_kwh: 0.21
spot_per_kwh: 0.07
start_time: '2022-02-15T01:30:01+00:00'
end_time: '2022-02-15T02:00:00+00:00'
renewables: 45
spike_status: none
range_min: 0.04
range_max: 0.09
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T12:30:00+10:00'
per_kwh: 0.22
spot_per_kwh: 0.07
start_time: '2022-02-15T02:00:01+00:00'
end_time: '2022-02-15T02:30:00+00:00'
renewables: 43
spike_status: none
range_min: 0.05
range_max: 0.1
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T13:00:00+10:00'
per_kwh: 0.23
spot_per_kwh: 0.08
start_time: '2022-02-15T02:30:01+00:00'
end_time: '2022-02-15T03:00:00+00:00'
renewables: 42
spike_status: none
range_min: 0.05
range_max: 0.12
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T13:30:00+10:00'
per_kwh: 0.24
spot_per_kwh: 0.09
start_time: '2022-02-15T03:00:01+00:00'
end_time: '2022-02-15T03:30:00+00:00'
renewables: 41
spike_status: none
range_min: 0.06
range_max: 0.15
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T14:00:00+10:00'
per_kwh: 0.24
spot_per_kwh: 0.09
start_time: '2022-02-15T03:30:01+00:00'
end_time: '2022-02-15T04:00:00+00:00'
renewables: 40
spike_status: none
range_min: 0.07
range_max: 0.21
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T14:30:00+10:00'
per_kwh: 0.25
spot_per_kwh: 0.1
start_time: '2022-02-15T04:00:01+00:00'
end_time: '2022-02-15T04:30:00+00:00'
renewables: 41
spike_status: none
range_min: 0.07
range_max: 0.21
- duration: 30
date: '2022-02-15'
nem_date: '2022-02-15T15:00:00+10:00'
per_kwh: 0.25
spot_per_kwh: 0.1
start_time: '2022-02-15T04:30:01+00:00'
end_time: '2022-02-15T05:00:00+00:00'
renewables: 40
spike_status: none
range_min: 0.07
range_max: 0.23
channel_type: general
unit_of_measurement: $/kWh
attribution: Data provided by Amber Electric
icon: mdi:transmission-tower
friendly_name: AmberElectricity - General Forecast
my card config yaml
type: custom:apexcharts-card
header:
show: true
title: Amber Electricty Forecast
show_states: true
colorize_states: true
series:
- entity: sensor.amberelectricity_general_forecast
float_precision: 2
data_generator: |
return entity.attributes.forecasts.map((entry) => {
return [new Date(entry.nem_date), entry.per_kwh];
});