Replaced whole multi-threaded code with something build on FHEM's DevIo. Works nicely and seems to be more robust.

Also switched to stored readings through proper functions in order to trigger notifications.