how can i read this file from a rules or items can also be a script.
I want to calculate a value from the file at what.
Thanks for your help, sorry for my bad English.
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
2
Hi
What would you like to do with the contents of the file?
It’s easy enough to use a CAT command in a Exec Binding thing to push the contents of the file into an openHAB2 Item.
cat \var\lib\openhab2\log_results.txt
You could even try to use the Regex feature to filter it (this isn’t something I’ve mastered yet).
It’s possible to trigger the Thing on demand, or set a polling interval.
Much like how I used the Exec binding to pull the results of the APCaccess command into openHAB2.
(Read to the end, as Rich gives some excellent advice on how to handle the results)
There is also the Log Reader binding which can follow the file, assuming it’s constantly changing, and assign lines that match a given regular expression to an Item.