Smart Home Challenge: Phone Charger & Ambient Light

Hey thanks for checking out the article for Smart Home Challenge part 2!

The article has been updated to reflect the changes in the new video. Those include using IFTTT, Tasker and iOS 14 automations.

Some options will still use webCoRE. It’s really easy to install if you haven’t yet. Here are the instructions. I also have a beginner’s video for webCoRE, so check that out if you want.

You can also take a look at the part 1 tutorial or watch the video if you missed those. Okay let’s dive in!

Phone Unplugged Automation

Affiliate Disclosure: This page has affiliate links, which earn us commission at no cost to you. 

As described in the video, this lets you trigger an automation when you unplug your phone from its charger.

Usually I unplug my phone in the morning when I’m ready to get up. This could be a good way to start your morning routine automatically.

There is an IFTTT and Android battery trigger for when it’s unplugged.

Select Device is unplugged as the trigger. Then if you have SmartThings you can turn on a Virtual Switch to activate an automation on SmartThings.

If you are only using IFTTT and want to only run this automation in the morning you will need some filter code. Here is an article that explains how to make an applet with filter code that would only run in the morning.

If you want to run your morning routine using Alexa that can also easily be done using SmartThings as well. Here is how you could set up a Simulated Alexa Switch.

Then you can have IFTTT turn on this Simulated Alexa Switch and you can use that as a trigger for your Alexa Routine.

If you want to use Tasker it’s also available but only for Android phones. If you are connecting Tasker to SmartThings you might need another app Called SharpTools.

iOS 14 that is about to be released will also have automations in the Shortcuts app. Select Create Personal Automation and then scroll to the bottom. Select Charger and then is disconnected to trigger the automation when the phone is unplugged.

If you just want to use webCoRE, you will need a smart outlet like this SmartThings one that can measure power usage.

Using my webCoRE piston, you may need to tweak the time this starts based on when you wake up. You could also lengthen the time the outlet turns off and on again depending on your preference.

Using webCoRE for this automation isn’t ideal since the outlet has to turn on and off. This could work on iOS or Android so that’s really the only benefit.

The piston will loop until the phone is unplugged. So you could encourage yourself to wake up with reminders periodically if it’s still plugged in.

There is also a place holder if you wanted to skip an alarm. The idea is that if you had an alarm tied to your smart home set at 7:30, you could skip it if you unplugged your phone before then.

Phone Charging Automation

Using a similar set up as above, you can also get alerted when your phone is done charging. This might be useful if you like to charge your phone in another room.

As mentioned in the video this can easily be done using Tasker or the iOS 14 automations.

You could also use a smart outlet that will work if you’re using iOS or Android. I’m using this one from SmartThings (the same one from the previous automation) because it’s so inexpensive. Plus it’s easy to automate using webCoRE.

To figure out how many watts indicate it’s done charging, I used a smart app called Simple Event Logger and it works very well. Definitely a useful tool for keeping track of data in your smart home if you use SmartThings.

You might need to adjust the piston to match when your phone is done charging. If you don’t want to use the Simple Event Logger you can just keep an eye on your smart outlet in the SmartThings app and see what the power consumption is when your phone is at 100%.

Motion Lights when it’s Cloudy

Another home automation challenge was to have the lights turn on from motion, but only if it’s cloudy outside during the daytime.

Using webCoRE, you can access the weather conditions. Here is a helpful page to know how to use the weather in webCoRE.

Below is a simple piston to turn on lights when its cloudy and motion is triggered. I also have it check to see if the light is already on. The reason why is that I have the light set to 50% to add some brightness to the room, but if I already have the lights at 100% I don’t want them to change.

As mentioned in the video, if you want to trigger a piston like this from something like an Echo Flex, you will need to add a Virtual Switch in SmartThings.

That Virtual Switch can be turned on in an Alexa Routine triggered by the Echo Flex motion’s sensor. Then instead of the motion sensor triggering the piston, you would use the Virtual Switch created instead.

Here is a video I did that talks about Virtual Switches.

Ambient Light Sensor Automation

When there’s a big storm during the day, it can get dark in your house. Instead of relying on the weather data you can use an ambient light sensor to know how bright it is in the room.

Even though I live in Arizona and we pretty much never have clouds, this is still useful to me. The reason why is that I like to have natural light in my office, but after 3 pm the sun is setting on the other side of the house so it gets dark faster.

Using an ambient light sensor has been really useful for that reason. Here’s how the automation works in SmartThings.

This sensor is from Inovelli, but there are other ambient light sensors that are compatible with SmartThings and other hubs. Philips Hue’s motion sensor doubles as a light sensor, so you could use that as well.

The automation is very simple and doesn’t require webCoRE.

When there is motion and the brightness of the room is equal or below “4” it turns on the lights. I figured out this number by monitoring the light sensor in the app.

I really appreciate you watching the video and reading how I set everything up. Hopefully it sparks some ideas for your smart home, even if you don’t set up the automations exactly the same.

I’ll create more videos and tutorials like this, so make sure you subscribe if you don’t want to miss them. If you want to challenge me to set up your home automation idea, click here.