Z-UNO Enatrance Gate Control

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
Clie
Posts: 9
Joined: 06 Jun 2017 12:58

Z-UNO Enatrance Gate Control

Post by Clie » 05 Apr 2018 22:15

Hi all,

I have not received an answer in the Russian part of this forum, I'll try here :)

The task is a drive the Roger technology entrance gates + control the status of septic tank.

Gate: Binary sensor (open state) + 2 relays for opening / closing
Septic: Binary sensor of fullness sensor

I wrote a sketch:

Code: Select all

// Entrance Gate + Septic state 
  
#define RelayOpen     9
#define RelayClose    10
#define OpenState     17
#define SepticState   18
#define ZUNO_CHANNEL_NUMBER_ONE 1
#define ZUNO_CHANNEL_NUMBER_TWO 2    

// Variables
  
byte LastOpenState;
byte LastSepticState;
byte openswitch = 1;
byte closeswitch = 1;

// Always connect

ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_ALWAYS_AWAKE);

//Channels setup

ZUNO_SETUP_CHANNELS(
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_GENERAL_PURPOSE, getgate),
  ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_GENERAL_PURPOSE, getseptic),
  ZUNO_SWITCH_BINARY(getopenswitch, setopenswitch),
  ZUNO_SWITCH_BINARY(getcloseswitch, setcloseswitch)
 );

void setup() 
  {
    pinMode(RelayOpen, OUTPUT);
    pinMode(RelayClose, OUTPUT);
    pinMode(OpenState, INPUT_PULLUP);
    pinMode(SepticState, INPUT_PULLUP);
  }

void 
   setopenswitch(byte value) 
   {digitalWrite(RelayOpen, (value > 0) ? LOW : HIGH); 
   openswitch = value;}
     
void 
  setcloseswitch(byte value) 
  {digitalWrite(RelayClose, (value > 0) ? LOW : HIGH);
  closeswitch = value;}
     
void loop() {
  
      byte CurrentOpenState = digitalRead(OpenState);
          if (CurrentOpenState != LastOpenState)           
              {LastOpenState = CurrentOpenState;                 
               zunoSendReport(ZUNO_CHANNEL_NUMBER_ONE);}  

       byte CurrentSepticState = digitalRead(SepticState);
          if (CurrentSepticState != LastSepticState)           
              {LastSepticState = CurrentSepticState;                 
               zunoSendReport(ZUNO_CHANNEL_NUMBER_TWO);}}
             
   
      byte getgate() 
            {if (LastOpenState == 0) 
                  {return 0xff;}
             else 
                  {return 0;}}

      byte getseptic() 
            {if (LastSepticState == 0) 
                  {return 0xff;}
             else 
                  {return 0;}}

       byte getopenswitch()
            {return openswitch;}

       byte getcloseswitch()
            {return closeswitch;}

Questions:

In the HC2 the relays and the gate opening sensor are detected only.
Capture2.JPG
Capture2.JPG (31.77 KiB) Viewed 2107 times
Where is the septic sensor?

Why the gate open sensor triggered when the opening relay is triggered?
Capture1.JPG
Capture1.JPG (31.88 KiB) Viewed 2107 times
So strange.

User avatar
PoltoS
Posts: 5061
Joined: 26 Jan 2011 19:36

Re: Z-UNO Enatrance Gate Control

Post by PoltoS » 08 Apr 2018 21:51

Have you tried the special configuration parameter for HC2? It should solve the problem

Clie
Posts: 9
Joined: 06 Jun 2017 12:58

Re: Z-UNO Enatrance Gate Control

Post by Clie » 09 Apr 2018 14:15

PoltoS wrote:
08 Apr 2018 21:51
Have you tried the special configuration parameter for HC2? It should solve the problem
Why no second binary sensor recognized?

User avatar
PoltoS
Posts: 5061
Joined: 26 Jan 2011 19:36

Re: Z-UNO Enatrance Gate Control

Post by PoltoS » 10 Apr 2018 02:46

You need to exclude/include to let changes take place

Clie
Posts: 9
Joined: 06 Jun 2017 12:58

Re: Z-UNO Enatrance Gate Control

Post by Clie » 10 Apr 2018 10:42

PoltoS wrote:
10 Apr 2018 02:46
You need to exclude/include to let changes take place
I'm understand that i need to exclude/include every time where code is changed.
I do not understand why HC does not find all the binary sensors.

Same trouble here:
https://forum.z-wave.me/viewtopic.php?f=3421&t=26355

User avatar
PoltoS
Posts: 5061
Joined: 26 Jan 2011 19:36

Re: Z-UNO Enatrance Gate Control

Post by PoltoS » 11 Apr 2018 00:36

Then you change number of channels or basic behaviour (like battery vs mains) you have to exclude-include the device

Post Reply