OpenZWave / node-openzwave-shared

OpenZWave addon for Node.js (all versions) including management and security functions
Other
199 stars 113 forks source link

Receive data related to sensor by not clicking the action button #379

Closed danelo11 closed 4 years ago

danelo11 commented 4 years ago

Hello I'm currently trying to receive data from a Z-Wave Smoke sensor with a Aeotec Z-Stick Gen 5 Here is my piece of code related to 'node added' and 'node ready' events:

zwave.on('node added', function(nodeid) {
    sensors[nodeid] = {
        id: nodeid,
    manufacturer: '',
    manufacturerid: '',
    product: '',
        type: '',
        classes: {},
    ready: false
    };
});

zwave.on('node ready', function (nodeid, nodeinfo){ 
    sensors[nodeid]['id'] = nodeid;
    sensors[nodeid]['manufacturer'] = nodeinfo.manufacturer;
    sensors[nodeid]['manufacturerid'] = nodeinfo.manufacturerid;
    sensors[nodeid]['product'] = nodeinfo.product;
    sensors[nodeid]['type'] = nodeinfo.type;
    sensors[nodeid]['ready'] = true;
    for(var i=0;i<=sensors.length;i++){
        console.log(sensors[i]);
    }
});

This is what I'm getting:

id: 1,
  manufacturer: 'AEON Labs',
  manufacturerid: '0x0086',
  product: 'ZW090 Z-Stick Gen5 EU',
  type: 'Static PC Controller',
  classes: {
    '32': { '0': [Object] },
    '112': {
      '81': [Object],
      '220': [Object],
      '242': [Object],
      '243': [Object],
      '252': [Object],
      '255': [Object]
    },
    '114': {
      '0': [Object],
      '1': [Object],
      '2': [Object],
      '3': [Object],
      '4': [Object]
    }
  },
  ready: true
}

{
  id: 4,
  manufacturer: '',
  manufacturerid: '',
  product: '',
  type: '',
  classes: {
    '32': { '0': [Object] },
    '48': { '0': [Object] },

I saw that there is no way for the Z-Stick to wake up nodes, but when I press action button on the Smoke Sensor, I get the information I'm looking for:

   id: 4,
  manufacturer: 'FIBARO System',
  manufacturerid: '0x010f',
  product: 'FGSD002 Smoke Sensor',
  type: 'Smoke Alarm Sensor',
  classes: {
    '32': { '0': [Object] },
    '48': { '0': [Object] },

Is there a way to automatically receive the information that I'm trying to obtain from the sensor by changing some configuration on the .xml file or by modyfing some parts of the code? Thank you in advance Any help is very welcome

robertsLando commented 4 years ago

Did you tried to set option AssumeAwake to true?

danelo11 commented 4 years ago

I did and unfortunately I still get the same output

Fishwaldo commented 4 years ago

Battery devices are sleeping devices. There is no way to "remotely" wake it up. You could adjust the "Wake Up Interval" to have to wake up periodically, and set up polling for the values you are interested in, but it will chew through your batteries very quickly if its frequently waking up.

danelo11 commented 4 years ago

What a pity. As you said I'm afraid that by setting up a relatively short wake up interval I run out of battery very quickly. In fact I only need to do it once, since manufacturer data and so on are static so those values won't change. I can try to set up a poll for the values I'm interested in and once it's finished I can go back to the initial configuration of the Wake Up Interval.