I’m trying to force my persistence to work for several days already with no luck. May be community could help me to solve a problem.
Here is my items file
String TVStatus "TV Status [%s]" (gDN) { exec="<[/etc/openhab/s-scripts/tv_status.sh:60000:]" }
Number BT_Status_Alex "Alexey is at home [%.1f]" <bluetooth> { exec="<[/etc/openhab/s-scripts/bt_presence_alex.sh:15000:]" }
Number BT_Status_Vika "Victoria is at home [%.1f]" <bluetooth> { exec="<[/etc/openhab/s-scripts/bt_presence_vika.sh:15000:]" }
String Status_Motion "Last Motion [%s]" <camera> { exec="<[/etc/openhab/s-scripts/last_alarm.sh:60000:]" }
Number Radio_Station "Radio" <audio>
Site file:
Frame label="Home Presence" {
Group item=Presence icon="house" {
Text item=BT_Status_Alex icon="boy1"
Text item=BT_Status_Vika icon="child1"
Chart item=BT_Status_Alex period=h refresh=15000
}
}
rrd4j.persist file:
Strategies {
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
everyMinute : "0 * * * * ?"
default = everyChange
}
Items {
* : strategy = everyChange, everyMinute, restoreOnStartup
}
Openhab.cfg
# The name of the default persistence service to use
persistence:default=rrd4j
.....
########################### RRD4J Persistence Service #################################
#
# please note that currently the first archive in each RRD defines the consolidation
# function (e.g. AVERAGE) used by OpenHAB, thus only one consolidation function is
# fully supported
#
# default_numeric and default_other are internally defined defnames and are used as
# defaults when no other defname applies
rrd4j:<defname>.def=[ABSOLUTE|COUNTER|DERIVE|GAUGE],<heartbeat>,[<min>|U],[<max>|U],<step>
rrd4j:<defname>.archives=[AVERAGE|MIN|MAX|LAST|FIRST|TOTAL],<xff>,<steps>,<rows>
rrd4j:<defname>.items=<list of items for this defname>
one of the shell scripts I want to log:
#!/bin/bash
DATE=`date +%H:%M`
if sudo l2ping -c 1 40:40:A7:A1:E5:CB &> /dev/null
then
echo 1
echo $DATE >> /etc/openhab/s-scripts/tempfiles/alex_home_bt.log
if [[ -f /etc/openhab/s-scripts/tempfiles/alex_home_in.ankor ]]
then
echo "ping" &> /dev/null
else
touch /etc/openhab/s-scripts/tempfiles/alex_home_in.ankor
fi
rm /etc/openhab/s-scripts/tempfiles/alex_home_out.ankor &> /dev/null
# stat /etc/openhab/s-scripts/tempfiles/alex_home_in.ankor 2>&1 | grep "Change" | awk '{print substr($0,20,8)}'
else
echo 0
echo $DATE >> /etc/openhab/s-scripts/tempfiles/alex_away_bt.log
if [[ -f /etc/openhab/s-scripts/tempfiles/alex_home_out.ankor ]]
then
echo "ping" &> /dev/null
else
touch /etc/openhab/s-scripts/tempfiles/alex_home_out.ankor
fi
# stat /etc/openhab/s-scripts/tempfiles/alex_home_out.ankor 2>&1 | grep "Change" | awk '{print substr($0,20,8)}'
rm /etc/openhab/s-scripts/tempfiles/alex_home_in.ankor &> /dev/null
fi
I see changes of the items but they are not saving in DB.
Sorry if the questions is stupid…