Securifi Key Fob

I had to dig through several posts/drivers to get to the point where it pairs successfully and reads the button presses. There's several things that I still don't entirely understand how it works on the zigbee side that I want to read up on to understand better

This post - Went back to smarthings [But came back] - #145 by vjv clued me on to changing my configure function

From this (ST)

def configure(){
	log.debug "Config Called"
	def configCmds = [
		"zcl global write 0x500 0x10 0xf0 {${device.zigbeeId}}", "delay 200",
		"send 0x${device.deviceNetworkId} ${endpointId} 1", "delay 1500",
		"zdo bind 0x${device.deviceNetworkId} ${endpointId} 0x01 0x0501 {${device.zigbeeId}} {}", "delay 500",
		"zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 1 {${device.zigbeeId}} {}"
	]
	return configCmds
}

To this (plus adding the two functions (swapEndianHex and reverseArray)

def configure(){
	String zigbeeId = swapEndianHex(device.hub.zigbeeId)
	log.debug "Config Called"
	def configCmds = [
		"zcl global write 0x500 0x10 0xf0 {${zigbeeId}}", "delay 200",
		"send 0x${device.deviceNetworkId} 0x08 1", "delay 1500",
		"zdo bind 0x${device.deviceNetworkId} 0x08 0x01 0x0501 {${device.zigbeeId}} {}", "delay 500",
		"zdo bind 0x${device.deviceNetworkId} 0x08 1 1 {${device.zigbeeId}} {}"
	] 
	return configCmds
}

From there, I needed to figure out what was different in how to respond to the enroll request:

Eventually I found this driver: HubitatPublic/examples/drivers/haloSmokeCoDetector.groovy at master · hubitat/HubitatPublic · GitHub that clued me into the fact that for Hubitat, the enroll is super simple

zigbee.enrollResponse(1200)

Rather then adding it to the configure cmd like that driver does, I decided to add it into my parse function

if (description?.startsWith("enroll request")) {
    if (logEnable) log.debug "RECEVED ENROLL REQUEST: ${description}"
        List cmds = zigbee.enrollResponse(1200)
        result = cmds?.collect { new hubitat.device.HubAction(it, hubitat.device.Protocol.ZIGBEE) }
  }

Once I did that, reset, and re-paired, it all worked.

@snell - I did try that Securifi driver. One thing I noticed right off the bat is that you have a different fingerprint, which probably is why it's not detecting correctly. It looks like you were still using the almond click fingerprint

Yours

fingerprint profileId: "0104", inClusters: "0000, 0001, 0003, 0013, 0402, 0500, 0501, 0B05", outClusters: "0019", manufacturer: "Securifi", model: "ZB2-BU01", deviceJoinName: "Almond Click"

Mine

fingerprint profileId: "0104", inClusters: "0000,0003,0500", outClusters: "0003,0501", manufacturer: "Sercomm Corp.", model: "SZ-KFB01", deviceJoinName: "Securifi Key Fob"

1 Like

Frames tagged with profileId 0000 are ZDO messages and in the context of this driver should be ignored.

Ha! That fingerprint error is because I used to have them all combined and identified by model. Then I separated the buttons out because driver capabilities are not dynamic... Then I split the Keyfob and click drivers apart due to differences... And did not notice I deleted the wrong fingerprint. Thanks! I will get that corrected tonight. I typically set the driver per device specifically rather than rely on it being detected. Guess I need to remove and add them more often.

Plus, the configure information is interesting. Have to review that more.

Ok, my Securifi KeyFob driver is now fixed for the fingerprinting and I added the enroll as version 0.3.

I also have the workaround for the * button, based on if an 0013 is called without another button being reported within a second. So basically someone can only press (and expect to work) the * button if nothing (including *) has been pressed for ~10 seconds. Better than nothing though.

Somewhere in this thread it was mentioned that the AL-KFB01 keyfob has been discontinued... Dunno about the offical manufacturing status, but

they are still readily available from Canada, and
being Zigbee, they will work anywhere in the world (with @snells driver)

https://www.amazon.ca/Securifi-FBA_AL-KFB01-Key-Fob-AL-KFB01/dp/B00TBXMA8C


Securifi Key Fob, AL-KFB01-CA | www.staples.ca (bit pricey!!)

I have a securifi key fob that is detected by hubitat as a device I have installed your [Securifi KeyFob driver] is there anything else I need to do ? Currently for the device this is what I see.


is there anyway that a rule I create can see the 4 buttons separately and initiate different actions,

In Rules you can set a Button as the Trigger capability. It will as which button to trigger off of and what the value (pushed, held, double Tapped, etc...) happened. You could create Rules with as many of these as you want.

You can also set up a Rule with a Trigger capability based on "Button Device". This will automatically make it have 4 buttons (because the fob has 4) and you can set actions for each. This one is a bit simpler if you want just an immediate action to set up.

However, this key fob only readily detects 3 buttons. The * CAN be detected under certain circumstances but only because of a workaround I figured out. It does not work like the rest do. So I would only recommend using the 3 other buttons for things you want to really work. If you use the button device, you can always ignore button 4 (*).

I appreciate the quick response to my query, its such a nice community to be in.
Using the trigger capability and "button device" I can see the four buttons I am presuming the order is as per the drop down list in the device. upper left lock = 1 and home =2 etc.
I created a rule to test it but doesn't seem to work when I go to the device and manually click on the push button it works fine have two actions 1 button puts the plug on the second one puts it off .( I haven't used button 3 or the *... But the actions don't excite from the key fob button . what could I be doing wrong this is the screen shot of my rule.


The plug I am using is a peanut( securifi) which operates pretty well. I have a bunch of them connected to an Alexa through the hubitat.

Oddly, I have not tried the Button Device one before and I am not even sure where my keyfobs wandered off to at this time... So...

Can you enable Debug level logging for the keyfob device (I just looked at the code... wow... this one has not been edited in some time, I never even moved it over to my current version standards) and post a copy of the log when you press button 1, then button 2 (you have the right idea about which one is which). Also, if you can edit the Rule to enable Logging there... that could help as well.

I have a bunch of Peanut Plug devices around also. First thing I want to make sure is that the keyfob is actually sending it's button presses.

1 Like

the key fob is sending the button presses yes... I checked in the device and every time I click a button the button press count goes up ( upto 4 then resets)


pasted here is the log when I press 1 and then 2

ClearPauseShow Past Logs

search

dev:1712020-10-12 09:55:55.061 am debug4buttonremote - Button presses = 2

dev:1712020-10-12 09:55:55.057 am debug4buttonremote - MultiState Asterisk = true and Repeat = true

dev:1712020-10-12 09:55:53.987 am debug4buttonremote - MultiState Asterisk = false and Repeat = null

dev:1712020-10-12 09:55:53.983 am debug4buttonremote - clusterId = 0013, attrId = null - cmd = 00, data = [CF, 18, F3, 79, D7, 4F, 04, 00, 6F, 0D, 00, 00]. value = null

dev:1712020-10-12 09:55:44.201 am debug4buttonremote - Button presses = 1

dev:1712020-10-12 09:55:44.197 am debug4buttonremote - MultiState Asterisk = true and Repeat = true

dev:1712020-10-12 09:55:43.159 am debug4buttonremote - MultiState Asterisk = null and Repeat = null

dev:1712020-10-12 09:55:43.156 am debug4buttonremote - clusterId = 0013, attrId = null - cmd = 00, data = [CE, 18, F3, 79, D7, 4F, 04, 00, 6F, 0D, 00, 00]. value = null

--- Live Log Started, waiting for events ---

Good to know the driver is working properly at least. So the Rule is not triggering from them though... I will find one of mine and try the Button Device Rule so I can try to give some insight.

yes the driver is working properly
and if I click on the push button for the key fob in "devices" it does execute the related action.
The key fob press is not translating to the action in the Rule. You think I am doing something wrong there? I tried both " switch on" plug , as well as "toggle" plug . Toggle would be better so one button could do both on and off.. Eventually I want to try putting on a virtual switch that Alexa would recognize like I use with the smart things button.

Exact same issue here. If I set up single rules in RM of set all 3 buttons up as a Button Device nothing happens when I hit any of the buttons. Like you said if I use the button in the device driver it works like a charm.

Were you able to get it working?

Cheers,
Marcus

Somehow I missed the response from @sharadn... Not sure what is going wrong though and I will be honest I totally lost track of this.

Trying to find a key fob right now...

Thanks would be great if we can get this going :slight_smile:

Ok. It took a bit but I checked how the keyfob works (basically a refresher course for myself).
When you push a button it triggers the fob, triggers the driver, and can trigger a Rule. However, you cannot push that SAME button and have it work properly again. The problem is that Hubitat uses a "Pushable Button" capability. It only reacts to the event when a NEW button has been pressed. Press the same button over and over again and while the driver gets it and even increments the ButtonPresses value, the Rules and such only see that the same button #, thus "no change", thus "no trigger".

This is compounded by the fact that the Keyfob does not indicate when the button is not being pressed anymore. It only responds when the button is pressed, so the driver can only say "button #" pushed, no released, held, double tap, triple tap, any of that sort of stuff.

UPDATE:
So I did not find any EASY solution but a workaround should be possible. To make this easier I am posting a new version of the driver (0.7.0). What you can do is make a rule that has triggers on 2 custom attributes for the keyfob. ButtonName and ButtonPresses. If EITHER of those changed, you know a button was pressed. Then you have to have conditional actions that actually determine what changed. If ButtonName changed, it is easy... a totally different button was pressed. But if ButtonName stayed the same, then that means ButtonPresses changed that means the SAME button was pressed again.

This all could have been done before, but since I was already in there and noticed a bunch of other things needed I cleaned up a bunch of code, added my newer update checking... etc...

I am trying to configure the key fob as an alert for my husband to get hold of me within the house, if I am needed.
What is the rule change I have to make (based on driver 0.70), with the custom attributes?

Should be something like a rule with 2 triggers, if ButtonName changed or if ButtonPresses changed. Then in the actions you have conditionals. If the ButtonName changed you know the button pressed... Else you know ButtonName was pressed again (because ButtonName did not change but ButtonPresses must have to trigger the rule).

Sorry I cannot show an actual Rule, away from my Hubitats.

Thanks for that. I will make an attempt.
And what you are saying should eliminate the "one push and done" option?

Since these have proven flaky about presses, especially with the same button, this will HOPEFULLY help with that scenario.