RRD4J Persistense

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…

You are using rrd4j to store ALL items, however rrd4j does store numeric values!
If you are trying to use the stored value in order to populate the items after a system restart I’d suggest to use MapDB which is made for that.
What you are trying to log with the posted script, I don’t understand.

Thanks for the prompt answer. I’m trying to log my home presence by phone.
echo 1 - if I’m at home
echo 2 - if I’m away

I suppose as it’s numeric value and item is Number - it should be stored, I also tried mysql persistence with a same result - db creating but values are not stored. I should have missed something, but can’t figure out what exactly.

Try commenting out the rrd4j config parameters in openHAB.cfg and see if that matters a difference. The Number Item’s should be persisting.

How are you verifying that the Item states are not being saved by rrd4j?

I missed that spot he uncommented the description lines for the rrd4j archives without changing them into a usefull manner.
Good catch.

Everything was solved by reinstalling openhab from scratch, possibly it was a permission issue.