[PROJECT] Driver for Securifi Sensors

There are a number of Securifi sensors out there and I have a few of different types spread across my house. Unfortunately the generic ZigBee sensors do not seem to handle everything they can do. So I have made my own driver which is meant to compile them in one place. It is still very simple but relying on the general data ZigBee returns and some pieces I have figured out I have gotten a few things going. It has been tested with both the SZ-PIR02 Motion sensor and the SZ-DWS04 Door/Window contact sensor (extensively), should work for a few others, and I plan on adding more.

Features are:

  • Ability to detect motion
  • Ability to determine contact switch state
  • Ability to show tampered state and reset tampering
  • Ability to determine sensor type based on model
  • Ability to return battery state
  • Ability to return temperature
  • Ability to check a website (mine) if there is a newer version of the driver available (based on @Cobra's update method, same type I use in all my drivers)

I am hosting the code on my website, so you can check for the latest:
SecurifiSensors.groovy

1 Like

v0.3 of the driver is now posted. I have added support for the Almond Click into the driver. It will register a single, double, or long press on the button. Single clicks will increment the ButtonPresses state by 1, double clicks by 2. When it hits 4 it wraps to 0 (so if you do two double clicks ButtonPresses will show 0). A long press will clear the ButtonPresses and start counting the number of long presses. Since there is only 1 button the various Hubitat events will only show either 1 (the button was pressed) or 0 if they were not relevant.

Example:

  1. A short press will send an event "pressed" as 1. The two other events "doubleTapped" and "held" will both be 0.
  2. A double press will show "pressed" and "doubleTapped" as 1 and "held" as 0.
  3. A long press will show "pressed" and "held" as 1 and "doubleTapped" as 0.

I think I got those implementations correct per the Hubitat design:

I'm not sure what your example means, but I ported the Almond Click driver from ST a while back. I no longer use it because my daughter broke it but you can use it as a reference. It includes code that handles the an issue seen on both HE and ST where a single press would register twice after the button remained unused for a period of time.

@stephack: Thanks, but unless mine runs into problems I will just stick with it for now since I am trying to keep as much of the Securifi stuff in one place as possible rather than have a bunch of separate drivers.

My examples were meant to show how it responds per the Hubitat implementation. It only has one button, so you can have 1 (the only button) or none (0) pressed. Hubitat also has events for a double tap or long press, both of which the Click supports and reports, so I did those as well. But you are supposed to report which button double tapped or long pressed... and in this case it will always be 1, so I have to make sure it says what did NOT happen with that button. Guess I need to think of a way to have a clearer example.

v0.4 has been posted. This one adds support for the SZ-DWS08 Door/Window Contact Sensor (did not even know I had one until I was going through updating all Securifi devices and noticed the model). I also made a correction to how I was doing the initial ZigBee configuration that was causing an error I never noticed before... oops.

v0.5 has been posted. Support has been added for the SZ-DWS02 Door/Window Sensor and the SZ-KFB01 Keyfob. I had trouble pairing these which is why the delay. However @Diogynes provided some useful information about running a Configure with a Generic ZigBee driver selected and they were able to complete initialization. I hope to change my driver to accomplish this automatically in the future.

One "gotcha" with the Keyfob... Apparently the * button does not report as it is really meant for special functions of the remote (rest and pairing). So while there are four buttons only the other three report.

The 3 working buttons are indexed as 0 "Lock", 1 "Home", and 2 "Unlock" in the results. So you can go up to 4 with each but pressing a different button starts over. So press Lock 3 times, it will show 3 presses. Then press the Unlock and it will start over at 1.

Okay newbie here to hubitat and dealing with drivers. I have 3 clicks and a few securifi door sensors. I tried this driver with a click and it appears as a button. I was able to use in the button app but its not functioning. it doenst show any pushes in the logs as well. I fiddled with it for some time with no luck. When copying the driver do i copy the entire thing? I saved the device and preferences as well as hit refresh and configure. Im sure its me and something im doing. Any advice and or help would be apreeciated, thanks

You can import the driver from the URL or copy and paste it (make sure to copy it all). There is also a debug preference that must be set for it to log info. It should list every button press.

If you do not mind, what model does Hubitat show for the clicks on the devices' page and is there a state variable listing what SensorType it recognized as (just to make sure it knows it is a click).

v0.6 has now been posted. There are NO functional changes to this one. I merely added more clusterId values to the parsing function, but none of them are used by any of these devices that I know of. Trying to keep my base code as common as possible.

@murv:
I just tried using the Button Controller app (is that what you were referring to?) and has it working to make a Google Home speak when the button was held. Are you still having any trouble with this?

Sorry for the late response. I had removed it and went about adding several devices as im moving from a securifi almond 3 to hubitat. I added a button controller for it, push to toggle a z wave outlet. It worked to turn it on and that was it. So i tried double tapped and that did the same thing. in the logs it was registering as button pushes everytime not held, or double tapped?

@murv82: I have noticed that the double press and held are a bit finicky. For example, the Click does not report a held until you hold it for around 5 seconds then let go. Double press cannot be too quick, or two slow.

It can count the presses also, but that is purely in software. I am debating about separating the Click and Keyfob into a separate driver. Then I can get rid of the tamper portion and I could make the number of presses have a variable maximum.

So i went and paired one of my contact sensors SZ-DWS04 and it came up as a moisture sensor upon pairing. i changed the driver to this one and its only coming up with info nothing about opened/closed?

If you open/close the sensor does it report? Right now I do not set a "default state" for the sensors when added because I will not know if they are open or closed when they are added.

I have noticed that Hubitat first identifies these as a moisture sensor for some reason. But selecting the driver should do it. I see it correctly identified as a Contact sensor from the model.

Also meant to ask, any further luck with the Click? You are the only one providing feedback, so I am grateful for it.

The click doesnt work well at all with double tap. Way more miss than hit haha. As for the door sensor i just opened/ closed it a few times not getting any changes. I paired it a few rooms away from the hub, i may repair it here in a few to see if maybe that helps.

Ugh. Neither of those make me happy but they are good to know. I will definitely have to do checks when I get home tonight.

For the DWS: Can you switch the DWS back to moisture sensor, perform configure, then switch back to the Securifi Sensors driver?

For the Click: Is it recording both of the double press, just as singles, or is it only thinking there is one press at all? If the former, maybe I can make it "fake" a double by remembering there was a recent (second or so) press already.

well one push gave me all this in the logs.

Huh... That log shows multiple short presses over the course of about 4 seconds. If you only pressed it once... The Click reported it a bunch. Could you do a long press (held) just to see the difference? The raw data yours sends matches mine, but if it reports repeatedly for the same action, I am going to have to figure out a way to overcome that.

one long push gave me all this :


8:45 is where it was long held