Smart Home Automation Forum

Full Version: KC868-A16 integrate to Node-Red for alexa voice control
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

1. download web server firmware for KC868-A16
https://www.kincony.com/forum/showthread.php?tid=2240

2. register https://alexa-node-red.bm.hardill.me.uk
[attachment=1402]

3. create device on "node-red-contrib-alexa-home-skill" skill website
[attachment=1403]

4. add alexa skill on Node-Red
[attachment=1404]

5. add "alexa" and "http request" node on Node-Red
[attachment=1399]

light1-on http command is: http://192.168.1.60/1/on
light1-off http command is: http://192.168.1.60/1/off

just replace the KC868-A16's IP address with yours.

Node-Red follow download:
[attachment=1407]

6. add skill (Node-Red) on Alexa phone app
[attachment=1400]

7. Discovery for new device
[attachment=1401]
Thanks for all the help KinCony! anyone else have any ideas how to control the outputs from the inputs more than just on/off using node red, e.g pulse for 0.5 seconds, 10 seconds or match input trigger to output trigger, thanks
this video tour already can INPUT trigger OUTPUT, it have wrote arduino code for this function.
(10-03-2022, 10:57 PM)admin Wrote: [ -> ]this video tour already can INPUT trigger OUTPUT, it have wrote arduino code for this function.

e.g pulse for 0.5 seconds, 10 seconds or match input trigger to output trigger, thanks
0.5 second or 10 seconds, just modify the arduino IDE code key function. you can check with source code that we already uploaded.
(10-05-2022, 11:15 AM)admin Wrote: [ -> ]0.5 second or 10 seconds, just modify the arduino IDE code key function. you can check with source code that we already uploaded.

what would be written to turn a relay on as you hold in an input e.g relay 1 on when button 1 is on, relay 1 off when button 1 is off, i am guessing it is in this text? thanks 

// turns 32 relays on and off
            if (header.indexOf("GET /1/on") >= 0) {relay1state = "on";pcf8574_R1.digitalWrite(P0, LOW);}
            else if (header.indexOf("GET /1/off") >= 0) {relay1state = "off";pcf8574_R1.digitalWrite(P0, HIGH);}
            else if (header.indexOf("GET /2/on") >= 0)  {relay2state = "on";pcf8574_R1.digitalWrite(P1, LOW);}
            else if (header.indexOf("GET /2/off") >= 0) {relay2state = "off";pcf8574_R1.digitalWrite(P1, HIGH);}
            else if (header.indexOf("GET /3/on") >= 0)  {relay3state = "on";pcf8574_R1.digitalWrite(P2, LOW);}
such as:
if(pcf8574_I1.digitalRead(P0) == LOW) //key1 pressed
{
delay(20); //anti-interference
if(pcf8574_I1.digitalRead(P0) == LOW) //key1 pressed again
{
pcf8574_R1.digitalWrite(P0,!pcf8574_R1.digitalRead(P0)); // toggle relay1 state
while(pcf8574_I1.digitalRead(P0) == LOW); //wait remove hand
if (pcf8574_R1.digitalRead(P0) == LOW) relay1state= "on"; else relay1state= "off";
}
}
//-------------------------------------------------------------------------------------------------------
you just change every key funtion's "delay(20);" replace 20 with other number will have different time.
(10-05-2022, 01:11 PM)admin Wrote: [ -> ]such as:
if(pcf8574_I1.digitalRead(P0) == LOW)        //key1 pressed
  {
    delay(20);                        //anti-interference
    if(pcf8574_I1.digitalRead(P0) == LOW)      //key1 pressed again
    {
      pcf8574_R1.digitalWrite(P0,!pcf8574_R1.digitalRead(P0));    // toggle relay1 state   
      while(pcf8574_I1.digitalRead(P0) == LOW); //wait remove hand
      if (pcf8574_R1.digitalRead(P0) == LOW) relay1state= "on"; else relay1state= "off";
    }
  }
//-------------------------------------------------------------------------------------------------------
you just change every key funtion's "delay(20);"  replace 20 with other number will have different time.

i cant connect to the board all the picures from your colleague i need to do it from the whatsapp chat are gone, what is the most simple way to setup up this board, i just want to be able to choose what the inputs and outputs do and it to connect to alexa, im happy to use wifi and any app, if you can tell me your video for this or instructions, thanks
just do as this video tour, our whatsapp number is :+86-15381188302
No present de Node-Red in Skill Alexa