power schedule as 'type: column'. This way you only see the power schedule on hours where it is not zero. for a cleaner look.
type: custom:apexcharts-card
header:
show: true
title: Today
show_states: true
colorize_states: true
span:
start: day
now:
show: true
yaxis:
- id: power
decimals: 0
opposite: true
- id: price
decimals: 2
series:
- entity: sensor.sessy_XXXX_power_schedule
yaxis_id: power
name: Power Schedule
type: column
curve: stepline
data_generator: |
let hours = [];
for(var i = 0; i < 24; i++){ hours.push(i); }
let date = new Date().getTime();
let dateindex = new Date(date).toISOString().split("T")[0];
return hours.map((hour, index) => {
let date = new Date(dateindex).setHours(hour,0,0);
return [date, entity.attributes[dateindex][index]];
});
- entity: sensor.sessy_XXXX_energy_price
yaxis_id: price
name: Energy Price
curve: stepline
float_precision: 5
data_generator: |
let hours = [];
for(var i = 0; i < 24; i++){ hours.push(i); }
let date = new Date().getTime();
let dateindex = new Date(date).toISOString().split("T")[0];
return hours.map((hour, index) => {
let date = new Date(dateindex).setHours(hour,0,0);
return [date, entity.attributes[dateindex][index]];
});```
power schedule as 'type: column'. This way you only see the power schedule on hours where it is not zero. for a cleaner look.