A Smart Cyber-physical Alarm System and its Application for Assisted Living