Archive for the ‘General’ Category

So I have been working hard over the last few month trying to consolidate many pieces of what I hope to be the decorations master piece for 2010.

Here is how it started.  For 2009 I had already created a simple programs that would randomly play small 5-10 second sequences such as fading on / fading off, lighting bolts etc. And even in Halloween/Christmas starting I start projecting some images and clips on the window using my laptop and a projector. But wouldn’t it be nice to have it all sync together?  This is where this ‘project’ came up.

For starters I considered dropping these boxes and going with the Light-o-rama product.   Which I am sure you have seen 1000 times before and that same Transiberian Orchestra song!  But after downloading the demo software I found there was no way I could insert code or run a program before or after.   Don’t get me wrong its a excellent product and insteon devices will NEVER match the speed those device can achieve!   But another limitation ‘I’ didn’t like was that its all in central controllers. With the lamplincs I can and have had devices inside the home and some outside at the same time, also if one device dies you replace it and your done, here if you controller dies you are down 16 ‘channels’ .  BUT Downside for me is each device needs to be  programmed individually but once its set your ready to go!.  Another big plus for me was that I could use existing Insteon devices over and over and even mix with the ones in the home.  For example in Halloween I would kill the kitchen lights inside for the lighting bolts outside.   So in true ‘me’ spirit I decided to stick with Insteon and do something different!

Here are some of the LampLincs I’ve picked up over 2009/2010.  Each are identified by unique #

The Show Manager

So “Show Manager” is basically the conductor that start and stop these individual programs.  Here is a high level chart of what it consist of.

For example the ‘Show Manager’ will start and stop the ‘Randomizer’, ‘Sequencer’ as well as accept input from the internet.  Like in 2009 I will provide a button from our community website/ internet users to ‘bump’ the decorations. 🙂  Try that Lightorama.

The program is a simple program that will start and stop programs using VB program looking as the processes in memory.

The “Sequencer” Program (New for 2010)

Different from 2009 is the ‘Sequencer’ program which is what allows me to sync video/audio to commands to the devices.  The screen is very simple and clear.  You have a time line which is broken down in .25 seconds with the devices down the left.  Each color is a different command sent via the serial interface.

Closeup of the Time line board.

Close up of the commands screen

Synchronizing the video between the two computers was a ‘TASK’ .   I had to get down to the milliseconds so the video would sync correctly,

For this I had to use VB 2008/2010 Windows presentation format (WPF) in the remote laptop since you can change the rate of play of the video. I never found a right way to do this in VB 2008 or less. So the main sequencer would send a heartbeat to the laptop everysecond with its time sync so the player could go slower or faster.

The way I put them to talk is a previous entry here, how to Communicate using ports / TCP.   HERE

To be continued….

Advertisements

In a house that has 6 computers (so far), I’m asked all the time what do I use to control internet junk like porn, spyware on kids computer and more.

On the internet side there is a free system that I use is called openDNS. This system inserts itself into your network by pointing all internet request to their systems which then provide you the ability to block by category, sites and many many more other functions.

They have a couple of range of services from free all the way to premium for a very low yearly price.

How it works?

Not getting to much into details, when you have a home network all devices need to go out a router, in this case many of us have a “Linksys”,”D-link”,”Belken etc”,  and any other device which allows you to ‘share’  the internet (Cable modem, DSL etc.) connection wirelessly of via physical cable.

One of the task of this device is to provide DNS (Domain Name Services) so each time you type in a address like ‘http://www.google.com’ the DNS (Domain name service) converts the name into the IP Address (example: 12.54.34.35 the browser understands and off it goes!    So with some minor configuration you can point your network DNS server to theirs and your set, you are now blocking your whole home from one location, no need to install individual programs on each computer. 🙂

Note: Unless you are obsessed with ‘one’ more company knowing your IP address don’t read on.  Since they will automatically tie your IP to your profile.

Once you setup your account, you can manage which sites to allow and which ones to always block, by level and more.
Btw: I’ve had this service for the last 3 years.

Below is a list of the types of modems/routers available and how to set them up.

Here is a quick breakdown of a  Insteon TriggerLinc I use for notifying me upon mail arrival using a external ‘normally open’ contact.

Components needed;

Insteon TriggerLinc goes for $34
Normal Open contact (These come in all shapes and sizes) i chose a minuature one which I spray panted black to match the color of the box.
Here is a link to a few, they run for around $2-3.   See here
Small screwdriver.
Double sided tape
Can of spray paint.

And finally the insteon device you wish to link it to (In my case I linked it to my PLM so I can then act accordingly such as notify via flash lights, email, etc.)
You really dont need a fancy Pc system for notification since you can attach this to any insteon device using the tap/tap method if you like but be aware the light will go off when it closes.  But you do need a access point to capture the signal.  In my case the closest access point is a good 100 feet!!!

As seen in the picture, The TriggerLinc comes with its own contact/magnet but you have the limitation that you need to have the base unit near by.  Good news is that the device allows you to attach external contacts like I did here.  The box opens very easily.

You can see the wires coming out from the bottom right hand side. (No special order needed)
Note: I used a rechargeable ‘Solar’ battery which hasn’t failed me yet. You can find this
at places like Home Depot under lighting section.  They run for around $7 for 4 double ‘A”s.

First I spray painted the contact to match the color of the mailbox (Flat Black)

Finished product.  🙂

Connected and ready to go. (I used double side ‘3M-picture frame’  tape which you can find at any
Walgreens or Homedepot store)

For my mailbox the device sits comfortably underneath but you can also use Velcro to hid the device if needed.

The cables I pass thru one of the small holes on the left hand side. I used glue to tape secure the cables on the side of the mailbox
then another quick spray of black paint.  🙂

Finished product.

What you will get on your side will be the traditional ON/OFF insteon commands.
In my case I have a notification sent to a PC console as well as emails sent to myself.

Whats up?

Posted: April 25, 2010 in General
Tags: , , , , , ,

I know i’ve been out for a while, but im not dead!  Ive moved all my home system over to the PLM system.  For a couple of reasons.  First the PLC SDM software is no longer supported.
And many times that my program has stopped has been a cause of this.  Its still a great device and Im not planning on removing any pages related to it.

Here is a link of a excellent site to get you started sending commands to the PLM.  Has all the basics and even sample code.  I moved all my custom code following this.

http://www.madreporite.com/insteon/insteon.html

So what have I been working on?
Would you believe decorations?. Im now stocking up on LampLincs for 2010.  I’m up to 30 now (This is of course not counting the one for the home). I’ve got myself a extra PLM off Ebay (2112) and another one on the way.  Even my first PLC will be used for the second phase of the home.  I’ll later go into detail, just that I wanted to show im still here. 🙂

For the 2112, go for the older ones, the new ones dont have a ‘pass-thru’ outlet. And this key to sending groups commands fast!  Hence why I ordered another one.

Also ive been stocking up on LED lights, as you may now the lamplincs have a max load of 300 watts, and with the average load of a traditional 100 bulbs string runs at around 46-64 watts you can add more lights on a single Lamplinc,  For example for this Christmas im suspecting I will need 3 Lamplincs for the icicles.

We’ll off, and thanks for all the comments, I see this blog gets hit a lot. Appreciate it!

Hi, so I know ive been disconnected for a while.  But always trying to provide some goodies.

One of the cool things of the PLC is that if you know serial commands you can actually talk to it bypassing the SDM software.  My reason being that X10 motion sensors are cheeper than the Insteon and smaller which I can hide in different places but I would run in to the problem of the x10 signals not making it back to my main computer.  So what If you can have something on another computer which can transalate it to Insteon ?:)

So what I was right on the back of the PLC I have a transceiver and use the PLC with this small code to convert it to Insteon.  This way I basically have a x10 receiver on the other leg of my home.

So below is a small little program I use to  ‘convert’ X10 signals to a Insteon signal.  In my case the PLC will sending a ON  or OFF command to the PLM and depending the rate is the house code for example (B5,B6).   For the example im using VB 2005.  2008 and 2010 will work fine as well.  Note that i am bypassing entirely the SDM software.  if you don’t call it in your code it wont load, but you do have the port locked and isn’t sharable  🙂

A very good starting point is this site and I basically started from here http://www.madreporite.com/insteon/insteon.html which will show you how read bytes, which is how the plc will respond as well.

Basically the PLC talks at 4800,8,N,1.  The program consist of a simple form with  just one button to exit.


Option Strict Off
Option Explicit On
Imports VB = Microsoft.VisualBasic
Imports System.IO
Imports System.IO.Ports
Imports System.Net

Public Class Form1
 Public WithEvents PLC As New IO.Ports.SerialPort
 Public X10_House_Code As String
 Public X10_House_VALUE As Integer
 Public X10_Command As String
 Public PLC_Queue As String
 Public handler As New mySerialDelegate(AddressOf Process_Queue)  ' Once we read the data process it in a separate thread.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 '------ OPEN PLC SERIAL CONNECTION SETUP PLC AND LEAVE READY - 
 PLC.PortName = "COM1"
 PLC.BaudRate = 4800
 PLC.DataBits = 8
 PLC.Parity = Parity.None
 PLC.StopBits = StopBits.One
 If PLC.IsOpen = False Then PLC.Open()

End Sub

 '---- THIS IS THE EVENT THAT WILL FIRE EACH TIME DATA IS RECEIVED BASICALLY WE CAPTURE ALL THE DATA AND
 '---- CALL THE OTHER THEAD TO CONVERT IT.
 Private Sub PLC_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles PLC.DataReceived
 Dim A, Bytes_to_read As Integer
 Dim rcvBuf(4096) As Byte
 Bytes_to_read = PLC.BytesToRead
 Do While PLC.BytesToRead > 0
 PLC.Read(rcvBuf, 0, rcvBuf.Length)
 For A = 0 To Bytes_to_read - 1
 PLC_Queue = PLC_Queue + Hex(rcvBuf(A)).PadLeft(2, "0") + " "
 Next
 Bytes_to_read = PLC.BytesToRead

 Loop

 Me.BeginInvoke(handler)
 End Sub

 Public Delegate Sub mySerialDelegate()
 Public Sub Process_Queue()

 'CONVERT STEAM TO X10 HOUSE CODES and the VALUE THAT WILL BE PASS TO THE OTHER DEVICE
 ' SO WHEN IT SEEN B2 IT WILL SEND TO THE OTHER SIDE A VALUE OF 18 ON THE RATE OR 'ON' VALUE
 ' Im only converting the B Code nothing else. 

 If PLC_Queue.Contains("02 4A 00 EE ") Then X10_House_Code = "B2" : X10_House_VALUE = 18
 If PLC_Queue.Contains("02 4A 00 E2 ") Then X10_House_Code = "B3" : X10_House_VALUE = 19
 If PLC_Queue.Contains("02 4A 00 EA ") Then X10_House_Code = "B4" : X10_House_VALUE = 20
 If PLC_Queue.Contains("02 4A 00 E1 ") Then X10_House_Code = "B5" : X10_House_VALUE = 21
 If PLC_Queue.Contains("02 4A 00 E9 ") Then X10_House_Code = "B6" : X10_House_VALUE = 22
 If PLC_Queue.Contains("02 4A 00 E5 ") Then X10_House_Code = "B7" : X10_House_VALUE = 23
 If PLC_Queue.Contains("02 4A 00 E4 ") Then X10_House_Code = "B8" : X10_House_VALUE = 24
 If PLC_Queue.Contains("02 4A 00 E7 ") Then X10_House_Code = "B9" : X10_House_VALUE = 25
 If PLC_Queue.Contains("02 4A 00 EF ") Then X10_House_Code = "B10" : X10_House_VALUE = 26
 If PLC_Queue.Contains("02 4A 00 E3 ") Then X10_House_Code = "B11" : X10_House_VALUE = 27
 If PLC_Queue.Contains("02 4A 00 EB ") Then X10_House_Code = "B12" : X10_House_VALUE = 28
 If PLC_Queue.Contains("02 4A 00 E0 ") Then X10_House_Code = "B13" : X10_House_VALUE = 30
 If PLC_Queue.Contains("02 4A 00 E8 ") Then X10_House_Code = "B14" : X10_House_VALUE = 31
 If PLC_Queue.Contains("02 4A 00 E4 ") Then X10_House_Code = "B15" : X10_House_VALUE = 32
 If PLC_Queue.Contains("02 4A 00 EC ") Then X10_House_Code = "B16" : X10_House_VALUE = 32

 '- ON OR OFF
 If PLC_Queue.Contains("02 4A 01 E2 ") Then X10_Command = "ON" : Send_Bytes(X10_House_VALUE, True) : Debug.Print(X10_House_Code) : X10_House_Code = "" : X10_Command = ""
 If PLC_Queue.Contains("02 4A 01 E3 ") Then X10_Command = "OFF" : Send_Bytes(X10_House_VALUE, False) : Debug.Print(X10_House_Code) : X10_House_Code = "" : X10_Command = ""

 Debug.Print(PLC_Queue)

 ' Clear and start again
 PLC_Queue = ""
 End Sub

Public Function Send_Bytes(ByVal value As Integer, ByVal State As Boolean) As Boolean
 Dim RECEIVER() As String = Split("0D.FE.9E", ".")  '-- THIS CONTAINS WHO WE ARE SENDING THE MESSAGE TO CHANGE AS NECESSARY
 '-- MAGIC CODE TO SEND TO PLC (I'LL EXPLAIN THEM LATER)
 Dim xmtbuf() As Byte = {&H2, &H40, &H1, &HA1, &H0, &H9, &HFD, &HE4, &H0, &H0, &H0, &HD, &HB, &H44, &H5, &H11, &H1}

 '-- HERE WE WILL REPLACE THE BYTES ABOVE IN BOLD TO WANT TO SEND TO,
 xmtbuf(11) = System.Convert.ToInt32(RECEIVER(0), 16)
 xmtbuf(12) = System.Convert.ToInt32(RECEIVER(1), 16)
 xmtbuf(13) = System.Convert.ToInt32(RECEIVER(2), 16)

 '- DEPENDING ON THE DEVICE BEING ON OR OFF WE SWAP ONE OF THE BYTES
 If State = True Then xmtbuf(15) = 17 Else xmtbuf(15) = 19 ' If on then push 17 if off push 19

 '--- HERE WE INSERT THE VALUE / X10 HOUSE CODE WE HAVE PREDIFINED 
 xmtbuf(16) = value

 '--- CALL OUR LITTLE FUNCTION TO WRITE THE BYTES TO THE SERIAL PORT
 PLC_Write(xmtbuf)

 '--- SETUP SOME MORE BYTES (THIS DOENST CHANGE) AND WRITE THEM, THIS TELLS THE PLC TO PROCESS THE BYTES WE SENT
 '--- BEFORE
 Dim xmtBuf2() As Byte = {&H2, &H46, &H1, &H42, &H10, &H9F}
 PLC_Write(xmtBuf2)
 End Function

 '--- THIS FUNCTION BASICALY WRITES ALL BYTES TO THE SERIAL PORT WE HAVE PREVIOUSLY DEFINED
 Public Function PLC_Write(ByVal XmtBuf As Object) As Boolean
 Try
 PLC.Write(XmtBuf, 0, XmtBuf.Length)
 Catch
 Debug.Print("COULDNT SEND DATA CHECK PORT")
 End Try

 End Function

 '--- SIMPLE BUTTON ON OUR FORM TO EXIT THE PROGRAM
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
 End
 End Sub
End Class

We’ll after receiving back some of my hard earned money thru 2008. I shelved out the $159 for the Insteon T1700 thermostat.
It can be found here.

The device is quite small, which is fine and thinner that my orginary Honeywell one which was a real plus.  To install was also very simple.
And technical support was awesome!!!  Who expects to call a company and receive a live person and be able to troubleshoot on the phone in less that 3 min.  And to top it off the rep even called me back since he had to leave. At the end it was a simple dip switch due to my model.  So if after you install it and when you turn on cool and heat comes out and vice-versa, just turn on dip switch two and your set!  Thats Again Mike from Venstar!!!!


The only thing would be the ‘light’ on the side of the Insteon module.  so in dark areas it does stand out.
Like mentioned above the device is very small and the insteon module even smaller.
For example check out the image in comparison to my hand

Setting Mode, Getting Temperature of Thermostat

Ok, enough Pictures and talk, lets see how to control this device.

First forget about sending ON/OFF commands, for me they didnt work, nor did they do anything.  What we will be using is the 0x02 command instead of 0x11 for on or 0x13 for OFF.  What I has able to find was the higher numbers after that worked. I’ll show you what

Ive got and show examples after.  In my case I couldnt send request using the regular PLC commands so I ended using the low level calls using the sendhex function, that article can be found here

More ways to speak to your Insteon Devices

For the examples my PLC is # “0D 51 32” and my Thermostat is “01 02 03“.

0x6b – Bit 2 – Get Thermostat Mode (Returned is 00=off,01=Heat,02=Cool,03=Auto,04=Fan)

 
	'Send

	Sm.SendPLCHex("02 40 01 A1 00 09 FD 9B 0D 51 32 01 02 03 05 6B 02"	Sm.SendPLCHex("02 46 01 42 10 9F") ' Execute my command

	'You should get the reponse on the Last Bit of your reponse.  For example
	04 01 02 03 0D 51 32 26 6B 02

	So in this case 0x02 Means the device is on COOL.

0x6b – Bit 3 – Get Temperature (Returned is the temperature, you convert to decimal and divide by two)

	'Send
	Sm.SendPLCHex("02 40 01 A1 00 09 FD 9B 0D 51 32 01 02 03 05 6B 03")
	Sm.SendPLCHex("02 46 01 42 10 9F") ' Execute my command
	'You should get the reponse on the Last Bit of your reponse.  For example
	04 01 02 03 0D 51 32 26 6B 9A 
	So in this case 0x9A Converted to decimal is 154 divide
        that by two and you get 77 degrees!!

0x6b - Bit 4 - Set to Heat
'Send

Sm.SendPLCHex("02 40 01 A1 00 09 FD 9B 0D 51 32 01 02 03 05 6B 04")

Sm.SendPLCHex("02 46 01 42 10 9F") ' Execute my command

0x6b - Bit 5 - Set to Cool
'Send

Sm.SendPLCHex("02 40 01 A1 00 09 FD 9B 0D 51 32 01 02 03 05 6B 05")

Sm.SendPLCHex("02 46 01 42 10 9F") ' Execute my command
0x6b – Bit 6 – Set to Auto (To switch automatically from Cool to Heat depending on your settings)

	'Send
	Sm.SendPLCHex("02 40 01 A1 00 09 FD 9B 0D 51 32 01 02 03 05 6B 06")
	Sm.SendPLCHex("02 46 01 42 10 9F") ' Execute my command

0x6b – Bit 7 – Fan on

	'Send
	Sm.SendPLCHex("02 40 01 A1 00 09 FD 9B 0D 51 32 01 02 03 05 6B 07")
	Sm.SendPLCHex("02 46 01 42 10 9F") ' Execute my command

0x6b – Bit 8 – Fan off

	'Send
	Sm.SendPLCHex("02 40 01 A1 00 09 FD 9B 0D 51 32 01 02 03 05 6B 08")
	Sm.SendPLCHex("02 46 01 42 10 9F") ' Execute my command

0x6b – Bit 9 – All Off

	'Send
	Sm.SendPLCHex("02 40 01 A1 00 09 FD 9B 0D 51 32 01 02 03 05 6B 09")
	Sm.SendPLCHex("02 46 01 42 10 9F") ' Execute my command

Setting the Cool / Heat Thermostat Temperature

Here insteon of 0x6B we will be using the 0x6C for Cool and 0x6D for HEAT.  So lets say you’ve set your device to Cool and want to lower it to 75 Degrees.  Just like when we read the temperature, when we set it we need to multiply the requested value * 2 and convert it to HEX.  In the sample below the variable Set_Temp holds what we want it to.  The next statement converts it to HEX and *2 and presto!

'This is the temperature we want to set Cool to!
Set_Temp="75"
Dim Temp As String = Hex(Set_Temp * 2)
Sm.SendPLCHex("02 40 01 A1 00 09 FD 9B 0D 51 32 01 02 03 05 6C " + Temp)
Sm.SendPLCHex("02 46 01 42 10 9F")

'This is the temperature we want to set heat to!
Set_Temp="70"
Dim Temp As String = Hex(Set_Temp * 2)
Sm.SendPLCHex("02 40 01 A1 00 09 FD 9B 0D 51 32 01 02 03 05 6D " + Temp)
Sm.SendPLCHex("02 46 01 42 10 9F")

Hope this works for you and its working great for me.  Each hour I poll the temperature and as part of that routine I poll my thermostat to keey the information up to date. I’ll post more as I find out!

So after weeks of playing,printing, and busting buttons  I think what I ended up is with some acceptable buttons, here are the layout of my first KeyPad Linc

These were done using a InkJet, I still need to try using a Color Laser to see.  Since I got this one off of ebay it was only the 6 key’s which I got the conversion kit off of SmartHome for $5 to 8 bottons.

The Etched buttons do look better but a bit costly.  Here is the breakdown

8 Button Keypadlinc

Color Kit, which changes the color of the LED behind the button

6 to 8 Button Conversion kit or new buttons if you break one. 🙂

Here is the low down,

1st  – Controls the load on the switch which is in my hallway

2nd – The Kitchen Main light

3rd – The Lights inside the Garage

4th – A group which controls all outside lights, (Garage, flood lights, back lights, entrance etc.)

5th- Not linked to any device but when pressed the PC will turn off all the lights in 2 min’s and set the house state to off, which includes bumping up the thermostat to 80 Degrees.

6th- Linked to my I/O Link to open/monitor the garage.

7th -My Children s room both have a main light and a night light switch, this button is linked to both of them, only thing is the Main Switch has a on – level of  0 which causes only the night light to turn on. The best way for this is to link them manually then go back the the program for Smarthomenet’s and change the turn on code to 0.

8th -Linked to my T1700 Thermostat.  Its linked by setting your thermostat to the desiered state then link like any other switch.  Very simple and clean.  I also link this button back to my PLC so I know its been pressed.