Author Topic: Fix for settings not saving in latest UI7  (Read 776 times)

Offline jstabb

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Fix for settings not saving in latest UI7
« on: April 28, 2017, 02:50:47 am »
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:
Code: [Select]
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:
Code: [Select]
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

Offline nallsre

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: Fix for settings not saving in latest UI7
« Reply #1 on: June 27, 2017, 08:23:04 am »
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.

Offline recurry

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Re: Fix for settings not saving in latest UI7
« Reply #2 on: August 19, 2017, 11:04:43 pm »
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

Offline bdparker

  • Newbie
  • *
  • Posts: 15
  • Karma: +1/-0
Re: Fix for settings not saving in latest UI7
« Reply #3 on: October 13, 2017, 06:47:56 pm »
Ah! For years now I've been trying to find a way to silence that double ding. Is there any way to stop it?