New Home

Recent Updates

New Home
Please visit us at our new home. All content has been moved there.














































































Set Insteon Timers with Visual Basic 6

Efundies.com - Making Electronics Fun

Make sure you have already followed the instructions to Add Insteon Support to Visual Basic.

Overview

Setting Insteon timers is done using XML. It is not very difficult, but the code can get a little messy. You may want to check out our free application, Insteon Timer Configs, which includes full source code.

First you create an XML string that contains all of the timers that you want to configure. Then you use sm.SendText to send the XML to the PowerLine Controller (PLC). The PLC will chew on the XML for a while. When it is done processing your timers, the PLC will send back to you "saladapp=free" in your sm_OnText callback.

It is a good idea to respond to "saladapp=free" with sm.SendText "listtimers". You will get back a list of the currently set timers which you can parse to verify that they were set.

All of this is illustrated in Insteon Timer Configs if you need furthur help.

Forming Your Timer XML String

A basic Insteon Timer XML string looks like this:

SetTimersXML=<Timers>
<ItemCount>1</ItemCount>
<Timer>
<TID Name="PLCTimer1">PLCTimer1</TID>
<DeviceList>
<Device DID="1" Address="07.B1.12" HouseCode="" UnitCode="" OnLevel="On" DeviceName="LRLamp">LRLamp</Device>
</DeviceList>
<TOD>08:00</TOD><PlusMinusMin>0</PlusMinusMin>
<DOW>SuMTuWThFSa</DOW>
<Security>NOSEC</Security>
</Timer>
</Timers>

If you want to control multiple devices, add them between <Device...> and </Device> tags inside the <DeviceList> section. Keep in mind, there should be NO LINE BREAKS in this string. It should be one long continuous string.

Once you have formed your XML timer string, simply send it to the PLC with the following command:

sm.SendText strXML

Then you can wait for "saladapp=free" in your sm_OnText routine.

If you want a prewritten function that codes your XML string for you, just grab the source to Insteon Timer Configs.

 

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.
 
Thursday, 18-Oct-2018 15:53:21 PDT