Sourajit, i do not know if what you want is a requirement on your project or not, but you can always use a smartphone presence if you want to check if a user is at home or not. Android is easier compared to iphone but you can use both smartphones.
I will just put my examples regarding on weather temperature data on RRDJ4 persistence:
items file:
Group Weather_Chart <chart>
Group Weather "Weather" <temperature>
Number Weather_Temperature "Sıcaklık [%.1f °C]" <temperature> (Weather, Weather_Chart) [ "CurrentTemperature" ] { channel = "yahooweather:weather:83fbd0f2:temperature" }
Number Weather_Temp_Max "Bugünkü En Yüksek [%.1f °C]" <temperature> (Weather, Weather_Chart)
Number Weather_Temp_Min "Bugünkü En Düşük [%.1f °C]" <temperature> (Weather, Weather_Chart)
Number Weather_Chart_Period "Grafik Periyodu" <chart>
Number YahooWeatherCode "Bugün [MAP(yahoo_weather_code.map):%s]" <yahoo_weather> (Weather) { http="<[weatherCache:60000:XSLT(yahoo_weather_code.xsl)]"}
DateTime Weather_LastUpdate "Son Güncelleme [%1$ta %1$tR]" <clock>
sitemap file:
Text item=Weather_Temperature valuecolor=[Weather_LastUpdate=="NULL"="lightgray",Weather_LastUpdate>90="lightgray",>25="orange",>15="green",>5="orange",<=5="blue"] {
Frame {
Text item=Weather_Temp_Max valuecolor=[>25="orange",>15="green",>5="orange",<=5="blue"]
Text item=Weather_Temp_Min valuecolor=[>25="orange",>15="green",>5="orange",<=5="blue"]
Text item=Weather_LastUpdate visibility=[Weather_LastUpdate>30] valuecolor=[Weather_LastUpdate>120="orange", Weather_LastUpdate>300="red"]
}
Frame {
Switch item=Weather_Chart_Period label="Grafik Periyodu" icon="chart" mappings=[0="Hour", 1="Day", 2="Week"]
Chart item=Weather_Chart period=h refresh=600 visibility=[Weather_Chart_Period==0, Weather_Chart_Period=="NULL"]
Chart item=Weather_Chart period=D refresh=3600 visibility=[Weather_Chart_Period==1]
Chart item=Weather_Chart period=W refresh=3600 visibility=[Weather_Chart_Period==2]
}
rrdj4.persist file:
// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
everyMinute : "0 * * * * ?"
}
Items {
// let's only store temperature values in rrd
Weather_Chart* : strategy = everyMinute, restoreOnStartup
}
// vim: syntax=Xtend
And please check page: https://github.com/openhab/openhab1-addons/wiki/persistence for Persistence Extensions in Scripts and Rules. Please note that i use RRDJ4 for persistence database. Hope this will be of help.
You can use REST API to get histocial values from persistence database, whethet you use rrdj4 or any other database, like:
{
"name": "Weather_Temperature",
"datapoints": "360",
"data": [
{
"time": 1495389840000,
"state": "20"
},
{
"time": 1495390080000,
"state": "20"
},
{
"time": 1495390320000,
"state": "20"
},
{
"time": 1495390560000,
"state": "20"
},