Fix for settings not saving in latest UI7

Sorry, I tried to PM this to cybrmage, but I guess I’m not allowed to PM yet.

My zone changes were not saving, and after verifying I had the latest version and reading a ton of posts here in the forum I decided to just throw it under a debugger. You have this pattern in all your update*Labels() methods:

		try {
			api.setDeviceStatePersistant(EVL3Vista.device, EVL3Vista.PANEL_SID, "Zones", labelsRaw); 
		}
		catch (err) {
			var	saveUrl = '/port_3480/data_request?id=lu_variableset&DeviceNum='+EVL3Vista.device+'&serviceId='+EVL3Vista.PANEL_SID+'&Variable=Zones&Value='+labelsRaw;
			jQuery.get(saveUrl);
		}

The call in the try block fails because it’s typo’d, the method name is setDeviceStatePersistent. Then the fallback method fails because the url is incorrect. You should use api.getDataRequestURL() for the correct base url, and uri encode the value. The working (both primary and fallback) code then looks like:

		try {
			api.setDeviceStatePersistent(EVL3Vista.device, EVL3Vista.PANEL_SID, "Zones", labelsRaw); 
		}
		catch (err) {
			var	saveUrl = api.getDataRequestURL()+'?id=lu_variableset&DeviceNum='+EVL3Vista.device+'&serviceId='+EVL3Vista.PANEL_SID+'&Variable=Zones&Value='+encodeURIComponent(labelsRaw);
			jQuery.get(saveUrl);
		}

There’s another bug in that you report “Changes saved” to the user even though both save attempts failed, but I stopped my editing there.

I hope that helps.

Thanks
-James

I have disabled my relays 10 or more times, saving the setting for each relay, in an attempt to silence the double ding every time Vera reboots. Each time Vera reboots, it returns the state for all of them from Disabled to Normal. Any advice would be appreciated.

Got this installed under UI7 and all seems to be fine after manually setting everything under advanced. The big issue now is none of the “CODES” stuff will save user codes and on the alarm partition it won’t store a PIN code so you can’t arm/disarm the system. It gives the message " No code in the PIN code input." . Is this a related problem? I’m don’t have time at the moment to dive in and debug this. The old version under UI5 didn’t have this problem at all. Can you offer any insight?

Thanks,
Ron

Ah! For years now I’ve been trying to find a way to silence that double ding. Is there any way to stop it?