# "Notify with Timeout" project vision update mode

**URL:** <https://forum.inductiveautomation.com/t/notify-with-timeout-project-vision-update-mode/88051>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [March 28, 2024, 7:59pm UTC](https://forum.inductiveautomation.com/t/notify-with-timeout-project-vision-update-mode/88051 "2024-03-28T19:59:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlindstrom](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mlindstrom/32/30000_2.png) [@mlindstrom](https://forum.inductiveautomation.com/u/mlindstrom)\
**Post date:** [March 28, 2024, 7:59pm UTC](https://forum.inductiveautomation.com/t/notify-with-timeout-project-vision-update-mode/88051/1 "2024-03-28T19:59:46Z")

</div>

Vision projects have three update options; "Notify", "Push", or "None". "Push" is convenient for keeping all clients up to date all the time without having to click the "Project update available" banner on every single client. But "Notify" is needed to ensure no interruptions while users are holding "jog" buttons and similar.

It would be nice to have a fourth mode which shows the update banner with a 10-minute timer (configurable length). Users can click the banner to immediately update the client, or ignore it if they're in the middle of jogging something. Seems to me that'd be the best of both worlds, with all clients updating themselves automatically but avoiding interrupting people who are currently using the HMI.

> **[Client Update Modes | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/vision/vision-project-properties/client-update-modes)**
>
> Notify Versus Push Versus None

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 28, 2024, 8:10pm UTC](https://forum.inductiveautomation.com/t/notify-with-timeout-project-vision-update-mode/88051/2 "2024-03-28T20:10:24Z")

</div>

Not necessary. You can use a client timer event script to impose any timing/policy you like, in conjunction with [system.vision.updateProject()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-vision/system-vision-updateProject).

---

<div class="post-metadata">

**Author:** ![mlindstrom](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mlindstrom/32/30000_2.png) [@mlindstrom](https://forum.inductiveautomation.com/u/mlindstrom)\
**Post date:** [April 2, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/notify-with-timeout-project-vision-update-mode/88051/3 "2024-04-02T20:01:09Z")

</div>

`[System]Client/System/LastProjectUpdate` on my client appears to be the last time the client was updated.

[The docs](https://docs.inductiveautomation.com/docs/8.1/platform/tags/types-of-tags/system-tags#vision-system-client-tags) say it should be the _"Date of the last received update notification."_ So isn't that behavior incorrect?

Not the end of the world since I can set up a client script to record the current time when `[System]Client/System/ProjectUpdateAvailable` triggers, and that seems to be re-triggering when multiple updates are pushed in a row without client updating in between. Just pointing out that this behavior seems strange to me.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 2, 2024, 9:06pm UTC](https://forum.inductiveautomation.com/t/notify-with-timeout-project-vision-update-mode/88051/4 "2024-04-02T21:06:55Z")

</div>

I think you're misreading it as having something to do directly with the project update mode 'notify' (which, admittedly, it's confusingly worded).

I would expect "LastProjectUpdate" to change every time _the project actually updated_. _Not_ every time a new update was pushed from the designer; only when those update(s) actually applied to the currently running local project.

---

<div class="post-metadata">

**Author:** ![mlindstrom](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mlindstrom/32/30000_2.png) [@mlindstrom](https://forum.inductiveautomation.com/u/mlindstrom)\
**Post date:** [April 2, 2024, 9:33pm UTC](https://forum.inductiveautomation.com/t/notify-with-timeout-project-vision-update-mode/88051/5 "2024-04-02T21:33:45Z")

</div>

Okie-dokie, I agree it's confusingly worded but whatever, it is working now. For reference this is what I did:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/a/7a750fbecd4523314081822ce46de5824e6e2f67.png)

**Client Tag Change Script**  
Trigger tag:

```raw
[System]Client/System/ProjectUpdateAvailable

```

Script:

```python
if newValue.getValue():

	import random
	
	# Restart client "X" minutes after update triggered.
	
	# Random interval avoids overload on network switches, 
	# tag server, etc., from clients all updating simultaneously
	tagPath = "[Client]ClientAutoUpdate/MinutesToTrigger"
	value = random.SystemRandom().uniform(10, 30)
	
	system.tag.write(tagPath, value)
	
	# When project is first launch, only set RandomMinutesToTrigger
	# but not CurrentDateTime. That causes Trigger to become active
	# and next Designer update would result in client immediately updating.
	if not initialChange:
		# LastProjectUpdateNotification already updates itself when 
		# project update it NOT available.
		# Additionally update here so that multiple published updates 
		# will delay the inevitable client update, and NOT trigger
		# unnecessary multiple client updates.
		tagPath = "[Client]ClientAutoUpdate/LastProjectUpdateNotification"
		value = system.tag.read("[System]Client/System/CurrentDateTime")
		system.tag.write(tagPath, value)

```

**Client tags**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/a/5a2d6c2c0c64bb7f45e288fb2d29600f3a0e75cf.png)

| Tags | Properties |
| --- | --- |
| DateTimeToTrigger | Expression: `addMinutes({[.]LastProjectUpdateNotification}, {[.]MinutesToTrigger})` |
| LastProjectUpdateNotification | Expression: `if({[System]Client/System/ProjectUpdateAvailable}, {[.]LastProjectUpdateNotification}, now())` |
| MinutesToTrigger | Memory tag |
| Trigger | Expression: `now() > {[.]DateTimeToTrigger}` Script: `if currentValue: system.vision.updateProject()` |

**Header button**  
Visibility property binding:

```auto
[System]Client/System/ProjectUpdateAvailable

```

Text property expression:

```auto
concat(
	"Project update available. Auto update in ",
	if( 60 < dateDiff(now(), {[client]ClientAutoUpdate/DateTimeToTrigger}, "second"),
		concat(round(dateDiff(now(), {[client]ClientAutoUpdate/DateTimeToTrigger}, "minute"), 1), " min(s)"), // true
		concat(toInteger(dateDiff(now(), {[client]ClientAutoUpdate/DateTimeToTrigger}, "second")), " sec(s)")	// false
	),
	". Or click here to update now."
)

```

---

<div class="post-metadata">

**Author:** ![mlindstrom](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mlindstrom/32/30000_2.png) [@mlindstrom](https://forum.inductiveautomation.com/u/mlindstrom)\
**Post date:** [April 5, 2024, 5:22pm UTC](https://forum.inductiveautomation.com/t/notify-with-timeout-project-vision-update-mode/88051/6 "2024-04-05T17:22:50Z")

</div>

Edited script in post above to fix two things:

- MinutesToTrigger wasn't getting randomly set when client first launched, so all clients would start with the same delay time instead of random.
- Use `random.SystemRandom().uniform(10,30)` instead of `random.uniform(10,30)`. Otherwise all clients will pick random times -- but they will all pick the _same_ random time if they were restarted at the same time.
