Security Sensor LastTrip behavior
-
I have tested this for quite few days now and it all makes a lot more sense at least for the logic I used. I am even wondering why one wouldn't create another timestamp variable "LastUntrip" rather than using LastTrip for both trip and untrip. It appears indeed that having it tag both types of event was the behavior on the vera and I think i will keep my version for the motion sensors since it makes all my motion sensed lighting behave with the delay expected.
-
Since openLuup is luup on steroids, I'm officially suggesting differentiating its behavior, while retaining the luup original one for compatibility. So, something like LastTrip/Untrip in a different service definition should work better than altering it and causing troubles to other plug-ins assuming a different behavior.
-
I have an alternate suggestion. Preserve the Vera Luup behavior, and create new state variables for the alternate behavior, perhaps TripTime and UntripTime? Maybe come up with a prefix to denote openLuup-specific states, and apply this throughout?
-
The reason for my post was to try to get opinions and insights for the source and usage of this behavior.
I like the @toggledbits ' suggestion. Though the initial behavior doesn't appear to be well thought through, I think it is water under the bridge and it would be a bit too risky to deviate from it. I was going to change my PR to add functionality rather than modifying existing ones. I am thinking of adding LastTripTime and LastUntripTime? -
The reason for my post was to try to get opinions and insights for the source and usage of this behavior.
I like the @toggledbits ' suggestion. Though the initial behavior doesn't appear to be well thought through, I think it is water under the bridge and it would be a bit too risky to deviate from it. I was going to change my PR to add functionality rather than modifying existing ones. I am thinking of adding LastTripTime and LastUntripTime?@rafale77 said in Security Sensor LastTrip behavior:
Though the initial behavior doesn't appear to be well thought through
You say that almost as if it wasn't the norm...
...and that would have gotten me banned over there...
Edit: to embellish with a more useful comment... regardless of how stupid the behavior, I guarantee you, from personal experience, that someone relies on it.
-
Ahhh, now I remember one more thing which bugged me about this. It is that ALTUI displays the LastTrip value for the sensors by default and the fact that it would display a time which did not correspond to the last trip event mislead me. In openLuup, this behavior is coded in the luup.variable_set function which means that I can't just modify it for specific devices using a different device implementation file. Maintaining the original behavior and just adding an extra variable would mean that modifications of ALTUI would be needed to change what it displays... right now the variable doesn't even relate to the time the variable last changed or was last tripped. It just shows the time of the last "luup.variable_set" for the tripped variable event.
-
Ahhh, now I remember one more thing which bugged me about this. It is that ALTUI displays the LastTrip value for the sensors by default and the fact that it would display a time which did not correspond to the last trip event mislead me. In openLuup, this behavior is coded in the luup.variable_set function which means that I can't just modify it for specific devices using a different device implementation file. Maintaining the original behavior and just adding an extra variable would mean that modifications of ALTUI would be needed to change what it displays... right now the variable doesn't even relate to the time the variable last changed or was last tripped. It just shows the time of the last "luup.variable_set" for the tripped variable event.
-
You are right, I just went back to the ALTUI code and I can see that it's hard to do. I am not so verse in JS so I tried avoiding it. It makes for more changes but it is the safer route.
to answer your question, let me test further to see if we can think of even better ways to do it.