Getting / Setting Insteon information from the Venstar T1700 thermostat
March 1, 2009 at 3:29 pm | In General, Hardware setup, Software Setup | 4 CommentsTags: cool on, fan off, Fan on, getting T1700 Insteon Data, heat on, Home Automation, Insteon, Insteon T1700, Insteon Thermostat, PLC, SDM, sdmserver, vb2008, X10
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 0×02 command instead of 0×11 for on or 0×13 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“.
0×6b – 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.
0×6b – 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
'SendSm.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
'SendSm.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
0×6b – 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
0×6b – 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
0×6b – 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
0×6b – 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 0×6B we will be using the 0×6C for Cool and 0×6D 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!
New Pictures of Client ScreenShots
January 15, 2009 at 4:31 pm | In General | Leave a CommentTags: .net, actionscript 2.0, Home Automation, Insteon, insteon client, insteon group commands, insteon server, IO LINC, screenshots, server, vb 2008
As promised here are some new screen shots of the Client. Its totally revamped and I think in a cleaner format. Its a combination of VB2008 / Flash Action Script 2.0
Comments and feedback is appreciated!
More ways to speak to your Insteon Devices
January 5, 2009 at 6:55 pm | In Software Setup | 1 CommentTags: groups, Home Automation, Insteon, Insteon code, SDM, sdmserver, turn off device, turn on device, vb code, XP
Like many programs there is always more ways to do one thing.
Here is another way I found to talk to my PLC what I’ve been able to get is that i’m sending the direct HEX (PLM) commands to the PLC. Which in turn makes the processing faster. In my environment it helped a little but had its down sides.
My initial articles using the regular Insteon commands are here.
- Software: Get Insteon / Talking to your PC – Part 2
- Software: Get Insteon / Talking to your PC – Part 1
Turn on a group (SM is your VB PLC Object) Using the PLCHEX command
Im suspecting the first HEX codes are the address and command we are sending to the PLC
Example #1,
My PLC ID is 0D.51.32
Group I want on is “1A
Groups use :C5
Command: Turn on (11=On,12=Fast On,13=Off,14 = Fast Off,19=Poll, 10=Ping)
Power:Full (The last FF for 255 HEX)
Code;
Sm.SendPLCHex("02 40 01 A1 00 09 FD CB 0D 51 32 00 00 1A C5 11 FF)
Sm.SendPLCHex("02 46 01 42 10 9F") ' - Execute Command?
Advantages is that there is no ’sendtxt’ echo coming back or even a echo of my text going out, which for me makes the command process faster. And you still get the ‘echo’ in the same format coming in so no change to your program is needed if you are already capturing th text comming back.
Cons:There is no place to define the HOPS?. Sometimes can fail is you send to many commands one right after the other, Im suspecting that since you we are cutting the initial ack on the start it choke after too many commands. My solution to this was to pause between each command I sent to it. A good 1 seconds did more than just fine.
* BTW, I like to send the group commands twice since I dont do Group clean-up’s so I basically execute the second line twice.
Turn on a single device (SM is your VB PLC Object) Using the PLCHEX command
Example #2,
My PLC ID is 0D.51.32
Device I want on is :0A.0B.0C
Single Devices use :05
Command: Turn on (11=On,12=Fast On,13=Off,14 = Fast Off,19=Poll, 10=Ping)
Power:Full (The last FF for 255 HEX)
Code;
Sm.SendPLCHex("02 40 01 A1 00 09 FD CB 0D 51 32 0A 0B 0C C5 11 FF)
Sm.SendPLCHex("02 46 01 42 10 9F") - ' - Execute Command?
Hope this helps in your development, and drop me a line if this helps you…
2009 Update / Goals for this year
January 5, 2009 at 6:27 pm | In General, Hardware setup | Leave a CommentTags: coffee machine, Home Automation, Insteon, outlet linc
Well 2009 is here, hope it brings you all good things. This years proves to be exiting for me since i’m now fine tuning the system. What I mean by that is that now all switches are Insteon and I can get to nitty gritty to getting the little details done.
Tomorrow (Fingers crossed) the 6th Smart Home should be shipping my I/O Linc to replace my current Garage setup. The current one works fine but many times may fail to report that its closed. One thing for sure X10 devices suck up Insteon commands and vice/ versa. For Christmas I got myself a Outlet Linc to replace the Appliance Linc I was using the for coffee Machine. That device is worth every $. ($45) Not only does it look better it fits perfectly into any decora face plate. Here is the before and after pics.
Before
After
The top outlet is controlled by Insteon and the bottom one is always on. Perfect! It even has a button below the top outlet to turn this on and off at will. Besides here I dont think I can find any other place install one. But who knows!
I’ve also purchased a additional Access Point for the outside setup which only strengthens the network inside now that Christmas is over . There are some black spots in my home so a extra access point or two doesn’t hurt. I do admit as I have added in devices its hardly that the devices don’t respond.
My Task for 2009
1. Garage switch to Insteon from X10
2. Remove X10 transceivers and install ONE directly into the serial port (Take off those Insteon signal suckers)
3. Revamp the Insteon Client
4. Show how purchase the Insteon Thermostat. (I suspect a bit of the Tax return for this.)
My Christmas Decorations 2008
December 10, 2008 at 5:39 pm | In General | 1 CommentTags: 2008, christmas, creating insteon groups, groups, Home Automation, Insteon, outdoor insteon decorations
Here is my Christmas setup for 2008. No video yet but y I think you’ll be able to get the picture of what you can do with the LampLincs. My setup as of today consist of mainly blue and white. I have a indoor tree and two outdoors. Using 6 LampLincs and groups I can change the rate of the blue and white on all of them.
So I created groups which have various combinations of them. Here are some pics;
Here the deer is set a 50%. This is just a couple of days before we set them up outside.

Here is a side view of the home.with the deers setup outside. You can see the two outdoor trees with the two color setups. The deers since they have moving parts and motors and other devices are on relays
Here you can see the indoor tree blue and the outdoor white.
Trees at 50/50 white and blue
All tree 100% Blue
I basically have two lamp lincs on each tree for a total of 6. The Spots and the lights on the trunk are on Relay’s
I’ll include more of the outdoor setup so you can see how it is connected.
Some of the Lamp Linc’s ready to go outside.
New SmartHome IO Linc announced
November 30, 2008 at 9:37 am | In General | 1 CommentTags: Home Automation, Insteon, IO LINC, SimpleHomeNet, X10
Good news, Smarthome and recent and finally put out the I/O Linc! (Or at least set for 12/22/8)
In simple terms this will be able to replace my current X10 solutions for the Garage which consist of the X10 Flash and X10 Universal controllers. For what i’ve read you can ‘query’ the device to see if the device is open. That’s one thing I couldn’t do with the X10 modules
. Sadly sometimes it wouldn’t pick up the ‘closed’ state.
From the documentation, one of the 3 modes it has is that you can send a ‘ON’ and it would determine if contacts are closed and open and vice versa!. this way you can ‘link’ it to a KeyLinc and see its ’state’ from the keypad!
Hopefully they ship on 12/22 but with the experience of the motion sensor my bets are for 2009. Only downside is that you can only monitor/control 1 port at a time. But for $45 that’s fine for me. Both x10 devices on Ebay came to around $35, good news I can keep and us my existing contacts. So $10 more for a insteon solution sounds like a deal…
The other option I was looking at, (And saving for) was the Simplehome.net’s solutions Here
A little more pricey but you can monitor more than one input, for example rain detecion or another contact etc.
If your interest my original article which I used the x10 devices to open and monitor the garage can be found here.
Installing a Insteon Inline Linc Relay with a ceiling Fan and lamp
September 3, 2008 at 8:20 pm | In Hardware setup | 2 CommentsTags: ceiling fan, Home Automation, how to install, installing lamp and fan, Insteon, insteon inline linc, which wires are what on a fan, X10
Disclaimer, I’m not an electrician, and mainly just showing what I did, if you chose to do this you do this at your own risk, if you feel uncomfortable please have a professional install this!
Ok, here is my scenario and hopefully this can help you as well. I have a ceiling fan with a lamp which can be controlled by one switch. You have a couple of options, I chose to have the wall switch control the light and the Insteon Line Linc control the fan.
Here is a picture of the Inline Linc (Pictures are for the Dimmer model, for the fans you must use the relays)
I removed the tabs since its going to hide in the Canopy. They break off really easy…
Here is a pic of my fan/light its from Hunters Bay
My fan which is a hunters bay model has four wires coming out.
Blue - hot to the lamp
white – Neutral
black – hot to the fan.
Green- ground
From the Roof I have three cables
Red – Switch
White – Neutral
Black – Hot all the time
In your case this can vary, I recommend getting a tester and testing each one, the switch/red should lose power each time you hit the switch
Black will always have power. If you dont have a switch most likely you will have only black and white and a ground. you can still use the instructions below only tie in the blue with black as from going to the inline linc.
Scenario 1
To control my fan only thru the wall switch I would use the following (This isn’t touching the lamp yet)
From the roof wires to the fan wires,
white with white (neutral)
red(load from switch) to black/fan
You can also put the blue/fan and the black/fan to the red from the roof to power the both from one switch.
Greens all together / ground
Scenario 2 (My case)
Here Im using the wall switch to power the lamp and a Inline Linc to power the FAN (on/off) only. No dimming.
What im doing is breaking in the ‘black/fan’ circuit to put my inline linc, Sorry for the green being white
Here we go,
Part 1
All whites go together (from fan,roof, and inline linc)
The Black/roof goes to the black of the inlinelinc (To give it power)
The red/roof goes to the blue/fan to assign the switch to the lamp
Part 2
The fan black then connects to the red/inline linc and your set.
All grounds go together or where metals connect.
Check the canopy size that you can fit the linelinc before you start, in my case I had to install it above the fan housing and basically start all over.
You can see the wires from the InLine Link have a label on them
The inline Linc black with the black off the roof and the inline linc red with the black going to the fan
All whites together…
These are your neutrals.

Here you can see the blue (gives power to the lamp) with the RED coming from the ceiling. Which is the one a switch controls,
and yes its Insteon switch as well.
All whites together… Here you can also see clear the Inline Linc Red to the black of the fan
And the Inline Linc black to the black from the ceiling for power so you can see where were cutting in.
The “Configuration” database
August 23, 2008 at 6:38 am | In Software Setup | Leave a CommentTags: configuration database, Home Automation, Insteon, reading insteon configuration, sql 2005, vb, vb 2005, vb 2008, X10
As previously mentioned my main program depends 100% off a SQL database, below is a dump of my “Configuration” database, that holds all the system settings.
Many are loaded into memory the first time, or when I run PollDevices query this way the information is updated when needed. I know its a lot of information but maybe a developer can use these fields as ideas for their program.
Below are my two main functions I’ve created call (get a value or update a value).
Grabbing a value from the “Config” Database
For example this function will return the value of a specific query for example
lg_get_config("wake_up_time")
Public Function Lg_Get_config(ByVal field As String) As String
'------ SETUP CONNECTION TO DATABASE (CONNECTION STRING MAY VARY AMONG SYSTEM OR WHERE you have DB)
Dim sqlConnection35 As New System.Data.SqlClient.SqlConnection(My.Settings.InsteonConnectionString)
Dim cmd35 As New System.Data.SqlClient.SqlCommand
'------ SETUP READER TO GRAB THE NECESSARY DATA
Dim Reader As SqlClient.SqlDataReader
cmd35.CommandText = "SELECT * FROM Config where config= '" + field.ToLower.Trim + "'"
cmd35.Connection = sqlConnection35
sqlConnection35.Open()
'------ OPEN CONNECTION AND CHECK TO MAKE SURE
Do While sqlConnection35.State <> ConnectionState.Open
Loop
Reader = cmd35.ExecuteReader()
' --------- check for data, if not return 'FALSE' AND leave function
If Reader.HasRows = False Then
Lg_Get_config = False
Exit Function
End If
Reader.Read()
'---------- return the value and close all connections and exit.
Lg_Get_config = Reader.Item("value")
Reader.Close()
sqlConnection35.Close()
End Function
Setting a value in the “Config” Database
The next example updates a field, and is very similar just that it uses the SQL update command
For example lets say I want to update the “wake_up_time” to something else
lg_set_config("wake_up_time","9:00:00 AM")
Public Function Lg_Set_config(ByVal field As String, ByVal value As String) As Boolean
'------------- SETUP CONNECTION
Dim sqlConnection4 As New System.Data.SqlClient.SqlConnection(My.Settings.InsteonConnectionString)
Dim cmd4 As New System.Data.SqlClient.SqlCommand
cmd4.CommandType = System.Data.CommandType.Text
cmd4.Connection = sqlConnection4
'------ The Update Command to modify the field
cmd4.CommandText = "UPDATE Config SET Value= '" + value + "' WHERE config='" + field.Trim.ToLower + "'"
sqlConnection4.Open()
'--------- Since we are not getting anything in return this is a NonQuery Executre
cmd4.ExecuteNonQuery()
Lg_Set_config = True
sqlConnection4.Close()
Update_TimeStamp() ' - I update the TimeStamp Value so anytime its queried they know is been updated.
End Function
Data Dictionary The “Config” Database
marker – Int field
config – nvarchar(128)
value – nvarchar(255)
description – nvarchar(255)
* marker field is my primary key, this is also set to “Identity Specification” which means it will autopopulate with a incremental value, so no record is the same, example (1,2,3,4,5,6 etc)
Below is a dump of all my fields and a quick explanation of what they represent. Descriptions starting with RST are the ones that are updated by the system automatically. For example if I turn on the outside lights, I update the field at that moment to say it has been turned on.
| outdoor_turn_off_time | 10:32 PM | When will all outdoor lights will turn off |
| outdoor_turnedon | Y | RST, If outdoor lights are on? |
| extractor_girls | N | RST, If the extractor is on or off |
| extractor_girls_time | 10 | In Minutes, Timeout for the girls extractor |
| timer_randomlights | N | If the random lights are on |
| random_lights_min | 10 | Random lights timer in minutes |
| time_after_sunset_to_turn_on | 12 | Time in minutes after sunset the lights outside will turn on |
| temperature | 75% | RST, Current temperature |
| temperature_last_read | 6:40:29 AM | RST, When was the temperature last read |
| temperature_text | Mostly Cloudy | RST, Text from NOAA.GOV |
| temperature_image | http://rssweather.cachefly.net/images/weather-symbols/mcloudyn.png | RST, Local image |
| SunRise | 6:59:52 AM | RST, SunRise in time |
| SunSet | 7:56:07 PM | RST, SunSet in Time |
| Outdoor_turn_on_time | 8:08:07 PM | RST from program, Outdoor turn on time |
| fan_off_low | 15 | Turn off Fan Threshold |
| fan_on_high | 88 | Turn on fan Threshold |
| voicemails | N | RST,If Voicemails are present? |
| master_closet_timer | 3 | Master Closet Timer in Minutes |
| master_closet | N | RST,Master Closet is on? |
| alarm_clock_status | ON | Mine, Turn on Alarm clock, M-F |
| poll_devices_interval | 525 | Minutes to poll each device |
| poll_devices_next_poll | 8/23/2008 15:28 | RST, Next time to poll |
| master_closet_turn_off_time | 8/22/2008 22:39 | RST, Master Closet |
| extractor_girls_turn_off_time | 8/22/2008 21:46 | RST,Girls Turn off Extractor time |
| Entrance_turnedon | N | RST, Is entrance on? |
| entrace_turn_on_time | 8:01:07 PM | RST, What time to turn entrance on |
| time_after_sunset_entrance_turn_on | 5 | Time to turn on Entrace after SunSet in Minutes |
| house_state | NIGHT | House State (E,O,I) |
| wake_up_time | 6:15:00 AM | Master Wake up time, M-F only |
| time_after_sunrise_to_turn_off | 10 | Time after SunRise to turn off Nook (Sat and sun Only) |
| incomming_call | N | CallerID Found? – No Longer Used |
| incomming_stamp | 8/22/2008 17:29 | RST, TimeStamp to clear call (No longer used) |
| incomming_name | Luis Garcia | RST, Caller ID |
| incomming_image | luis.png | RST, Imaged pulled from Contacts DB |
| incomming_date | 8/22/2008 17:29 | RST, Incomming Time |
| incomming_number | xxxxxxxxxx | RST, Incomming Number |
| entrance_turn_off_pre | -5 | Time in minutes before turn off time to turn off the entrance only |
| entrance_turn_off_pre_time | 10:27:00 PM | From program result of entracne_Trun_off_pre |
| motion_hallway | N | Motion is detected in hallway |
| extractor_master | N | If the extractor is on or off |
| extractor_master_time | 10 | Timeout for Extrator Master |
| extractor_master_turn_off_time | 8/23/2008 6:18 | RST,Master Turn off Extractor time |
| sensor_hallway | N | IF Hallway Sensor is on |
| sensor_hallway_time | 6 | Timeout Hallway |
| sensor_hallway_turn_off_time | 8/23/2008 6:14 | Hallway Timeout |
| sensor_hallway_bypass | N | Set to N if normal and Y to ignoreTimer |
| sensor_entrance_last_seen | 8/23/2008 2:48 | RST, Last time movement was detected |
| sensor_entrance_rescan_timeout | 3 | Minutes before the entrance sends out another signal |
| sensor_entrance_bypass | Y | If sensor entrance is bypassed (Y)=dont check (N)=yes check |
| sensor_master_closet_bypass | N | If sensor master is bypassed (Y)=dont check (N)=yes check |
| sensor_hallway_last_seen | 8/23/2008 6:08 | RST, Last time movement was detected |
| sensor_master_bathroom_last_seen | 8/23/2008 6:09 | RST,Last time movement was detected in master batrhoom |
| sensor_den_last_seen | 8/22/2008 23:05 | RST,Last time movement was detected in DEN |
| sensor_garage_last_seen | 8/22/2008 20:59 | RST,Last time movement was detected in Garage |
| sensor_hallway_start_time | 6:00:00 PM | Time that the Sensor will kick in. Usually set 3pm since its day time it wont turn on |
| sensor_garage_door_state | CLOSED | Garage door if open |
| temperature_last_read_wdw | 6:40:29 AM | Last time temperature was read for WDW |
| sensor_outside_bathroom_last_seen | 8/23/2008 0:25 | RST,Last time movement was detected in master batrhoom |
| sensor_outside_bathroom_timeout | 25 | Outside bathroom timeout |
| sensor_outsidebathroom_enabled | Y | RST, Enabled or not? |
| music_playing_status | N | RST, Is Radio Music Playing |
| sensor_garage_door_state_last | 8/22/2008 20:58 | RST, Last time Garage was open or closed |
| sensor_garage_door_timer | 6/23/2008 20:48 | RST, Time is has been opened |
| decorations_status | OFF | Status of all decorations |
| sensor_den_timer | 8/22/2008 23:10 | RST, Time the Den will turn off it no movement |
| sensor_den_timer_timeout | 5 | Minutes, Den will turn off after no activity |
| sensor_master_closet_last_seen | 8/22/2008 22:36 | RST, MasterCloset Last Seen |
| decorations_on | 7:58:07 PM | Time Decorations turn on |
| decorations_off | 10:45:00 PM | Time Decorations turn off |
| decorations_after_sunset_on | 2 | Decorations turn on after sunset |
| speakers_status | OFF | RST, if speakers are on |
| coffee_machine_status | TRUE | CoffeeMachine timer if on or OFF |
| coffee_machine_timer | 6:20:00 AM | CoffeeMachine OnTime |
| sensor_laundry_last_seen | 8/22/2008 21:30 | RSt, LAST seen activity in Laundry |
| sensor_laundry_timeout | 3 | Minutes before laundry turns off |
| sensor_laundry_timer | 8/22/2008 21:33 | RST, When will it turn off |
| kelly_alarm_on | 6:15:00 AM | Kelly On_Time |
| kelly_alarm_status | ON | IF Kellys alarm is on or off |
| barbie_alarm_on | 7:01:00 AM | Barbie OnTime |
| barbie_alarm_status | ON | Barbie on-time |
| back_house_lights_on | 9:00:00 PM | When will the backlights turn on |
| back_house_lights_off | 9:30:00 PM | When will the backlights turn off |
| guilda_alarm_on | 6:15:00 AM | Guildas Light will turn on |
| guilda_alarm_status | ON | Guildas Alarm status |
| kelly_alarm_song | S:\Mp3\Hanna Montana6 – I Got Nerve.mp3 | Kelly AlarmSong |
| barbie_alarm_song | S:\Mp3\Abba\(1994) Thank You For The Music\Disc 1\21 – Abba – My Love, My Life.mp3 | Kelly AlarmSong |
| kelly_artist_songs1 | hanna mon | Kelly selected artist for Alarm |
| kelly_artist_songs2 | vanessa | Kelly selected artist for Alarm |
| kelly_artist_songs3 | ashley tins | Kelly selected artist for Alarm |
| barbie_artist_songs1 | cascada | Barbie Selected artist for Alarm |
| barbie_artist_songs2 | Abba | Barbie Selected artist for Alarm |
| barbie_artist_songs3 | Rick Springfield | Barbie Selected artist for Alarm |
| kelly_alarm_song_title | Hanna Montana – I Got Nerve | Last song Played |
| barbie_alarm_song_title | ABBA – My Love, My Life | Last song Played |
Flash:Showing the ‘time’ in flash continuously.
August 2, 2008 at 11:15 pm | In Flash | 2 CommentsTags: actionscript, cs3, Flash, Home Automation, Insteon, show the time in flash, timer, X10
Last week I was working on automating the house’s coffee machine. And a real neat feature I saw around was the ability to display updated content in flash.
In bare bones, simple copy and paste, below is the the code I used to update the clock each second.
Basically open a scene of one frame and insert the code below on it.
Here is a sample of my coffee machine with the time below. The images were done in Photo Impact and the using Flash CS3 and ActionScript 2.0
In your flash script insert in to frame 0 the following code by right clicking on the frame and selecting ‘action’
In my example above just create a dynamic text with the var setting as ‘txtTime’
Please remove the ‘Comments’ before copy and pasting.’ they are for showing what is being done and will give you errors if not removed
'-------------------- Setup Variables var timeint; '---------------- Set the timer to run the function called 'timer' each second or 1000 milliseconds timeint=setInterval(timer,1000); '------------------------ the function itself function timer() { '--------------------- grab the date, and break down by hours, minutes and AM or PM oDate = new Date(); nHours= oDate.getHours(); nMinutes = oDate.getMinutes(); '------------------------------------ If minutes is less the 10 then add a 0 in front so it looks like 01,02,03 etc. if (nMinutes<10) nMinutes="0"+nMinutes; nSeconds = oDate.getSeconds(); '------------------------------------ If seconds is less the 10 then add a 0 in front so it looks like 01,02,03 etc. if (nSeconds<10) nSeconds="0"+nSeconds; '---------------------------------------- If hours is over 24 then its PM. sAmPm = (nHours < 12) ? " AM" : " PM"; '--------------------------------- if hours >12 then subtract -12 nHours = (nHours%12 == 0) ? 12 : nHours%12; '--------------- Update Dynamic variabel to .txtTime on the _root layer. _root.txtTime = nHours + ":" + nMinutes + ":" + nSeconds + sAmPm } stop(); '---------- Remember to stop the movie if not stopped somewhere else.
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.




















