September 13Sep 13 OK, I was trying to figure out how to tell if the last device update for a certain device was older than a certain amount of time. I know I could accomplish something like that by having each event start a program that waited some amount of time but I got to thinking, why can't I just check the device last update and compare it to either the system time or for example a variable unix timestamp.I don't think this works even though you can create an if statement in a program that looks like it should work:LastUpdate - [ID 00AF][Parent 0010]If'YoLink / Motion Crossroad' Last device update < '$On_Minutes Unix Timestamp'Any ideas? I want for example to run a program at 8 am that will tell me if a device has not had an update in the last 24 hours. Edited September 13Sep 13 by Andy P
September 13Sep 13 UD Mobile has where you can see the history of devices so you could look in there but I don't know if it is available to use in programs yet. I hope it will be coming to eisy ui eventually and that might open thigs up more in the future.
September 13Sep 13 If it is Yolink specific - the devices have a last update time (that gets updated when yolink send new data - it is updated even if the value does not change) - you can compare that to the system unix time (under system parameters) - both represents seconds after jan 1st 1980 e.g.if system unix time - last update > xxxx secondsyou may need to create a variable first (containing the difference) and then run a program that tests for the difference, but I am sure it can be done multiple ways Edited September 13Sep 13 by Panda88
22 hours ago22 hr Author OK, so I was able to store the system unit time into an integer variable, but no matter what YOLINK device I select, it does not store a value for the last update into the variable - always zero.Is that a bug or am I doing something wrong.. Edited 22 hours ago22 hr by Andy P
15 hours ago15 hr Solution It seems there is a bug in the eisy-ui interface - I have specified time with 2 possible value types - 1 being the actual time (unix time) and 2 if there is no time a text string showing that (indx, uom25) - This also shown when you pick the variable - it shows index, unixtime - I guess it picks the index (0 or 99) - not the unix time - although it programmed to be unixtime when the value is updatedI can remove the index, but in my mind it is a bug in the system - Note, if you use the AC, you can pick unix time and it works there - this is why I have not had issues so far
10 hours ago10 hr Author Ah yes, I see. Apparently there are two possible values but the eisy-ui does not allow you to choose the second one and defaults to the firstSo, I was able to use the AC to create the program:This one runs every hour. It doesn't really need to use the intermediate variables, but I used them to make sure it was working right.:Elapsed Time Check - [ID 00AB][Parent 00AA]If- No Conditions - (To add one, press 'Schedule' or 'Condition')Then$System_Unix_Time = [Unix Date/Time (seconds)]$Last_Update_Time = 'YoLink / Motion Crossroad' Last device update Unix Timestamp$Last_Update_State = $System_Unix_Time$Last_Update_State -= $Last_Update_TimeAnd I have another program that triggers when the $Last_Update_State is > the timeout value. I will be fixing the logic so it doesn't trigger on the first assignment.Thanks! Edited 10 hours ago10 hr by Andy P
10 hours ago10 hr Yes - I use something similarJari has promised to fix this in a future release of eISY-UI (simply dropping the non-numeric type)
Create an account or sign in to comment