Need idea... trigger for sleep mode

Hi guys,
I read here a few minutes ago that someone uses some motion sensors (when all inactive for x minutes, activate something) to check for life in the house.
Now just yesterday it happend that I forgot to turn sleeping mode on. It happens not often but it happens.
Now I need some ideas to automate it. The before mentioned motion sensor thing will not work for me because of cats... lots of them. It should also be spouse proof (for reasons).

Any ideas?

Oh boy, oh boy. I always love when I can share this. It's my pride diy modification. I modified two contact sensors (very easy) to trigger with buttons when our phones are docked and undocked. When one goes to bed, the house goes to quiet time, which turns off most of the lights in the bedroom and turns on the fan. When the other docks the phone and goes to bed, the house turns off and night mode is engaged. Just with two tiny buttons rigged to a contact sensor. When no phones are docked = home when one phone is docked = quiet time, 2 phones docked = night mode. Here is a link to my project. Maybe it will spark some imaginative diy project for night mode.


I've copied this from my thread on this. It workds extremely well.

At night time: whenever either my wife or I charge our phones by plugging in the cable on the bedside, and place the phone facedown, our Android phones call local end points which flicks a virtual switch in HE, causing the bedroom to go into "quiet time", thanks @april.brandt. When we both have gone to bed, the mode changes to NIGHT, and turns on the alarm.

Upon wake up, the reverse occurs, and it's working well. The split second the phone is unplugged, the house wakes up for the first person, and the room wakes up for the second.

I'm also using variables in tasker to stop it spamming the local end points multiple times per day, although that's not a huge problem as we have wireless charging points around the home (but not the bedroom).

Local end points will stop this rule in it's tracks it if I'm ever on vacation. Initially I was using cloud end points, but local is far superior. For testing purposes, I've also got who is still in bed on my dashboard - and it could be considered stalking or abuse!

As i have dogs, i can't use motion sensors either. So i use a combination of presence, time of day and if certain lights & sockets are on.

i.e. if we are home + (time = later than 11pm) + (if lounge & kitchen lights are off) + (if lounge TV and lounge stereo are off) then set mode = night.

I also have a button in the master bedroom that i can click to set night / sleep mode.

I'd love to implement the charging dock idea, but my wife NEVER charges her phone at night.

1 Like

It doesn't have to be a dock. That's the elegance of it. It's a contact sensor rigged up to a button. A pressure type switch. Build that into something that you place bedside when you go to bed and pick up when you get up. Your imagination is your only limitation. I'd love pressure mats, but they're way too expensive.

Probably way too simple for this thread :wink:

I have Alexa devices. When I go to bed I tell Alexa good night. That starts an Alexa routine that turns on a switch that starts and RM4 rule that puts the house to bed for the night. In the morning, I reverse the process by telling Alexa good morning.


That's what I do at the moment (with GH)... but I want it automated.

"Oh boy, oh boy" nails it to describe your method. Maybe I make a variation of this.

I bought the Samsung Smart Buttons when on sale (4-$10/ea). So I needed a problem to solve with them.

Now I use modes to set the house into sleep mode based on our family daily schedule. We use a switch called “Party Time” that is the universal switch that negates the mode automations on the first floor (in case we are having a party😁). But outside of party the house goes to sleep at 11am and only activates enough lights in strategic areas to provide guidance through the hallways and main rooms on first floor. Some rooms such as the living room never turn on during sleep mode.

Back to the wifey got tired of talking to Alexa as her southern accent doesn’t seem to work with voice activated speakers (Google is just as bad as we tried it). So that was what got me going down the Homebridge scenario JUST so my wifey could turn on “bedtime” for our room (turns on fans, turns on AC and sets controls, shuts off lights, pauses master bedroom automations, etc). BUT I had a lot of issues with Homebridge for a few weeks until certain fixes came out but my WAF score was plummeting. This is when....I installed the button and the WAF score went WAY up. She now had a button that one press just turned on fans but kept lights on, whereas a press and hold initiated full bedtime.

So the moral of this long novel is sometimes a simple button is all you need to do the automations for your room.

Btw @april.brandt love this idea! I was thinking to just use power metering but curious if you tried that already.

Please do! If you have ideas on how to better this, please let me know. I'm totally open to suggestion. I've loved the automation because my husband only agreed to let me have this hobby if he didn't have to talk/push/dance/or beg (his words) for something to happen. So, I've been very careful in making sure that is request is met. It's sometimes a big expectation. So, him docking his phone, seemed to be the right answer for us. Takes care of 4 mode change scenarios. Home to quiet time. Quiet time to night time. Night time to quiet time. Quiet time to home. Home - business as usual. Quiet time - one in bed. lights dimmed. Bedroom lights off except an indirect light under the bed. Night - both in bed. House off. Night lights interact only. Quiet time mainly affects certain lights to keep things muted, so it works in the morning too.

I recently brought my ideas to my dad. Dad's know everything. We're working on a wooden pad with the same contact sensor built in to clean it up and hide the wiring. Using a different style button configuration for feet on the under side for stability. It'll be more decorative. Looking at qi chargers to build in to it. It's in the beginning stage. (Me drawing it on a napkin). But I anticipate we'll have something roughed together in the next week or so. I'll append it to my original project post. I would love to see what you come up with as a solution, so please update here or if you create a project in the lounge, please tag me in it so I can read about it.


I did! And failed miserably. I tried automate-it and tasker. Sharptools. An aeotec smart plug with the pretty LED colored edge and power metering. Epic fail on all of them for one simple reason. Charge your phone at another charger with a software based solution and your house goes to sleep. Also, the newer phones have smart charging, so the smart plug would read the drop off and turn on the house. I'm not a coder, so modifying a custom driver or solution was not going to happen. Good thing I mainly dabbled with this on the weekends. Many wake ups in trying to find this solution. Since we can go to bed anywhere between 8pm and 1 am and up again between 5 and 8 am, charging my phone at some point was hit and miss if I was having a late night. But .. op ... phone's charging, you're in bed. Lights off. So it was either create another and another and another rule or button or .. something to fix THAT scenario, or find something isolated to the bedroom. So .. I finally came up with the charger. One place. One scenario. One trigger. One solution. I can charge my phone at any charger in the house and not worry about tripping a mode. It's been nice.
Recently, I've been driven to make my project more aesthetically pleasing, so I've turned to the only person that will be able to help me solve this issue. My dad. I'll probably be appending my new design to the original project in the coming weeks.
As I stated before, please feel free to expand or modify upon my project. That's why it's here. It's a common question in the forum. I've spent some time with the rules to run the trigger and I'm happy to share them if you need. Definitely either post your project in the forum or attach your modification to my OP. I'd love to read about your solution.

I was recently discussing this with another member who did take my idea and used a software solution to charge their phone face down. Probably automate-it or tasker. Since my work supports a sheriff's office, I may get a notification that I need to check in the night, so that solution wasn't an option for me, but may be for you. I think the post is on my project if you look through the comments. We also use our phones as alarms, so if I wake up, I like to see the time or turn off the alarm without waking up the house.

I mentioned above that I had discussed with a member about charging face down. Well, it was @mike. And I didn't see that he had shared. We have the same "house must interact with me" idea of home automation. My apologies Mike. I didn't see that you had commented earlier.


Ok .. the napkin has become a solid project. It just goes to show you that dads know everything

Used a router to inlay the qi charger. Need to secure it all in the casing once it's sanded.

The button is under (or on top of) the contact sensor. I was able to hide the wiring inside. The sensor needs to be stabilized. It's just a bit wobbly yet. But this is a rough fit.

This is the top of the charger. AND it works. Some sanding. A fancy edge. Some stain and poly after the fine tuning and we'll have a new smart device capable of changing my modes. All self contained.

Just need to fine tune the balance. It no longer looks like something that might blow up. And, I'm thankful for that. NOT that I was going to take it somewhere, but I certainly don't want someone to draw false conclusions either.


Nice work. :+1:
Can't wait to see your finished master piece.

1 Like

I do the same for good night, but for the good morning part, I have an Alexa routine that fires when an alarm is dismissed. That way, as soon as me or my wife turns off the alarm, the house starts waking up.

I updated the project. I don't want to hijack the original post, so here is the topic. I have to say that I love how it turned out. I think you should definitely utilize something like this if you even somewhat think it'll be handy for you. I'm going to wait to put a finish on it to make sure it's working properly, but so far it's been stable and flawless. If you have a 3-d printer, it's would definitely make for a good project.

THIS. Applies to me too :frowning: