Premise KeypadLinc Support

Motorola Premise
John,

I was wondering if you had made any progress on this? I would be happy to beta anything you might be working on.

Kaz
 
Sorry guys. My "Day" job has been especially brutal the last 12 months. I haven't made much progress on this, yet. The quick-look I did make showed that this is a little more complicated than I thought. I've got to come up with a whole new synchronization scheme to make sure there isn't a race-condition created.

I'm also working on adding support for the new Insteon motion detector being offered by SmartHome. The biggest problem with my setup is the dependence on X-10 motion detectors. They aren't very reliable and I'm hoping the Insteon models work better.
 
John,

Good to hear from you. I'm glad things are going welll for you. I look forward to a day when you have a chance to do some more work on this. Until then be safe.

Kaz
 
I'm posting a preview of V2.0 in the downloads area. It adds support for the load on KeypadLincs. In other words, you can turn a connected light on or off from within Premise. I also included code for the new motion detector. I don't have one to test yet (on order), but the driver makes heavy use of object-oriented techniques, so it "should" work. Unfortunately, I haven't implemented the cross-connection feature yet. It's going to be a bear ;)

Let me know how it works for you.
 
John,

Thank you for posting this. I have a a couple of questions in it's use. I went ahead and add/removed the existing Insteon driver. Then copied the 2.0.2 minibroker into modules, and deleted the older minibroker. I then went to addins and checked the box next to the new minibroker. At this point I rebooted the comp, and once it was running I added 7 lights to the entry way. KPL_2 through KPL_8. I then linked these to loads. So far so good. When I click the PowerState switch on any of the of these the corresponding load is switched on and off. <cheer> however the indicator light on the KPL itself does not change to show that the load on that particular switch is on. Did I do something wrong?


Kaz
 
Not there yet with the driver. This version only adds the support for a load on the keypadlinc. I'll be posting a version shortly that deals with cross-linked switches controlling a single light (e.g simulates two-way control of a light). In that version, if you turn on the "master" via Premise (or manually on the switch itself), the "slave" will also turn on and vice-versa. KeypadLinc button control is a little more difficult.
 
There's a new V2.0.x preview in the downloads section. It's not completely regression tested, but has a few new features. Sorry Kaz, it doesn't manipulate the lights on the keypadlinc yet ;)


Thanks,

-John
 
Kaz,

I was thinking about what you're trying to do and I think I have a solution for you that was in the driver all-along :(

I think the first thing you need to do is cross-link all of the insteon devices (including buttons on the KPL) that are related in your environment. That should let you reflect the state of one device on the other related devices. Judging from your posts, you may have already done that.

If I understand you correctly, you're looking to make sure the state of the keypadlinc button matches the state of the device it would normally control if it were turned on/off through Premise. You can do that by using Insteon Groups. Highlight Insteon Root under custom devices and find a property called SetGroup. Change it to something other than 1 or 255 or any other group you may already be using. Put Insteon Root into Link Mode and then press and hold the KPL button you want to associate with this group. It and the OFF button should flash after about 5 seconds. Go over to the other switch you have associated with the KPL button you used linked to Premise, and press and hold it ON until the load flashes twice. Go back to Premise and turn link mode OFF.

Under Insteon Root, you should see a property called "Detect". Click it and in a few seconds a device should appear under the Insteon Root tree called InsteonGroup_XXX, where XXX is the group number you just created. Just to be safe, go back and adjust the SetGroup property back to 1. That will prevent any other devices from inadvertently joining the group you just created the next time you link devices.

Okay, now you have a Group Device under Premise that, when you turn it on or off, it will command all of the devices in the group (including the KPL button) to the same state (on or off).


I think this should get you closer to what you want. Also, let me know how the preview of 2.0.x is working for you.

Thanks,

-John
 
John,

Thanks mate. I would love to try both 2.0 as well as the grouping idea, however work has taken me away from home for an extended period. I hope to be back in about 2 months and will certinly give it a go then. Thanks for your constent support.

Kaz
 
John,

Thanks mate. I would love to try both 2.0 as well as the grouping idea, however work has taken me away from home for an extended period. I hope to be back in about 2 months and will certinly give it a go then. Thanks for your constent support.

Kaz
 
John,

I was home for the holiday weekend and took some time to load 2.0.4 onto my server. I went ahead and tested first the "connectedDevice" property and can report it works great!. I then as suggested added 5 lights to InsteonGroup_2 and using the code below I found the following.

Code:
With Devices.Ademco.ApexDestiny6100.Partitions.Partition_1

	'Check if the current time is between Sunset and Sunrise
	If times.sysTime > times.sysSunset(times.sysDate) Or _
		times.sysTime < times.sysSunrise(times.sysDate) Then

	
		Select Case .SecurityState
		case 0 '0 - Away
			'Turns off all internal lights
			addTimer 60,"devices.CustomDevices.Insteon_Root.InsteonGroup_2.PowerState=FALSE",1,this.Name
			'Turns on the porch light for 1 minute
			addTimer 60,"Scenes.Porch_Light_60s.Play=TRUE",1,this.Name
		case 1 '1 - Disarmed
			devices.CustomDevices.Insteon_Root.InsteonGroup_2.PowerState=TRUE		
		case 2 '2 - Home
			'Turn off the outside entry light if it is on
			If Home.House.First_Floor.Entry.RelayLight.PowerState=TRUE Then
				Home.House.First_Floor.Entry.RelayLight.PowerState=FALSE
			End IF
		End Select		
			
		Else 
			'Default to lights off
			Scenes.Lights_Off.Play=TRUE
	End If
	
End With

The lights in InsteonGroup_2 came on but slowly, sometimes taking up to a minuet for all 5 lights to turn on. There was one exception to this. The KPL8 that is a member of group InsteonGroup_2 never turned on. I repeated this a number of times and finally changed the code to this which works as expected.

Code:
With Devices.Ademco.ApexDestiny6100.Partitions.Partition_1

	'Check if the current time is between Sunset and Sunrise
	If times.sysTime > times.sysSunset(times.sysDate) Or _
		times.sysTime < times.sysSunrise(times.sysDate) Then

	
		Select Case .SecurityState
		case 0 '0 - Away
			'Turns off all internal lights
			addTimer 60,"Scenes.Lights_Off.Play=TRUE",1,this.Name
			'Turns on the porch light for 1 minute
			addTimer 60,"Scenes.Porch_Light_60s.Play=TRUE",1,this.Name
		case 1 '1 - Disarmed
			Scenes.Lights_On.Play=TRUE			
		case 2 '2 - Home
			'Turn off the outside entry light if it is on
			If Home.House.First_Floor.Entry.RelayLight.PowerState=TRUE Then
				Home.House.First_Floor.Entry.RelayLight.PowerState=FALSE
			End IF
		End Select		
			
		Else 
			'Default to lights off
			Scenes.Lights_Off.Play=TRUE
	End If
	
End With

As you can see I had to create scenes that mimic the functionality of the InsteonGroup. With this configuration the lights in the scene including the KPL8 all turn on within seconds of each other.

The second issue remains in that the status indicators on the KPL8 never change to reflect the status of the bi-directionally cross linked SwitchLincs using Premise control. If I manually turn on a cross linked SwitchLinc the KPL8 reflects the proper state. And pushing a button on the KPL8; the cross linked SwitchLinc properly reflects the status. The addition of the "connectedDevice" property helped as I no longer need to programmaticly activate the slave SwitchLincs in a cross linked pair when I send a powerstate=true to the master.

So in short "connectedDevice" thumbs up. KPL's correctly displaying cross linked device status still not working. And a KPL8 in a Insteon group will not activate the primary load if sent a PowerState=true. If any of the above is working for you then let me know and I'll go back and do some more testing

I am going to leave 2.0.4 running while I head back south for the next 6-8 weeks. I'm sure my wife will comment if there are any bugs (grinning and smirking). I love qualified testers!
 
My wife is the same way :D

Sounds like we have two things going on here. First, all lights in "Group 2" should come on at the same time. The fact that you are seeing them come on in sequence indicates that the group broadcast command isn't reaching all of your devices. The group "cleanup" messages are turning the lights on. First we need to verify that Group 2 on your PLC actually has all the devices linked properly. To do this, click the "Detect" property under Insteon Root. After the progress bar goes from zero to 100%, check under the InsteonGroup_2 device and see if all of the devices you expect are listed under that group. If not, try relinking those devices (don't forget to set the SetGroup property to 2) and run detect again.

If the devices you expect are there, try manually controlling Group 2 and see if all the lights in that group behave properly. If not, you may need to consider adding another Insteon access point to your setup to bridge the signals across the wiring in your house. I ran into this and ended up needing three access points for our 3800 square foot home.

Second, the switch(es) on the KPL need to be as part of the PLC's "group 2" so the PLC is the master. To do this, you put the PLC in link mode using the LinkMode property (again make sure you have the SetGroup property set to the appropriate group), and press and hold the desired KPL button until the OFF light flashes. Take the PLC out of link mode, and manually try to turn Group 2 on and off. You should see the button reflect the state of the Group 2 powerstate.
 
addTimer 60,"devices.CustomDevices.Insteon_Root.InsteonGroup_2.PowerState=FALSE",1,this.Name
addTimer 60,"Scenes.Porch_Light_60s.Play=TRUE",1,this.Name
[/code]

Kaz, I have a question for you that's unrelated to Insteon and concerns the use of addTimer. According to the docs, you can re-initialize an existing timer by simply re-defining it (i.e. define a timer with the same timer name).

I've extracted the portion of your code where you define one timer, whose name is the same as the current object (this.name), and then you immediately re-define it (because you use this.name). I believe the intent is to create two timers but, at least according to the docs, there should be only one because you are using the same timer name. The 2nd addTimer definition should immediately trounce the first one.

I assume the code works as you wanted it to and that implies it isn't working as per the documentation! What the heck is going here? What have I misunderstood? :D
 
Back
Top