forked from rgc99/irrigation_unlimited
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtimeline_chart.yaml
45 lines (45 loc) · 985 Bytes
/
timeline_chart.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
type: custom:apexcharts-card
header:
show: true
title: Watering timeline
show_states: false
graph_span: 10d
span:
start: day
offset: '-7day'
all_series_config:
type: column
group_by:
duration: 1d
func: sum
fill: 'null'
show:
as_duration: minute
now:
show: true
label: Today
series:
- entity: binary_sensor.irrigation_unlimited_c1_z1
data_generator: |
return entity.attributes.timeline.map((item) => {
const sd = new Date(item.start);
const ed = new Date(item.end);
return [sd, (ed - sd) / 60000];
});
- entity: binary_sensor.irrigation_unlimited_c1_z2
data_generator: |
return entity.attributes.timeline.map((item) => {
const sd = new Date(item.start);
const ed = new Date(item.end);
return [sd, (ed - sd) / 60000];
});
yaxis:
- decimals: 0
apex_config:
title:
text: minutes
apex_config:
tooltip:
enabled: true
x:
format: dd MMM