Home Projects AVR Programming Guides Electrical Fundamentals Insteon Saving Electricity

Recent Updates

EasyGrow Greenhouse
Follow our adventure of assembling an 8x12 EasyGrow Greenhouse.
AVR Programming Guides
We have some nice AVR code samples to share. Lots of AVR goodies like timers, interrupts, and pin I/O for the beginner.
Watts Tables
Use these tables to help you determine how much various items in your house cost you by the day, month, and year.
Saving Electricity
A list of a variety of ways to help you save money by learning how much it costs to run things.
What is a Kilowatt Hour
Saving money on your electric bill starts with understanding what a kilowatt hour is.
How To Measure Watts
Learn a variety of ways to measure watts in your house.
Read Your Power Meter
By reading your power meter you can get a good idea of how much various electrical devices cost you.
Electronics Fundamentals
Learn some basic electronics fundamentals and see if you enjoy the field of electronics.

Adding Insteon Support to Visual Basic 6

Thanks to SmartHome and the SmartHome Device Manager (or SDM), this is really easy. Start a new Visual Basic project. Then click Project->References to bring up the list of ActiveX controls installed on your system.

visual basic insteon activex refence

Notice that the image above refences C:\Program Files\Smarthome\Timer Software\SDM3.exe

If you have not installed the timer software, but you have installed SDM from some other source, you may have to refence SDM2Server Library which lives in C:\Program Files\Common Files\Smarthome\DeviceManager.

Now that you have the SmartHome Device Manager referenced, you need to create an object to talk to. It is best to Dim WithEvents so that you can respond to Insteon events. Put this code in your Visual Basic Form:

Option Explicit
Dim WithEvents sm As SDM3

Private Sub Form_Load()
    ' create a new instance of the SDM
    Set sm = New SDM3Server.SDM3
End Sub

' this sub will be called when the
' PLC receives an Insteon Event

Private Sub sm_OnText(ByVal Text As String)
    Debug.Print Text
End Sub

You are now ready to start responding to Insteon events. Check out the next topic, Turn Your Insteon Devices On and Off.


Jason Bauer

Written by

Jason Bauer is an owner and programmer for Portforward.com. He's allergic to twitter and facebook, but you can find more of his articles in the Guides section.
Wednesday, 21-Mar-2018 11:26:08 PDT