Insteon PowerLinc ModemAs explained in yesterday’s article, I have been overhauling my home automation system (HAS) and have decided to release parts of my controller software written in Python and runs on Raspberry Pi. I have been working on breaking apart the controller software so that each piece can be ran standalone. For example, yesterday’s article¬†showed how to read your Google Calendar with Python. By doing that, you can schedule events to occur in your HAS by simply adding items to your Google Calendar.

Today, I want to share with you some Python code that allows you to control Insteon & X10 devices in your HAS using the Insteon PowerLinc USB modem which you can get from http://www.smarthome.com/powerlinc-modem-insteon-2413u-usb-interface-dual-band.html for about $80. Since the PowerLinc requires an always-on computer to be connected to it, it’s recommended to use a low powered computer such as the Raspberry Pi. Since the code below is written in Python, you can also use it from Windows or Mac if you want. Just make sure you change the “port” property in the serial connection to match your environment. If you combine this code with yesterday’s code, you can schedule your lights and other appliances to turn on and off by scheduling items in your Google Calendar.

Continue reading »

Related Posts

Android App Dev 101My newest ebook is finally available online. You can get it at¬†https://sellfy.com/p/Q4Lg/. It’s currently only available in PDF format. I’m still working on converting it to MOBI and EPUB formats. Once I’m finished converting it, the ebook will be available on Amazon and Barnes & Noble for the Kindle, Nook, and other e-readers. Your feedback is greatly appreciated!

 

Table of Contents:
Chapter 1: Downloading and Installing Java, Eclipse, and the Android SDK
Chapter 2: Configuring Eclipse and Creating Your First Android App
Chapter 3: Creating a Layout and Adding Some Code
Chapter 4: Testing Your App with the Android Emulator
Chapter 5: Monetizing your Android App with Google AdMob
Chapter 6: Running Your Android App on Cellphones and Tablets
Chapter 7: Publishing Your Android App to the Google Play Store
Chapter 8: (Bonus) Google Glass and Windows 7
Chapter 9: (Bonus) Computer Vision with OpenCV and Google Glass

Related Posts

Tagged with:  

In this video, I give a sneak peak of a new app I wrote for Google Glass that allows you to do real-time vehicle diagnostics using a OBD-II diagnostic scanner. Currently I can read my vehicle’s current MPH, RPM, & MPG. As time permits, I will add support for things like coolant temperature, average MPH, average MPG, engine load, etc… I will add support for all PIDs that the OBD-II protocol supports including the ability to read and clear check-engine codes & indicators.

I’m reading my vehicle’s computer data using the Bluetooth Supper Mini OBD 2 / OBD II bluetooth adapter (diagnostic scanner) which I got for $20.00 from Amazon. I will post the source code as soon as I have the remaining commands supported.

Related Posts

Tagged with:  

Google Glass LogoEver since receiving my new Google Glass a few weeks ago, my inbox has been flooded from people asking if I have built any computer vision apps yet for Glass. The answer to those questions is “yes” and I plan on posting some articles and videos about them very soon. Until then, I thought it would be a good idea to post some articles showing how to get started with computer vision development on Google Glass using OpenCV for Android. Since there are several steps involved with building useful computer vision apps for Glass, I will be breaking up the steps involved into multiple articles. In this article, I will walk you thru the steps required to get your first OpenCV app installed and running on your Glass. While I’m at it, I will also show you how to install and run a simple face detection app. In a future article, I will show you how to do more such as applying filters and even a little bit of augmented reality.

Continue reading »

Related Posts

Tagged with:  

Set Properties in Text with Java

On May 4, 2013, in Java, Programming, by LuCuS

Set properties in text with Java.

PropertyManager.java

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Properties;

public class PropertyManager
{
	public static void setProperties (List<String[]> values)
	{
		Properties properties = new Properties();
		try
		{
			for (String[] value : values)
			{
				properties.setProperty(value[0], value[1]);
			}
			properties.store(new FileOutputStream("config.properties"), null);
		}
		catch (IOException ioe)
		{
			
		}
	}
}

Test.java

import java.util.ArrayList;
import java.util.List;

public class Test
{
	public static void main (String[] args)
	{
		List<String[]> properties = new ArrayList<String[]>();
		properties.add(new String[]{ "PROPERTY_1", "This is property 1."});
		properties.add(new String[]{ "PROPERTY_2", "This is property 2."});
		PropertyManager.setProperties(properties);
	}
}

Related Posts

Tagged with: