I decided to go through and re-architect a few things in my system to gain some flexibility. I really wanted to be able to use all the buttons on my Insteon Keypads to trigger scenes and modes in OpenHAB, but I also wanted the buttons to be controlled by OpenHAB to indicate when certain scenes and items were turned on.
I followed the Insteon setup instructions and verified that I can in fact turn all buttons on from OpenHAB and get status from all buttons.
Here are the group items I created:
Switch HomeMode "Arrive Home Scene" ["Switchable"]
Group:Number:SUM HomeModeController
Group:Dimmer HomeModeItems
And the Items I use in the rules:
Switch EntryLightKeypadButtonB "Entry Light Keypad - Home Mode" (HomeModeController) {insteonplm="3D.88.42:F00.00.15#keypadbuttonB,group=0x14"}
Switch BackDoorKeypadButtonB "Back Door Keypad - Home Mode" (HomeModeController) {insteonplm="43.68.C0:F00.00.15#keypadbuttonB,group=0x84"}
Dimmer TableLamp "Table Lamp" (LivingRoom, Lights,
MovieSceneItems, HomeModeItems,
MorningModeItems) ["Lighting"] {insteonplm="2F.47.8A:F00.00.13#dimmer"}
Dimmer EntryLight "Entry Light" (LivingRoom, Lights,
MovieSceneItems, HomeModeItems,
MorningModeItems) ["Lighting"] {insteonplm="3D.88.42:F00.00.15#loaddimmer"}
Switch PorchLight “Porch Light” (FrontPorch, Lights,
HomeModeItems) [“Lighting”] {insteonplm=“3D.44.19:F00.00.02#switch”}
I grouped some lights together in scene groups and I created rules like the following:
rule "Home Mode Control"
when
Item EntryLightKeypadButtonB changed or
Item BackDoorKeypadButtonB changed
then
if (EntryLightKeypadButtonB.state == ON)
{
if (HomeMode.state != ON)
{
HomeMode.sendCommand(ON)
}
}
else
{
if (HomeMode.state != OFF)
{
HomeMode.sendCommand(OFF)
}
}
end
and this to update the buttons:
rule "Sync Home Mode Controllers"
when
Item HomeMode received update
then
if(homeModeUpdateTimer == null)
{
homeModeUpdateTimer = createTimer(now.plusSeconds(2))[|
HomeModeController.members.filter(item | item.state != HomeMode.state).forEach[controller|
controller.sendCommand(HomeMode.state.toString())
]
homeModeUpdateTimer = null
]
}
else
{
homeModeUpdateTimer.reschedule(now.plusSeconds(2))
}
end
And the HomeMode rule itself:
rule "Home Mode"
when
Item HomeMode received command
then
if (receivedCommand == ON)
{
HomeModeItems.members.forEach[item|
if (item.acceptedCommandTypes.contains(PercentType))
{
if (item.state != HomeModeLevel.state)
{
item.sendCommand(HomeModeLevel.state.toString())
}
}
else
{
if (item.state != ON)
{
item.sendCommand(ON)
}
}
]
}
else
{
HomeModeItems.members.filter(item|item.state != OFF).forEach[light|
light.sendCommand(OFF)
]
}
end
I used this technique in other areas of the house, like the kitchen and it works pretty well. But in this case I push the button on the keypad, the log tells me the button changed to ON, the HomeMode items gets the command ON, each item in the HomeMode group gets the command, but the items don’t actually change. It’s like they just don’t get the message.
When I trigger the scene from the Sitemap on my phone or browser all items come on perfectly every time. It’s only when I use the buttons that the items don’t respond properly. So I’m thinking maybe message collisions with the buttons?
Am I overwhelming the Insteon Network? Is there anything I can do to get around this? Or anything I can do to make this work better? Any suggestions? At this point I’ve messed around with it so much I’m at a loss as to where to go next. It seems to work well in some areas of the house but not others.
Any suggestions are really appreciated since as of now I feel like my only option is to redesign things again and I was really hoping not to have to do that.