I have built a smart temperature sensor which I am using for my spider enclosure. It reads temperature & humidity, and reports readins via MQTT. The MQTT messages are integrated into home assistant as sensors, and in turn may trigger the lamp depending on the temperature inside the enclosure. The lamp is heating the enclosure, so once its warm/hot enough, the lamp will be turned off.
Full code + 3D print case + wiring in the git repo: