Smart Lighting Automation: Daytime-Based Adjustments with Vera

Hey everyone, I’ve been tinkering with my smart lighting setup and wanted to share my journey and some tips that might help others. I’ve got a hallway with GE dimmer switches controlled by a Leviton scene controller, all integrated through Vera. My goal was to automate the lighting levels based on the time of day without dedicating multiple buttons on my controller—essentially, one button for all scenarios.

Here’s what I envisioned: during the day, the lights should be at full brightness for optimal visibility. In the evening, a dimmed setting would create a cozy atmosphere, and during the night, a very low level for minimal disturbance. I tried writing some LUA code to achieve this, but it wasn’t working as expected. After some troubleshooting, I realized the issue was with how the time intervals were calculated. I adjusted the code to better handle the time transitions and added a failsafe to ensure full brightness if the lights were already on.

The solution involved setting specific time thresholds (6 AM, 6 PM, and 9 PM) and using Vera’s scene automation to adjust the dimmer levels accordingly. It’s been working smoothly for a week now, and I couldn’t be happier with how it enhances my daily routine.

If anyone else is looking to implement similar automation, I’d recommend starting with simple time-based rules and gradually adding more complexity. Also, don’t hesitate to reach out to the community for help—there’s always someone willing to lend a hand!

Happy automating! :rocket: