DIY Smart Switch: Repurposing an Old Fire Alarm Button

Hi everyone, I wanted to share a fun DIY project I recently completed. I stumbled upon an old fire alarm button that had been discarded, and I thought it would be a great opportunity to repurpose it into a smart home device. Using an ESP8266 module with the Arduino framework, I transformed this old button into a fully functional WiFi-enabled switch for my smart home setup. This project was not only a great way to recycle but also a practical solution to a common problem I faced with my energy management system.

The改造过程 involved replacing the original electronics with a new pushbutton while retaining the original LED for visual feedback. The switch now serves as a convenient way for my visitors to turn off all electronics when leaving the house, a feature I hadn’t been able to implement before. I integrated this switch with my OpenHAB system, allowing it to work seamlessly with other smart devices in my home.

The code I developed for this project includes a rule that toggles the state of connected devices when the button is pressed. This was a bit tricky at first, especially ensuring that the button resets correctly after each press, but with some testing and adjustments, it now works flawlessly. I also incorporated MQTT protocol for communication, which has proven to be reliable and efficient.

One of the challenges I faced was ensuring the switch could handle multiple press actions without errors. After some research and tweaking, I managed to implement a robust solution that distinguishes between single and double presses, allowing for more versatile functionality. This switch now serves as a handy ‘visitor mode’ button, ensuring that all electronics are turned off when guests leave, without requiring them to use the OpenHAB app or any other setup.

I’m really happy with how this project turned out. It not only solved a specific problem in my smart home setup but also gave me a deeper understanding of how to integrate custom hardware with existing smart home ecosystems. I’d love to hear if anyone else has undertaken similar DIY projects or has suggestions for further improvements!

Best regards,
Dominic