Scene triggers only working with certain variables

I?ve had a scene trigger setup with AltUI/openLuup setup for awhile with a motion sensor based on an ?ArmedTripped? variable for awhile and it was working fine until about a month ago. Today I determined if i simply switches to using ?Tripped? instead, things started working again.

For completeness, I did verify both variables were updating and ArmedTripped was showing up in AltUIs watch table when things didn?t work.

There was a change in the way that native (i.e. non-bridged) security sensors are handled around that time. What device is it?

It?s a custom plugin I hacked for Hikvision cameras and the built in motion sensing they provide.

openLuup now handles the service [tt]urn:micasaverde-com:serviceId:SecuritySensor1[/tt] in the same way as Vera. At least, that’s the intent. I’ve tested Vera’s behaviour with several different dummy and real sensor devices to ascertain what it does. In summary:

[ul][li]user code should not attempt to set [tt]LastTrip[/tt] or [tt]ArmedTripped[/tt] variables[/li]
[li][tt]LastTrip[/tt] is automatically set when [tt]Trip[/tt] changes state (from 0 to 1, or 1 to 0)[/li]
[li]if [tt]Armed[/tt] is set, then [tt]ArmedTripped[/tt] is set to 1 when [tt]Tripped[/tt] changes to 1[/li]
[li]whether or not [tt]Armed[/tt] is set, [tt]ArmedTripped[/tt] changes to 0 when [tt]Tripped[/tt] changes to 0[/li]
[li]if set, then [tt]ArmedTripped[/tt] is not changed if the sensor is disarmed[/li][/ul]

From your first post, it seems that your scene is not triggering if watching [tt]ArmedTrip[/tt], but is working with [tt]Tripped[/tt]? The difference being, of course, that the scene will trigger even if the sensor is not armed.

That is correct.

[quote=“akbooer, post:4, topic:199546”][ul][li]user code should not attempt to set [tt]LastTrip[/tt] or [tt]ArmedTripped[/tt] variables[/li]
[li][tt]LastTrip[/tt] is automatically set when [tt]Trip[/tt] changes state (from 0 to 1, or 1 to 0)[/li]
[li]if [tt]Armed[/tt] is set, then [tt]ArmedTripped[/tt] is set to 1 when [tt]Tripped[/tt] changes to 1[/li]
[li]whether or not [tt]Armed[/tt] is set, [tt]ArmedTripped[/tt] changes to 0 when [tt]Tripped[/tt] changes to 0[/li]
[li]if set, then [tt]ArmedTripped[/tt] is not changed if the sensor is disarmed[/li][/ul][/quote]
This might be part of the issue. The code I leveraged is manually setting Tripped to 1, ArmedTripped to 1, and LastTrip to os.time() upon initial trigger of the device, and then setting Tripped and ArmedTripped back to 0 after a certain amount of time. Bad form? It?s interesting because this code seemed to work on the Vera, however it is much more reliable (like most things) on openLuup (now that I?ve modified it after the change in behavior a month ago).

Good news Ak, I modified the plugin to leave ArmedTripped and LastTrip alone as you specified, and I can now trigger a scene using ArmedTripped again. It?s what I get for using code I don?t understand I guess. Thanks for the help!

That’s good to know.

I can’t say for sure why it didn’t work, but I can imagine various scenarios which could explain it. Best leave alone now!