Skip to content

Commit eee8baa

Browse files
committed
add docs for period: auto
1 parent 82c266a commit eee8baa

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

readme.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,18 +192,37 @@ entities:
192192
193193
The option `auto` makes the period relative to the currently visible time range. It picks the longest period, such that there are at least 100 datapoints in screen.
194194

195-
#### for entities with state_class=measurement (normal sensors, like temperature)
195+
#### for entities with state_class=total (such as utility meters)
196196

197197
```yaml
198198
type: custom:plotly-graph
199199
entities:
200200
- entity: sensor.temperature
201-
statistic: max # `min`, `mean` of `max`
202-
# for entities with state_class=total (such as utility meters):
203201
statistic: state # `state` or `sum`
204-
205202
period: 5minute # `5minute`, `hour`, `day`, `week`, `month`, `auto` # `auto` varies the period depending on the zoom level
203+
```
206204
205+
#### automatic period
206+
207+
The period will automatically adapt to the visible range.
208+
209+
```yaml
210+
type: custom:plotly-graph
211+
entities:
212+
- entity: sensor.temperature
213+
statistic: mean
214+
period: auto
215+
```
216+
217+
equivalent to:
218+
219+
```yaml
220+
period:
221+
0s: 5minute
222+
1d: hour
223+
7d: day
224+
28d: week
225+
12M: month # note uppercase M
207226
```
208227
209228
#### step function for auto period
@@ -214,10 +233,10 @@ entities:
214233
- entity: sensor.temperature
215234
statistic: mean
216235
period:
217-
0: 5minute
236+
0s: 5minute
218237
24h: hour # when the visible range is ≥ 1 day, use the `hour` period
219238
7d: day # from 7 days on, use `day`
220-
# 6M: week # not yet supported in HA
239+
6M: week # from 6 months on, use weeks. Note Uppercase M! (lower case m means minutes)
221240
1y: month # from 1 year on, use `month
222241
```
223242

0 commit comments

Comments
 (0)