Initial import from fhem-code