OK, thanks. I know that I could use mqtt and Homeseer also supports it. I’ll try to keep OH intallation as clean as possible so the text file method is easier for me. And it is just a temporary solution until I install influxDB+Grafana.
I have to say that I’m extremely happy about the support I have received in this forum. I’m still on my learning curve but all the efforts I have spent are going to right direction. OH is extremely powerful and I have realized that I can do lot more things in a much better way than in Homeseer.
I just solved writing to a file in a relatively generic way.
Create /etc/openhab/scripts/write-file.sh
#simple append
#echo "$1,$2,foo" >> /etc/openhab/html/test.txt;
# prepend
# requires the $1.txt file to be seeded first or...just run this script twice
printf '%s\n%s\n' "$2" "$(cat /etc/openhab/html/$1.txt)" >/etc/openhab/html/$1.txt
Set permissions on the shell script
sudo dos2unix write-file.sh # windows crlf will cause problems if edited with drive mapping from Windows