Room Automation with WeMo and IFTTT

I agree with @Moors7 in this point. Starting a laptop from power-down state is not that straight forward, but if you only sent your device to sleep, you might have several ways to wake it - depending on your BIOS you may be able to Wake-on-LAN, Wake-on-Mouse and/or Wake-on-Keyboard, which could be handled by the Core.

The next thing after that is to log in and start your desired programs.
While it is thinkable to do with a Core via USB-HID, it's most likely not what you really want. I'd guess that Zach's way is much more like it.
Once you've got your Computer running, its CPU is much more capable and offers many more ways to serve your needs, so you'd be a lot better off finding ways to please you there.

Some thoughts to consider too.
How slowly are you actually going down your stairs? OK switching on light, stereo, fan ... works rather instant, but powering, booting up and logging in on your computer is not that instant, so you might not actually need/want automation to that extent.
For my part, I hate when my computer boots up and just keeps opening one autostart program after another permanentely forcing the one program I have already started to work on into background :wink:
The other thing is, have you considered if it's not only you in the room?
If you leave the room (with your telephone, RFID-Tag, ... in your pocket), do you actually want to leave the other person in the dark :sunglasses:, or if you just pop upstairs to fetch a drink, do you really want to power down?

Having an idea is only a starting point - the difficult way is to find all or at least most of the problems you'll have to care about in a day to day routine.
Don't only think of the "normal" use case. Most likely you'll find that things usually don't work the "normal" way :weary:

4 Likes

Just a thought on the laptop piece of this project. Most laptops use [ReedSwitches1 (normally closed I believe) to automatically turn on and off when the display is opened or closed. On your machine there is a switch on the right side of the display(google your model and reed switch) and a magnet on the base. When the screen is closed the switch opens and the computer shuts off. Reverse for opening. Try verifying this with a magnet.
So, you could glue a magnet to a servo and mount it to the side of your screen with the screen in open position. Then wire that to your controller.
Motion detected entering the room. Lights go on. Servo moves the magnet away from the reed switch and the computer comes on.
Ideally your computer would be configured to boot up and go to your home screen without having to login or anything.
I haven’t done that but it seems doable.

Good luck!

2 Likes

Nice thought @bconstructive :+1:
Instead of a servo/magnet combo, an electromagnet would jump to mind :wink: - e.g. a relay coil.

Most laptops have a built in battery, so if you turn off the AC, the laptop just keeps on running (until the battery goes dead).
I don’t know which laptop you have, but some do not even need to be turned off. they have a power saver mode, once inactive for a time. Then when a key is pressed, it will come back to full life, where you left off (no reboot time needed).

According to the first post:

The 'power saver mode' you refer to here is 'sleep mode', which is present on pretty much all computers. This will still drain the battery quite a bit, so I don't thinks that really a viable option. There's hibernation mode, which turns it off completely, but allows you to continue where you left off, but I'm not surethat will be of much help either.

I’m in general agreement with @ScruffR when it comes to booting up your computer (Wake-on-lan) or even @Jack’s idea of just leaving it on all the time (I do this) isn’t a bad idea at all. If power draw really is an issue I’d go a servo and use that to literally press the power button!

Computer Wake Up

  1. Do you have WAKE ON LAN (WOL) support in your laptop. Even more, does it support WiFi WOL? If so, then I’d suggest you go drop $50 on a Raspberry PI + WiFi Adapter setup and you could have a lot of fun. The Pi could do loads of extra stuff like turning on lights, displaying anything you wanted, and more. You could use it like a local webhook (I’m actually working on this in my spare time and I’d love to collaborators)
  2. If no WOL then you’ll need to evaluate the option of just leaving it on all the time.

Turning on Spotify

Steps (ideally on a Raspberry Pi so you don’t even need your Laptop to be on!)

  1. Install Node.JS and npm
  2. Grab this repo using npm install spotify-web
  3. Load up the example, put in your credentials, and test out if it’ll play
  4. Report back here and if you have problems getting the above to work we’ll help you through it

Smart Lights

I personally don’t like those motion activated lights unless you want to buy a bunch of Spark Core / Photons. You just don’t have enough control over them! Use Wemo, Hook, or something similar

Hope that helps. Let me know how else I can help

1 Like

Thank you for your help :smile:

I will look into that, that seems like an wonderful idea!!

@zach

I leave mine plugged into AC, so battery drain is no problem in that case. But It uses lots less of my kilowatts during the night than it does while I use it actively . When I touch a key in the morning, I am up and running where I left off, in one - two seconds.

Bottem line is, I (my opinion) don't think the OP should try to control the laptop, but lights,and music, etc. may be a good project.

Of course it uses a lot less energy, but depending on your needs and device, that's still a lot of wasted energy. I personally could do without a boot time of 2 seconds. I'm more than happy with my 12-15 second boot time thanks to my SSD, combined with hibernation mode. Not only does this not use any energy, it will also not mess up my battery by having it plugged in constantly.

Sounds like a good plan. @harrisonhjones'suggestion of using a Pi is a good alternative for the laptop controlling. Combining this with sensory input from the Particle could make for a neat system :smile: Both the RPI and the Particle have their pros and cons, and they complement each other nicely.

That is a question I have never figured out. Do you (and others here) think that the laptop battery is damaged more by

  1. leaving it connected to AC constantly,
    -- or --
  2. cycling it through , charge / discharge daily.

PS. if you think this is off topic, and should be moved to a new thread, feel free to do so.

Sorry if I arised confusion. After Mr.Pierce suggested that the motion sensor technique required coding, I wanted to shy away from it. I will be most likely using the smart outlet like Wemo, Hook and Smartthings to do this job.

I will go with Mr.Supalla's idea because with a start up script, I can code it easily to open up the programs .

I was so stupid when I saw this, I thought that if it sensed motion, it will remain ON until I leave, I was stupid to believe that :disappointed: . Sorry :stuck_out_tongue_winking_eye:

Side Note: Also, I know most of these tech that is being suggested but I don't know what it is called, hence this forum.

There are many exotic ways to create control systems, and you probably are looking for an exotic way.
But, sometime, you can use the KISS method. (keep it simple stupid).
A light switch at the top of the stairs, with wires run down to your devices may be a KISS method. But not to exotic!
Good luck

1 Like

It is off topic, but as long my answer does not trigger off a longer discussion (and it might help the OP to decide what to do for his project), I’ll answer this.

Especially Lithium batteries don’t like to be/stay fully charged over a long periode. They also dislike beeing stored away fully charged or discharged.
They are built for charge/discharge cycles and cope best when used the intended way.
If you have an intelligent charger which keeps the battery between 15/20% and 80/85% you can keep the batteries plugged in (if you need to).

Have a read here
http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries

2 Likes

Yes, this is what I was looking for :grin: , This seems to be the "KISS" method @Jack may be referring to :kissing_smiling_eyes:

True, I thought the same thing @ScruffR, but Mr.Zach's method seems more possible :blush:

Yes, there are many programs to serve me on the computer, but I wouldn't need home automation to THAT extent : :stuck_out_tongue:

Yes, I see your point, I am not a old man, no offence to @Jack!! :flushed: But my bag is at least 15 lbs-20 lbs, I am not joking, and my steps are kind of small and steep, so I have to go down carefully.( I ended up in the hospital twice :disappointed: ) I still have a cast on my right leg.

So yeah!!

1 Like

Your words are too complicated for me!!! :fearful:

I am confused @bconstructive , I searched up the reed switch and my laptop and couldn't find any relevant info. How does this work?

Is @ScruffR suggesting to use the coil to pull up my screen?

I don't think that was his suggestion.

Many laptops (mine) detect when the laptop is closed, by having a reed switch in one part, and a magnet in the other, so when it is closed, the magnet is in close proximity to the reed switch, and changes the switch state.
I often place another magnet over my reed switch to make my laptop think that it is closed, and thus reduces power.
google "reed switch".

On my laptop (chrome book), the magnet is in the lid, and the reed switch is on the keyboard part, upper left area of the keyboard.

No, since the sensor that does detect whether the lid is open or closed by sensing magnetic fields (I suppose it's more likely a hall sensor then a reed) you could use an electromagnet to switch the magnetic field on or off rather than physically moving a permanent magnet.

If you can't find the location of your sensor, just take a magnetic needle or paperclip, attach a thread and just scan accross your laptop. You'll find some places the pin/clip is attracted to,
There you've got the magnet that will be sensed when the lid is closed (unless you found the speaker magnets ;-)).
If you now take a magnet and bring it close to the corresponding spot on the lid, the screen should go off - there you've got the sensor.

With my computer the reboot time takes about 4-5 mins approximately, and the battery will drain quite as @Moors7 said.

Yes, I have WOL. I am not sure if I have the Wifi, instead would it work if put the laptop to sleep and call it via WiFi? Do I need to set up anymore BIOS-Options?

Great Idea! I will try this. But what will I connect the Rasberry Pi to ? Will it be self-standing or will I need to connect it to the laptop, then if so how? @harrisonhjones

Yes, I will be going with the Wemo outlet.

Thanks!!! :blush:

But my argument is can I program the laptop to log in with the password with this or Wake-ON-Lan?

Also I think it is dangerous to leave the laptop connected to the AC all the time.

Let’s start with the WOL.

  1. Go here and enable WOL for your WiFi adapter and ethernet adapter
  2. Install this on your phone (if Android) or this if iOS (iPhone)
  3. Power down your computer and attempt to wake it up using the above apps