Announcement

Collapse
No announcement yet.

API SendToHS problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    API SendToHS problem

    Hi

    I'm playing with the API version of the sketch.
    While it seems FromHS works fine, it seems I'm doing something wrong with SendToHS.

    I've created a simple circuit with one button and a LED.
    RX from HS is tested reading a variable and if true, printing to Serial.
    TX to HS is tested sending to HS the status of the LED (1/0).
    While this value is correctly printed on the Serial, HS instead always shows 0
    (Board 2, Device Ref = 149, API Input 1, Value = 0)

    I'm using Available Sketch Version = 1.0.0.127, API Version = API1.0.0.118
    and IDE 1.6.8 for MacOSX

    Any idea what I am doing wrong?



    Code:
    /*Execute regardless of connection status*/
    
    if (alert=FromHS[0]){    //test RX from HS
    Serial.println("ALERT");
      }
    
      val = digitalRead(BUTTON);  // read button
      
      // check if something has changed 
      if ((val == HIGH) && (old_val == LOW)){  
        status = 1 - status;  
      }   
      
      old_val = val;            // update old_val
      
      if (status == 1) {  
       digitalWrite(LED, HIGH);   //  led ON    
      }   
      else {  
        digitalWrite(LED, LOW);    // led OFF  
      }  
    
    Serial.println(status);
    SendToHS(1,status);

    #2
    My first guess is that this is sending to homeseer on every loop of code and is flooding the serial port with data.

    Try this.

    PHP Code:
    if (alert=FromHS[0]){    //test RX from HS
    Serial.println("ALERT");
      }

      
    val digitalRead(BUTTON);  // read button
      
      // check if something has changed 
      
    if ((val == HIGH) && (old_val == LOW)){  
        
    status status;  
         
      
      
    old_val val;            // update old_val
      
      
    if (status == 1) {  
       
    digitalWrite(LEDHIGH);   //  led ON    
      
    }   
      else {  
        
    digitalWrite(LEDLOW);    // led OFF  
      
    }  

    Serial.println(status);
    SendToHS(1,status);
      } 
    Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
    X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
    Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
    Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
    Scripts =
    Various

    Comment

    Working...
    X