The Vera Community forums have moved!

Advanced => Programming => General => Topic started by: tbrock47 on November 20, 2017, 10:28:08 pm

Title: Device Last Change Time Value?
Post by: tbrock47 on November 20, 2017, 10:28:08 pm
Is there a baked in way to access the time of the last status change (reference variable) on a device?
Say, the last time a light was turned on or off. Or the last time a door sensor changed from opened to closed?
Title: Re: Device Last Change Time Value?
Post by: RichardTSchaefer on November 21, 2017, 06:43:50 pm
If you use PLEG .. for all inputs and derived conditions ... it maintains the last time the inputs were true or false, if they are binary, or the last two times they changed if they are numeric or string values.

There is no generic value in Vera ... some devices like a dimmer or thermostat have multiple things that can change ... so what time would be recorded.
Dimmer   - Level, and On Off State
Thermostat - Temperature, Heat Setpoint, Cool Setpoint, Operating Mode, Operating State, Fan Mode ...

Title: Re: Device Last Change Time Value?
Post by: tbrock47 on November 21, 2017, 06:47:38 pm
I'll have to look into PLEG then. The only other thing I could think of was running a scene triggered by any change and just maintain global time variables for every device.
Thanks.
Title: Re: Device Last Change Time Value?
Post by: parkerc on November 26, 2017, 02:49:39 pm
Hi

Depending on your coding capabilities, this old thread might be of interest.

http://forum.micasaverde.com/index.php/topic,19263.msg189566/topicseen.html#msg189566

It?s for UI5 but it makes references to capturing information and recording it against the device when a specific variable changes. I?m sure it could be tailored.
Title: Re: Device Last Change Time Value?
Post by: tbrock47 on November 26, 2017, 03:28:07 pm
Awesome. Thanks.
That looks interesting. I'll go over the thread tonight.
Title: Re: Device Last Change Time Value?
Post by: tbrock47 on February 19, 2018, 03:35:45 pm
Wanted to mention I finally got around to looking into PLEG.
I've implemented it and migrated all my scripted scenes, and holy cow is it so much easier to maintain than my 80+ line scripts.
Thanks for that!