How to make Insteon KeypadLinc button LED follow state of an item?

Hello! It seems like the Insteon binding is not being maintained at the moment (e.g. [Insteon] timeout changes with OH 5? · Issue #19059 · openhab/openhab-addons · GitHub) but are there any Insteon users out there that might have been able to make an Insteon KeypadLinc button LED follow state of an item? (In my case, I have Reed switch that tells me if my garage door is open and I’d like one of the KeypadLinc buttons’ LED to always reflect the open/close status.)

I created a rule to turn on or off the LED based on reed switch state changes but I suspect that some background Insteon sync (part of the binding) is messing with what my rule is doing so the LED is always turned off.

If you have experience with this I’d appreciate hearing from you.

Cheers!

Eloy.-

I know this used to work with the previous version of the binding that I maintained. Unfortunately, the binding was basically rewritten, so I stepped down and won’t maintain the current version of the binding.

In native Insteon, the buttons follow scenes, not devices. Create a scene for the button (I called them xxx_follower). Make the button and the device a controller and responder for that scene, and use the scene for any other devices (including OH) that control the device.

Source: Insteon user since it was first released, long time ISY user. This was the art at the time.

Hi @ranielsen , @tcgerhard ,

This ended up being user error, i.e. I shot myself in the foot…

I had this working until I changed the tracking Reed switch item to use states OPEN and CLOSED instead of 1 and 0, and I did not update the rules to use the new states, so the rules were not working correctly. But there never was a problem with the Insteon binding.

I think I was confused by the following verbiage in the Insteon binding documentation, especially the part about “for button toggle mode set to always on or off, only ON or OFF commands will be processed, in line with the physical interaction”:

“By default, the binding will only change the button led state when receiving on/off commands, depending on the keypad local radio group settings. For button broadcast group support, set the bridge parameter deviceSyncEnabled to true. Additionally, for button toggle mode set to always on or off, only ON or OFF commands will be processed, in line with the physical interaction.”

However, I guess none of this applies to me as the button is not associated with any scenes or devices; turning on or off a button’s LED by sending the corresponding ON or OFF command from openHAB works just fine.

Here’s what my rules look like, in case it helps others (one rule to always reflect the open/close status of the Reed switch, and another to send a command via 1-Wire to open/close the garage door when the KeypadLinc button is pressed):

rule "Garage Door Status Light"
when
	Item Garage_Door_Status changed
then
	if (Garage_Door_Status.state == OPEN) {
		Garage_Hallway_Keypad_Button_A.sendCommand(ON)
		logInfo("InsteonSync", "Garage door state changed to \"OPEN\". Sent ON command to KPL button A LED.")
	} else {
		Garage_Hallway_Keypad_Button_A.sendCommand(OFF)
		logInfo("InsteonSync", "Garage door state changed to \"CLOSED\". Sent OFF command to KPL button A LED.")
	}
end

rule "Handle garage KeypadLinc button A"
when
	Channel "insteon:device:9cc839ad8c:3389ce:event-button-a" triggered
then
	logInfo("insteon.rules", "KPL Button A was pressed. Sending pulse to garage door controller...")

	val curr_state = Garage_Door_Status.state

	// The first parameter is the timeout in seconds
	val String results = executeCommandLine(Duration.ofSeconds(5),
		"/usr/bin/owwrite", "-s", "192.168.76.112", "/87.000000000002/dob", "1")
        logInfo("insteon.rules", "owwrite ommand output: " + results)

	// For the keypad button LED to always reflect the door open/close status,
	// we need to set the LED to the previous state before executing the command
	// above to toggle the door. This handles the case where the button is pressed
	// and then before the door sensor is read, the button is pressed again.
	// Setting the LED to the final state will come later, and is handled by
	// the "Garage Door Status Light" above.
	if (curr_state == OPEN) {
		Garage_Hallway_Keypad_Button_A.sendCommand(ON)
		logInfo("InsteonSync", "KPL Button A pressed: Garage door is closing. Sent ON command to KPL button A LED.")
	} else {
		Garage_Hallway_Keypad_Button_A.sendCommand(OFF)
		logInfo("InsteonSync", "KPL Button A pressed: Garage door is opening. Sent OFF command to KPL button A LED.")
	}
end

I forgot to mention, I am running 5.2.

Thanks again for your replies.

Cheers,

Eloy.-

By the way, I can’t do this, or I misunderstand what you are saying… the interface to the garage controller (both to open/close the garage door and to read the Reed switch) is not Insteon, so I can’t link the KeypadLinc button to an Insteon device or scene. The interface to the garage door controller and Reed switch is a custom 1-Wire device, which is why I need openHAB to be the glue between Insteon and 1-Wire.

(OH has no issue controlling the button’s LED; the PLM is a controller linked to the button, is that what you were saying? If so, then yes, all is good there.)

Cheers,

Eloy.-