I’ve talked to a few people about my home automation application. And through that process a few people have request that I make a thread that talks about what I did, post the code, etc.
I’m not a coder so if anyone has any suggestions on how to clean this up I’m all ears!
Description: This application allows me to set 6 total modes based on motion (or non motion), times, and in one case if a door is open or closed.
- Morning: Set if motion occurs after X time and not WFH mode
- Home: Set if motion occurs after X time and not WFH mode
- WFH: Set if motion occurs in office between X and Y time
- Away: Set if no motion occurs before X time
- One Still Awake: Set if motion in bedroom and bedroom door is closed
- Night: Set if “One Still Awake” Mode and no motion (except Bedroom) for X time
Each mode has a corresponding “Hello, Home” phrase that sets it (and expects the phrase to set the mode). I kept having an issue where I would be watching TV and the house would go to “night” even though I was downstairs because I didn’t move around a lot. I set a warning hue light that turns a certain color X mins before the night mode hits. If the house goes to night or motion occurs the hue light resets to previous settings.
Disclaimer: I wrote this app for my own personal use. I didn’t write it for mass use, hint why it’s not super flexible. However, if people have request, hints, desires, let me know and I’ll see what I can do.
CODE: Get the code here.