I’m really excited to share my journey of setting up timer control for my Sonoff S26 wall sockets!
I’ve been experimenting with automations, and while my initial attempts were a bit hit or miss, I finally nailed it with some helpful guidance from this community. Here’s how I did it:
My Goal
I have four Sonoff S26 wall sockets, each connected to a mosquito zapper. These are spread across different areas of my house, including two guest bedrooms. My aim was to create a system where I could:
- Select which room’s device to turn on from my Home Assistant dashboard.
- Have the device automatically turn on at sunset and off at sunrise.
- Only activate this schedule when guests are staying, so the devices don’t run unnecessarily.
The Challenge
At first, I was a bit overwhelmed by triggers, conditions, and all the jargon. I knew I could set a schedule directly on the device, but I wanted more control—specifically, the ability to decide when the schedule starts. That’s where Home Assistant’s automation rules came to the rescue!
The Solution
Here’s the step-by-step process that worked for me:
- Identify the Devices: I listed out all my Sonoff S26 sockets in Home Assistant, noting their unique IDs.
- Create Input Boolean Switches: I added input boolean switches for each room. These act as virtual switches in the dashboard, allowing me to enable or disable the mosquito zappers for specific areas.
- Set Up Sunset and Sunrise Sensors: Home Assistant has built-in sensors for sunset and sunrise times, which I used to trigger the automation.
- Write the Automation Rules: I created two rules for each device:
- Turn On: Activates when the input boolean switch is turned on and at sunset.
- Turn Off: Activates when the input boolean switch is turned off or at sunrise.
- Test and Adjust: I tested each rule individually to ensure they worked as expected and made minor adjustments based on real-world performance.
The Result
Now, I can easily manage my mosquito zappers from the Home Assistant dashboard. When guests arrive, I simply enable the switch for their room, and the device takes care of the rest—turning on at sunset and off at sunrise. It’s a simple yet effective setup that saves energy and ensures guests have a comfortable stay.
Tips for Others
- Start Small: If you’re new to automations, tackle one device at a time. It makes troubleshooting easier.
- Use Virtual Switches: They’re incredibly handy for enabling or disabling specific automations without digging into the settings each time.
- Leverage Built-in Sensors: Home Assistant has a wealth of sensors that can simplify your automations, like sunset and sunrise times.
- Community Support: Don’t hesitate to ask for help. The community here is fantastic, and someone has likely faced a similar challenge!
I’m really happy with how this turned out and can’t wait to explore more automation possibilities!
If anyone has tips or alternative approaches, I’d love to hear them! Thanks for reading, and happy automating! ![]()