12

I have just started investigating smart lights.

I am interested in using some Wi-Fi sockets in some lamps in my office to automate the lights.

I am curious if there is a way to turn my lights on from my PC, and ultimately turn them on when my Linux machine wakes from suspension. Then turn them off when the Linux machine suspends.

Are there Wi-Fi sockets that use a certain messaging protocol that is open, for which I could write an app to use with them?

10

Belkin WeMo devices use uPnP and SOAP messages for control so can be easily controlled from any number of languages and options. Some details on the work I've done working out the protocol can be found here

There are also the Sonoff devices that can be flashed with firmware to allow them to be controlled using MQTT

IKEA's new TRÅDFRI light system use CoAP (with DTLS security) so is another open protocol that you can play with. My notes on this are here

For any of these you should be able to use the Linux power management system (scripts in /etc/apm/resume.d & /etc/apm/suspend.d) to fire off commands when the machine changes state. Just remember that the network may take a second or so to come back up when a machine resumes.

4

There are sooooo many ways to do what you ask for.

There are proprietary solutions with API's and there are Open solutions with total openness.

Your question is broad and hard to give a straight answer depending on what your criteria is like: the size of your wallet, technical spec, availability in your market your preferences on color and so on.

If you want an direction to where to find info, I have found youtube an inspiration, OpenHAB.org (An Home Automation Hub) that has addons for many vendors and open API's.

And of course you can schedule post and pre power script in linux, my prefered plattform :-)

3

If you're looking to keep clutter off of your wifi network, you could use Z-Wave or Zigbee lights (bulbs, sockets, or switches). Each of those network protocols can be run using a USB controller that would plug into your Linux machine. Both standards have active open-source communities. As MatsK said, it is pretty easy to integrate those into power scripts in Linux.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.