State Changed Timestamp and Source of Change

Posted on
Sat Apr 29, 2017 10:02 am
vtmikel offline
Posts: 628
Joined: Aug 31, 2012
Location: Boston, MA

State Changed Timestamp and Source of Change

Hi-

I would like a separate status timestamp for when the last time a light's state was changed, keeping separate through another variable if the state change came from Indigo or not. I'd also like this information available within the Conditions for Triggers and Schedules. I think this would open up a lot of possibilities to include some more intricate behavior in our home automation actions.

Trigger: When Motion Sensor Turns off
Condition (any of the following):
- the lights in the room were last turned on manually and they were turned on more than 10 minutes ago
- the lights in the room were last turned on via indigo
Action: Turn off the lights in the room

Schedule: Every 10 minutes
Condition (All of the following):
- Lights are on
- Motion Sensor is off
- Last state change was more than 10 minutes ago
Action: Turn off the lights in the room

The above also embeds the request to be able to do date calculations within the conditions, which has also been a long time request of mine. Another example of this is when you have a timestamp in a indigo variable, and I want to calculate the difference in time between the timestamp and the current time. This is possible in a python script, but it would be great if it were possible in the Conditions tab natively.

Mike

Posted on
Sat Apr 29, 2017 11:26 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: State Changed Timestamp and Source of Change

- the lights in the room were last turned on manually and they were turned on more than 10 minutes ago

At first glance, this is the only thing that seems tricky to me. How would Indigo know about this? When you say manually, do you mean literally manually, or using a controller or a switch that is part of Indigo? If the latter, then this isn't tricky.

However, I achieve the same effect a different way:

Trigger: Motion sensor on
Action: Turn on light immediately AND turn off light, delayed 10 minutes, overriding any previous delay.

That way, after 10 minutes of the sensor being off, the lights go out.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Mon May 01, 2017 8:53 am
vtmikel offline
Posts: 628
Joined: Aug 31, 2012
Location: Boston, MA

Re: State Changed Timestamp and Source of Change

Hi-

By manual, I really mean an update to the status that came from outside of Indigo. At my house, that is assumed to be manual since Indigo is the only place that I have automatic actions. Regardless of it being a person pressing a dimmer switch, or using a app like HomeKit to turn on the light, that action should override any automatic actions that Indigo undertakes, so I'd like the information available to take it into consideration. Since Indigo gets the updates from Z-Wave, Insteon, and plugin devices, I'd like that metadata stored and accessible in Indigo.

Your suggestion of another way to accomplish this is missing a few things. In my trigger example, the lights might turn off after a quick 3 minutes (based on the sensor's off delay time) when they were turned on originally via Indigo, but a longer 10 minute duration when they were turned on manually.

I've never had luck setting delayed off actions on the Motion On trigger. They don't account for the scenario where the motion sensor stays on for a duration of time. You can be using the room for 10 minutes with the motion trigger turned on, the delay will kick in and turn off the lights. Unless there is some trick to this I'm not aware of...

Mike

Posted on
Mon May 01, 2017 9:27 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: State Changed Timestamp and Source of Change

So this didn't work for you even with the "override previous delay" option used?

If your "manual" on/off is in some way noticed by Indigo, I would expect the override delay options to work for this use case.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Tue May 02, 2017 12:32 pm
vtmikel offline
Posts: 628
Joined: Aug 31, 2012
Location: Boston, MA

Re: State Changed Timestamp and Source of Change

Can you explain more? Because the delayed actions have never worked for me for room presence. I mostly do this in hallways, where it can be assumed that if a person is present, that they are not staying still for long. Here's what I have experienced:

When a motion sensor becomes active, I'll turn on the light if it is off, and if the luminance of the room is low.

If I were to set a delay with override to turn that light back off, the light might shut off before the person leaves the area, since there would be no override, as the sensor has not changed from it's active state.

This is why I've typically set the off delay for the sensor, and created a second trigger for when the motion sensor becomes inactive to turn off the light.

In the case where I use a camera to detect room presence, I have to enter a timestamp into an indigo variable when a motion event occurs. Cameras don't have a "no motion" event, so I must use a schedule to calculate how long it has been since a motion event was triggered, and turn off the light after a certain duration. This is why I had the request to have date calculations available in the conditions tab within Indigo.

As I was saying before, I wish to have a shorter off duration when the light was turned on automatically, but longer when someone manually turned on a light.
I don't see how this is possible using delays unless you tell me something I didn't know.

Posted on
Thu May 04, 2017 9:36 pm
new2me07 offline
Posts: 84
Joined: Apr 07, 2017

Re: State Changed Timestamp and Source of Change

Two triggers... Motion On and a Motion last changed XXX
I haven't used Indigo long but the delay actions are not intuitive by any means, but theres a hundred ways to skin this cat. I think I set a variable in the actions then evaluate that and the actual device state for my Auto OFF.

Posted on
Fri May 05, 2017 6:17 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: State Changed Timestamp and Source of Change

I also use 2 triggers:
Trigger 1: Motion OFF, Action Turn off light Delay 30 minutes, override previous delay (probably not necessary)
Trigger 2 Motion ON, Action: cancel Delayed actions for Trigger 1.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest