There are plenty of places where people paste their screenshots and we see graphs but above them there are buttons to view data for past hours, days, weeks etc. This tutorial shows how to do it.
In order to reach the following effect:
you must do:
- All items that you would like show must be under one Group. You show on the graph this Group
- Set rrd4j persistency for defined Group.
- Chart with expected period of time will be shown when press to the right button on dummy switch
My example:
Items file
1 2 3 4 5 6 7 |
Group gTemp_Outdoor (All) Number digoo_temp "Temperatura na zewnątrz Digoo [%.1f °C ]" (gTemp_Outdoor) {channel="mqtt:topic:mything:digoo_weather_temp" } Number Airly_Temperature "Temperatura na zewnątrz Airly [%.1f °C]" (Weather,gTemp_Outdoor,Temperature_AVG) {http="<[airly:100000:JSONPATH($.current.values[5].value)]"} Number:Temperature HTP_Temperature "Temperatura na zewnątrz Mi [%.1f °C ]" (gGW_Sensor1,gTemp_Outdoor,Temperature_AVG) { channel="mihome:sensor_weather_v1:04cf8cac4304:158d00053dfbfc:temperature" } //dummy item: Number GraphRange |
Persistance file
1 |
gTemp_Outdoor : strategy = everyChange |
sitemap file
1 2 3 4 5 6 7 8 9 10 11 12 |
Frame label="Pogoda" icon="humidity"{ Text item=Temperature_AVG { Group item=Temperature_AVG Text item=digoo_temp Switch item=GraphRange label="Time:" mappings=[0="1H", 1="24h", 2="48h", 3="W", 4="M"] Chart item=gTemp_Outdoor period=h refresh=6000 visibility=[GraphRange==0, GraphRange=="Uninitialized"] Chart item=gTemp_Outdoor period=D refresh=6000 visibility=[GraphRange==1] Chart item=gTemp_Outdoor period=2D refresh=6000 visibility=[GraphRange==2] Chart item=gTemp_Outdoor period=W refresh=6000 visibility=[GraphRange==3] Chart item=gTemp_Outdoor period=M refresh=6000 visibility=[GraphRange==4] } } |
It is not my idea, source from community here.
Easy and clear.