is there a command to get all of the existing modes
Is there a command or method to set hsmAlert to "intrusion", and if true, will it create an intrusion when hsmStatus is disarmed. (I know how to do it with a dummy device, want something that's more straight forward)
Is it possible to get HSM settings, such as delayArm and delayHome
Failed to find anything in the documentation and forum prior to posting.
Hello Andy
Appreciate your response. I found and reviewed that information prior to posting my questions. With some of the system's documentation not yet finished, the only way to get info on some things is to ask, then share it with other developers.
Arn
I'm not sure. I don't think we implement location.currentState, but I can check. The other thing I'll have to check on is how to get a past location event. If you can get the last location event with a certain value, the event would have the time stamp.
Let me know. Using the following would be ideal
location.currentState("hsmStatus")
Edit: The above statement failed as follows
groovy.lang.MissingMethodException: No signature of method: com.hubitat.hub.domain.Location.currentState() is applicable for argument types: (java.lang.String) values: [hsmStatus] on line 31
If the location event table is accessible, that should be a simple loop until a hsmEvent is found.
How is it displayed in System Events->Location Events?
If the startDate is omitted does the result begin with the latest event in the table. If startDate is required, is it the standard date time format and will it allow something that is a bit in the future to insure getting the latest events.
Without the max parameter the command failed for me.
Initial successful test used max:20. The result is a LIFO event list which is exactly what I wanted, but based on the command name and date expected a FIFO list. Changed the count to 1, giving just the last hsmEvent.
*Wondered: what would occur if the latest hsmStatus occurred prior to the "startdate" would it be returned?
The answer is NO. I tried startDate of newDate without the -1, nothing was returned because my last event was prior to the Start datetime.
@bravenelDoes using newDate() - 30 on the command, insuring something is ususally returned, create a bunch of overhead even when the max value is 1?
Useful Properties
event date is in propery "unixTime" or "date" depending desired format
I don't know, but I doubt it. It's a db search, so I would imagine that the search ends when it's found the max number of values, and that the date is a qualifier tested to stop the search.
If the DB is defined with the datetime or unixdate as primary or alternate key and the search is ordered descending, the date is a where clause, and the max:1 is a limit, then the DB's optimizer should fetch one row, then stop.
At any rate, I'm going with -30 and putting in some code error code just in case nothing is returned.
Ran each test -1, -30, and -100 on its own 3 times. Based upon the results it's my opinion that the startDate does not impact the DB fetch time in my situation, max: 1 event returned