Release Candidate 21 binding problems

Discussions about RaZberry - Z-Wave board for Raspberry computer
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Release Candidate 21 binding problems

Post by PoltoS »

Certainly because zway is already registered and has started. Your module should run before Z-Way.
digitaldan
Posts: 11
Joined: 11 Sep 2014 18:53

Re: Release Candidate 21 binding problems

Post by digitaldan »

That totally makes sense, I am loading this via the javascript file module, so I'm running up against the issue that during boot time the script gets loaded before the zway variable is initialized and it throws "TypeError: Cannot read property 'zway' of undefined". Is there something else I can do? Thanks!
digitaldan
Posts: 11
Joined: 11 Sep 2014 18:53

Re: Release Candidate 21 binding problems

Post by digitaldan »

to be more clear I am using the script below, this is fine if I load it once ZWAY is already running, but if I need to reboot the device then I get the "TypeError: Cannot read property 'zway' of undefined".

Code: Select all

  debugPrint("Binding enabled! ");
  var devices = global.ZWave["zway"].zway.devices;

  devices[2].DoorLock.data.mode.bind(function(){
    debugPrint("DoorLock.data.mode changed! " + this.value);
    global.http.request({
      method: 'PUT',
      url: "http://10.0.10.10:8080/rest/items/ZWAY_LOCK_GET/state",
      data:this.value + "",
      headers    : { "Content-Type": "text/plain" }
    });
  });
  devices[2].Alarm.data.V1event.alarmType.bind(function(){
    debugPrint("Alarm.data.V1event.alarmType changed! " + this.value);
    global.http.request({
      method: 'PUT',
      url: "http://10.0.10.10:8080/rest/items/ZWAY_LOCK_ALARM/state",
      data:this.value + "",
      headers    : { "Content-Type": "text/plain" }
    });
  });
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Release Candidate 21 binding problems

Post by pz1 »

digitaldan wrote:"TypeError: Cannot read property 'zway' of undefined"
I've encountered that several times. I got the impression that it worked after I did a z-way restart after the reboot. I haven't tested it thoroughly yet. (don't know either why it should work. I just observed it)

Which rc do you use? rc-25 has been released a little while ago. Going to try that tomorrow
Since 29-12-2016 I am no longer a moderator for this forum
digitaldan
Posts: 11
Joined: 11 Sep 2014 18:53

Re: Release Candidate 21 binding problems

Post by digitaldan »

Thanks for the heads up, I'll give rc25 a shot. I have had it work at bootup and not, its seems to depend on how quickly the zway module gets loaded in relation to when it loads the javascript file.
n0ahg
Posts: 87
Joined: 08 May 2013 23:41

Re: Release Candidate 21 binding problems

Post by n0ahg »

v2.0.0-rc28 is now out.

I can't see how to remove notifications so I stopped the service and deleted the file where they are stored! It only contained a few notifications left over from the merging of the z-wave functionality.
User avatar
Dude
Posts: 20
Joined: 21 Aug 2014 23:49

Re: Release Candidate 21 binding problems

Post by Dude »

Hi n0ahg,
can you tell me, in which file the notifications are stored - I cannot remove them too.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Release Candidate 21 binding problems

Post by pz1 »

Dude wrote:can you tell me, in which file the notifications are stored - I cannot remove them too.
see /opt/z-way-server/automation/storage folder
Since 29-12-2016 I am no longer a moderator for this forum
User avatar
Dude
Posts: 20
Joined: 21 Aug 2014 23:49

Re: Release Candidate 21 binding problems

Post by Dude »

thx!!
Post Reply