Sensors not seen

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
kivi
Posts: 8
Joined: 05 Sep 2020 12:26

Sensors not seen

Post by kivi »

Hi,

I uploaded an official sketch to a Z-uno Shiled, with 4 sensors on ADC0-3:

Code: Select all

// Global variables

byte pin3SensorBinaryState;

byte pin4SensorBinaryState;

byte pin5SensorBinaryState;

byte pin6SensorBinaryState;

// Z-Wave channels
ZUNO_SETUP_CHANNELS(
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_GENERAL_PURPOSE, pin3SensorBinaryGetter),
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_WATER, pin4SensorBinaryGetter),
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_MOTION, pin5SensorBinaryGetter),
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_DOOR_WINDOW, pin6SensorBinaryGetter)
);

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);
}

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);
  }

  delay(20);
}

// Getters and setters

byte pin3SensorBinaryGetter() {
  return pin3SensorBinaryState;
}

byte pin4SensorBinaryGetter() {
  return pin4SensorBinaryState;
}

byte pin5SensorBinaryGetter() {
  return pin5SensorBinaryState;
}

byte pin6SensorBinaryGetter() {
  return pin6SensorBinaryState;
}
After added to Fibaro HC2 only a motion sensor is visible, it is in ADC0. Where is the other sensors?
User avatar
PoltoS
Posts: 7571
Joined: 26 Jan 2011 19:36

Re: Sensors not seen

Post by PoltoS »

HC2 does not support some combinations of channels. Try to tweak with different channels order to get best working combination
kivi
Posts: 8
Joined: 05 Sep 2020 12:26

Re: Sensors not seen

Post by kivi »

Thanks, not a good news, it will be long...
Post Reply