Closed veeceeoh closed 5 years ago
Version 0.7b is ready for testing
Changelist
lastCheckin
, lastDrop
, lastStationary
, lastTilt
and lastVibration
to lastCheckinEpoch
, lastDropEpoch
, lastStationaryEpoch
, lastTiltEpoch
, and lastVibrationEpoch
, respectivelylastCheckinEpoch
and lastCheckinTime
, and 2) all custom time/date stamp attributes (e.g., lastDropEpoch, lastDropTime, etc.) with a default of DISABLED for both settingsangleX
, angleY
, angleZ
) to state
objects (currentAngleX
, currentAngleY
, currentAngleZ
) instead of custom attribute eventsThree Axis
capability and recording of threeAxis
events isStateChange: true
parameter from all events except TiltAngle
to avoid any redundant repeat events being posteddisplayed: true
& false
parameter from all eventsmotion active
, acceleration active
, and button pushed
events
Initial beta release of Hubitat Device Driver
motion = active
motion inactive
is timer-basedacceleration = active
acceleration inactive
is timer-basedtiltAngle =
valuebutton 1 = pushed
contact = open/closed
Notes:
Sensor Status: Purely for use in a Hubitat Dashboard, the custom attribute
sensorStatus
can be used for displaying the following states:Stationary
,Vibration
,Tilt
, andDrop
. TheOpen
/Close
states are not displayed because they can occur simultaneously during a vibration detected (motion = active
) state.Vibration/Shock detection: The sensor does not seem to work well for clothes washer / dryer cycle detection, and also no message is sent when the sensor is stationary. If "heavy" enough vibration continues, the sensor only sends subsequent vibration/shock detected messages every 60 seconds, so the device driver will is set up to reset
motion
toinactive
after 65 seconds as a default, with a user-adjustable reset time in the preference section of the device details page (see screenshot below).Tilt detection: The sensor sends a tilt detected message when it has been rotated in any direction, and both a Tilt Angle value message and XYZ accelerometer values message are sent when the sensor stops moving and has come to a resting position. Because Tilt detected is assigned to the
acceleration
capability, it also resets toacceleration inactive
using a timer - in this case, 2 seconds, not user-adjustable. The reason for 2-seconds is purely to give a visual indicator in a Hubitat Dashboard if the custom attributesensorStatus
is used. However, sinceacceleration
is state-based, it needs to be reset toinactive
when no more tilts are detected after some length of time.Tilt Angle: This value is sent after the sensor has been rotated and come to a resting position. It is a relative value, so in other words, the difference in angle from the sensor's previous resting position. There doesn't seem to be any built-in Hubitat capability that is well suited to assign to this data, so it is assigned to the custom attribute
tiltAngle
for events that can be used in WebCoRE, by a custom App, or displayed in a Hubitat Dashboard. It is not useful for determining an absolute open or closed position, however, which is why the XYZ Accelerometer value message data is used for that purpose.Drop detection: The sensor sends this message whenever a free-fall drop is detected. It seemed best assigned to a trigger action, so
button 1 pushed
is used.XYZ Accelerometer values: These values are sent after the sensor has been rotated and come to a resting position. Unlike the Tilt Angle report, they are absolute values, and in the device driver are converted to a 3-axis angle position. Although this calculated position is not extremely accurate, it is consistent enough to use for setting and storing absolute open and close positions. This is accomplished by putting the sensor in each position and then pressing the "Set Open" or "Set Closed" buttons in the device view page while logged into the Hubitat Hub (see screenshot below). The conversion to 3-axis positions includes a "margin of error" to allow for positions that don't exactly match the stored user-set position. I may make this margin value available for users to change in the device preferences.
Change Sensitivity Level: The sensor has 3 hardware sensitivity levels: low, medium, and high. Changing the level requires pushing the "Change Sensitivity Level" button in the device view page (see screenshot below). However, because no "level changed successfully" message from the sensor is passed on by the Hubitat hub (or in SmartThings, for that matter) and the current level cannot be queried by the Hubitat driver, I have not yet been able to confirm that the level change command works correctly. So I can't currently guarantee it will work on the Hubitat platform. I plan on opening a new forum thread to ask about the best method for sending the ZigBee write attribute command in this case.
An example screenshot from the device details page of my Aqara Vibration Sensor using the beta device driver: