Why do people keep asking how to reinvent the wheel ?
Because they’re too lazy or impatient to read up first what’s already available.
Apart from that capturing a thread is a bad habit, you should have searched the forum first
How to ask a good question / Help Us Help You - Tutorials & Examples - openHAB Community
You would have found many references to Amanda and posts to answer your question.