Fire danger when using IoT components
Depending on where you live there should be a set of regulations governing the proper installation of electrical equipment. In the US that is the National Electric Code. Find the corresponding document for your region and follow all of its rules.

When purchasing equipment, be sure to buy devices that have been safety certified as necessary in your region. In the US, as Bimpelrekkie said, that is typically an Underwriter's Laboratory certification.