Automation and safety of buildings