Everspring HSP02 Motion Detector Driver?

I am fairly new to this so my question may be a little off.

I recently installed a Everspring HSP02 Motion detector on my HE hub. Its driver is listed on HE support as being compatible. A generic driver that was installed as part of the Inclusion process is what I have been using and have not been able to find anything else. The device's motion detection works fine with the Hub, but I cannot find access for changing any of the device's parameters nor get it to report anything but Active/Inactive and battery level on the HE activity logs .

The device page for this device has a Configuration Button but I have not been able to get it do do anything. Debug reports when the Configuration button is pressed but nothing else.

This motion detector has an internal Lux sensor parameter that can be used to set thresholds for activation levels. Its default value as it came in the box and after a factory reset does not seem to do anything with the lighting levels I have, which are typical day/night levels for a house. There are not any external light(s) shining into my house.

Is there any way the parameters of the HSP02 can be accessed and/or changed with the software provided with the HE hub? Or is there any way the readings from the internal Lux sensor on this hub can be used to respond to different lighting conditions? If you could tell me how to put the Lux reading from the HSP02 into a global Rule Machine variable that would be great.

Thanks in advance for any comments and/or suggestions in understanding or solving this problem.

Does it actually report he lux level under current states like in the picture below?
image

At9, thanks for the quick reply. On the driver page of the HSP02 the Current States reported are: Battery, Motion, and Tamper. The manual does not indicate any reporting criteria for Lux level, only a percent parameter setting for Z-Wave On activation. This would seem to indicate that a Lux level is not reported by the device and the only way to control activation based upon light levels would be by modifying the device lighting level parameter and letting the HSP02 do the work. This would not have as much flexibility as having the LUX level reported, but would be better than the timed window of operation I set up.

Having looked at the manual it is now obvious that being able to set all the parameters of the HSP02 would be important for it to operate well with the HE hub for lighting control. The default re-trigger interval for motion detection is 180 seconds, too long. The Z-Wave On-Off Duration default is set at 15 seconds, also too long. The only way to change the sensitivity of the HSP02's motion detection parameters is by software control as well.

I found SmartThings driver code for the HSP02 by Kevin LaFramboise on GitHub. With a web search, it is easy to find. This is open source code so using and modifying the code would be legal, provided the Apache License info is included in the code comments. The code for this driver includes setting adjustments for all the HSP02 parameters. I am not a programmer so I do not know how difficult it would be to modify to work with the HE, but this looks the it would be the easiest way to go. If you know of another way of doing this that works better, or better yet know of something already done that works, please post it here. Thanks, Rich

To change the parameters of the device, you have to swap the driver over to the Basic Z-wave Tool.

This driver will allow you to set each of the configuration parameters even if they are not exposed in the driver. Then just swap back to the Generic driver and you're all set.

1 Like

Ryan780, Thank you for the info on the Zwave controller driver. It made it very easy to get my two motion sensors up and running. I will have to play with the senors a bit to learn what the best settings/location will be and being able to easily change the device parameters is going to be a huge help. Thanks again, Rich

1 Like

I got everything but the light sensors working the way I want with my two HSP02 motion detectors. It appears the HE hub is activating my lights based upon the status condition (inactive/active) and that works fine for motion. However, the Generic Zwave driver does not seem to be reporting a HSP02’s Low Lux Level threshold trigger. According to the HSP02 manual with a low-level lux trigger condition: “the detector will emit Z-Wave ON Command (i.e. Basic Set Command (Value = Basic Set Level)) to controller and activate connected modules and lighting.”

Enabling Debug Logging, and then activating the motion sensor in both light and dark conditions results in an identical log of events. I have the Basic Set Level Value set to 90 and do not see it reported. So, it appears the HSP02 is going to need a different driver, probably its own, in order to report a low lux threshold trigger. The code for the driver mentioned in an earlier post on this thread looks like it would report the Basic Set Level Value with a low lux trigger. However, getting that driver code to work with the HE hub is way beyond me.

For now, I am happy to just use motion control with a set time period to control my lights. Being able to set the detector’s parameters helped a great deal and I appreciate the assistance received here for that. Since I am new to smart device control, there is a very good chance I might be missing or reading something wrong. If that is the case please let me know. Thanks, Rich

An attempt was made to get the ST driver code on github for the HSP02 to work with the HE hub. I got most of it to work except for the part updating the parameters and having light level control. Updating the parameters is not important since the Basic Z-Wave Tool is available. I think the lighting control portion is close to working, but the last step to get there is beyond me. It would be greatly appreciated, if someone could take a look at the code and see if there is an easy fix. Just a brief look at the code and telling me it is a big problem, if that is the case, would be appreciated as well. A summary of what I did, which may or may not make sense, follows.

Found and replaced all instances of “physicalgraph” with “habitat”. Using the Basic Z-Tool installed on the HSP02, ran the GetCommand Class Report to get the Class version numbers. The code for the driver Class Versions vs addresses is fortunately documented lines 285 to 293. The version values in the code here and where found elsewhere in the code were changed to reflect the values reported by the Basic Z-Tool. For instance, the code on line 395:

def zwaveEvent(hubitat.zwave.commands.sensorbinaryv1.SensorBinaryReport cmd) {

was changed from “sensorbinaryv2” to “sensorbinaryv1”. Before this motion was not being reported. A debug reported “Motion Active” event or something tied to now works and activates my lights with my Hubitat Motion Lighting App. With the exception of Notifications, none of the changes caused any errors when a Save was done with Habitat’s Code Editor. A Notifications v1 or v2 on line 405 would cause a Code editor save error, while any other single digit would not. Only a value of 3 in both the table line 288 and code line 405 would get Notifications (Tamper/Clear) to work correctly.

The code on lines 346 to 366 is supposed to test the luxThresholdSetting value and set a “closed” or “open” value to be used as a secondary Sensor Control. I tried different version values that would Save without error, for the Basic Class, and they did not seem to make any difference. I am not sure if there is anything here that would stop the code on lines 395 to 403 from running. That code correctly sets the Motion to “Active” or “Inactive”. The only other place “open” appears is in the block of code lines 93 to 117.

Although I have some experience with VBA programing, the language used for the device driver code here (C++ ?) means very little to me. I cannot tell if I still have a problem with a Class version being incorrect, if there is a problem with the code or if it is something else. If this is something simple and anyone can help out that would be great. If it is a headache not worth dealing with, hearing that would be helpful. The approach I took to this was probably crazy, and I appreciate the patience and time you took in dealing with that as well. A complete copy of the driver code is provided in the link below. Thanks, Rich

Everspring Driver Code

The ZwaveEvent, code (lines 349 and 350) below, is not activating with a Sensor event as evidenced by the log.info line not being sent to the log.

               def zwaveEvent(hubitat.zwave.commands.basicv1.BasicSet cmd) {	
               log.info "The BasicSet Cmd Value is ${cmd}"

The Zwave Tool indicates a Class Driver Version 1 for the Class Basic. I tried Version 2 and it did not work either.

The ZwaveEvent code (lines 399 to 401) below for the Sensor does Activate and send the log.info line to the log.

              def zwaveEvent(hubitat.zwave.commands.sensorbinaryv1.SensorBinaryReport cmd) {
              log.info "The Sensor Cmd Value is ${cmd}"

It would be appreciated if anybody could provide a clue as to why the Zwave event for commands is not activating or at least give a clue as to where I might begin looking for a problem. The complete driver code is provided in the link below. Thanks, Rich

Everspring Driver Code

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.