Z-UNO Vera Plus and multiple door sensors

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
dad4holmes
Posts: 3
Joined: 21 Apr 2019 19:08

Z-UNO Vera Plus and multiple door sensors

Post by dad4holmes »

Added to VERA network after uploading the code below. Pin3 works perfect. Looks like a door sensor and changes as I change the state of the pin. Pin13 also works great. Shows as an appliance.

I expected pins 4, 5, 6, 7, 8, and 12 to act like pin 3 but... They show up as "_Generic IO 2", "_Generic IO 3"... Do not look correct. I attempted to copy all the settings from the one that does work... Got it looking correct but still does not report changes in state... Any idea on how to get it to work?

Code: Select all

[code]// Global variables

byte pin3SensorBinaryState;

byte pin4SensorBinaryState;

byte pin5SensorBinaryState;

byte pin6SensorBinaryState;

byte pin7SensorBinaryState;

byte pin8SensorBinaryState;

byte pin12SensorBinaryState;

byte pin13SwitchBinaryState = 0;

// Z-Wave channels
ZUNO_SETUP_CHANNELS(
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_DOOR_WINDOW, pin3SensorBinaryGetter),
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_DOOR_WINDOW, pin4SensorBinaryGetter),
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_DOOR_WINDOW, pin5SensorBinaryGetter),
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_DOOR_WINDOW, pin6SensorBinaryGetter),
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_DOOR_WINDOW, pin7SensorBinaryGetter),
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_DOOR_WINDOW, pin8SensorBinaryGetter),
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_DOOR_WINDOW, pin12SensorBinaryGetter),
  ZUNO_SWITCH_BINARY(pin13SwitchBinaryGetter, pin13SwitchBinarySetter)
);

void setup() {
  pinMode(3, INPUT);
  pin3SensorBinaryState = !digitalRead(3);

  pinMode(4, INPUT);
  pin4SensorBinaryState = !digitalRead(4);

  pinMode(5, INPUT);
  pin5SensorBinaryState = !digitalRead(5);

  pinMode(6, INPUT);
  pin6SensorBinaryState = !digitalRead(6);

  pinMode(7, INPUT);
  pin7SensorBinaryState = !digitalRead(7);

  pinMode(8, INPUT);
  pin8SensorBinaryState = !digitalRead(8);

  pinMode(12, INPUT);
  pin12SensorBinaryState = !digitalRead(12);

  pinMode(13, OUTPUT);
}

void loop() {
  byte _pin3SensorBinaryState = digitalRead(3);
  if (pin3SensorBinaryState != _pin3SensorBinaryState) {
    pin3SensorBinaryState = _pin3SensorBinaryState;
    zunoSendReport(1);
  }

  byte _pin4SensorBinaryState = digitalRead(4);
  if (pin4SensorBinaryState != _pin4SensorBinaryState) {
    pin4SensorBinaryState = _pin4SensorBinaryState;
    zunoSendReport(2);
  }

  byte _pin5SensorBinaryState = digitalRead(5);
  if (pin5SensorBinaryState != _pin5SensorBinaryState) {
    pin5SensorBinaryState = _pin5SensorBinaryState;
    zunoSendReport(3);
  }

  byte _pin6SensorBinaryState = digitalRead(6);
  if (pin6SensorBinaryState != _pin6SensorBinaryState) {
    pin6SensorBinaryState = _pin6SensorBinaryState;
    zunoSendReport(4);
  }

  byte _pin7SensorBinaryState = digitalRead(7);
  if (pin7SensorBinaryState != _pin7SensorBinaryState) {
    pin7SensorBinaryState = _pin7SensorBinaryState;
    zunoSendReport(5);
  }

  byte _pin8SensorBinaryState = digitalRead(8);
  if (pin8SensorBinaryState != _pin8SensorBinaryState) {
    pin8SensorBinaryState = _pin8SensorBinaryState;
    zunoSendReport(6);
  }

  byte _pin12SensorBinaryState = digitalRead(12);
  if (pin12SensorBinaryState != _pin12SensorBinaryState) {
    pin12SensorBinaryState = _pin12SensorBinaryState;
    zunoSendReport(7);
  }

  digitalWrite(13, pin13SwitchBinaryState ? HIGH : LOW);

  delay(20);
}

// Getters and setters

byte pin3SensorBinaryGetter() {
  return pin3SensorBinaryState;
}

byte pin4SensorBinaryGetter() {
  return pin4SensorBinaryState;
}

byte pin5SensorBinaryGetter() {
  return pin5SensorBinaryState;
}

byte pin6SensorBinaryGetter() {
  return pin6SensorBinaryState;
}

byte pin7SensorBinaryGetter() {
  return pin7SensorBinaryState;
}

byte pin8SensorBinaryGetter() {
  return pin8SensorBinaryState;
}

byte pin12SensorBinaryGetter() {
  return pin12SensorBinaryState;
}

void pin13SwitchBinarySetter(byte value) {
  pin13SwitchBinaryState = value;
}

byte pin13SwitchBinaryGetter() {
  return pin13SwitchBinaryState;
}
[/code]
Post Reply