My ceiling fans (and connected lights) are my first smart home devices. I don't have any hubs or HomeAssistant/NodeRed/etc to control things. I modified an existing firmware to allow for a more 'web hook' interface to the lights/fan toggles. By default MQTT is used for inter-device communication.
Flash FirmwareDownload the project source. If you run MQTT, you don't need my branch to the older/legacy Sonoff-MQTT-OTA-Arduino, instead you would likely want to start with Sonoff-Tasmota, or any of the others. Once downloaded, modify user_config.h to set REMOTE_SONOFF to the IP address of your sonoff. Also set WIFI access point definitions. Compile and flash. Details on flashing are outside of the scope of this project.
BreadboardBefore you try jamming it in a project case, or solder some perfboard; test everything on a breadboard first. I just cut off the jumper wire pins and twisted the wires around the terminals of the buttons. Next time I will use slide on connectors.
Box it upI originally wanted to jam it in the wall where the light switch is. I figured a two gang box was easier. The diameter of the arcade style buttons were close enough to the punch-out holes the box already had it in. I didn't have to drill anything. I should have secured the power supply wire more, just in case it gets pulled hard or stepped on.
Try putting it near the door, so you can press the button when you walk in.
ConclusionThe next iteration will include an ESP8266 board with more IO to accommodate a PIR (Passive Infrared, "motion") sensor. Additional light, temperature, and humidity sensors would also be ideal. Hopefully, I will add Home Assistant to the mix by then.
Comments