<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Smart Home Automation Forum - KC868-ASR]]></title>
		<link>https://www.kincony.com/forum/</link>
		<description><![CDATA[Smart Home Automation Forum - https://www.kincony.com/forum]]></description>
		<pubDate>Sat, 02 May 2026 14:44:10 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[[Arduino source code for KC868-ASR]-03 Relay auto ON/OFF by date time]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=5656</link>
			<pubDate>Sun, 28 Apr 2024 13:21:10 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=5656</guid>
			<description><![CDATA[This is an arduino sample code for KC868-ASR , auto control relay ON/OFF by date and time. for example ,the demo is every year 4-26 (April 26th) relay will ON, every year 5-2 (May 2nd) relay will OFF. it support command by serial port (USB cable) to send date/time and read date/time.<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5148" target="_blank" title="">timer.png</a> (Size: 52 KB / Downloads: 885)
<!-- end: postbit_attachments_attachment --><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;DS3231.h&gt;<br />
#include &lt;Wire.h&gt;<br />
<br />
String serial_cmd_rcv = ""; //serial port receiver<br />
<br />
typedef struct<br />
{<br />
  byte year;// Last two digits of the year, lib will add 2000.<br />
  byte month;<br />
  byte day;<br />
  byte hour ;<br />
  byte minute ;<br />
  byte second ;<br />
}MY_DATE_STR;<br />
<br />
MY_DATE_STR my_date_str = {0};<br />
<br />
#define OPEN_RLY_DATA   26<br />
#define OPEN_RLY_MONTH  4<br />
<br />
#define CLOSE_RLY_DATA   2<br />
#define CLOSE_RLY_MONTH   5<br />
<br />
#define SDA_PIN   26<br />
#define SCL_PIN   27<br />
<br />
#define RLY1_PIN  19<br />
#define RLY2_PIN  5<br />
<br />
DS3231  rtc; <br />
bool h12Flag;<br />
bool pmFlag;<br />
static bool bCentury = false;<br />
static bool old_level_high = false;<br />
static bool old_level_low = false;<br />
<br />
static bool CompareOpenDate()<br />
{<br />
  return (rtc.getDate()==OPEN_RLY_DATA)&amp;(rtc.getMonth(bCentury)==OPEN_RLY_MONTH);<br />
}<br />
<br />
static bool CompareCloseDate()<br />
{<br />
  return (rtc.getDate()==CLOSE_RLY_DATA)&amp;(rtc.getMonth(bCentury)==CLOSE_RLY_MONTH);<br />
}<br />
<br />
static void PrintfCurTime()<br />
{<br />
  Serial.print("current time is: ");<br />
  int year = rtc.getYear() + 2000;<br />
  Serial.print(year);<br />
  Serial.print("-");<br />
  <br />
  Serial.print(rtc.getMonth(bCentury), DEC);<br />
  Serial.print("-");<br />
  <br />
  // then the date<br />
  Serial.print(rtc.getDate(), DEC);<br />
  Serial.print(" ");<br />
  <br />
  // and the day of the week<br />
  //Serial.print(rtc.getDoW(), DEC);<br />
  //Serial.print(" ");<br />
  <br />
  // Finally the hour, minute, and second<br />
  Serial.print(rtc.getHour(h12Flag, pmFlag), DEC);<br />
  Serial.print(":");<br />
  Serial.print(rtc.getMinute(), DEC);<br />
  Serial.print(":");<br />
  Serial.println(rtc.getSecond(), DEC);<br />
  <br />
}<br />
static void GetSerialCmd() <br />
{ ////format:D2024-04-28T11:50:22<br />
 <br />
  /*while (Serial.available() &gt; 0)<br />
  {<br />
    serial_cmd_rcv += char(Serial.read());<br />
    delay(5);  <br />
  } */<br />
  if(Serial.available() &gt; 0)<br />
  {<br />
    delay(100);<br />
    int num_read = Serial.available();<br />
    while(num_read--)<br />
      serial_cmd_rcv += char(Serial.read());<br />
  }<br />
  else return;<br />
   <br />
  serial_cmd_rcv.trim();<br />
<br />
  if(serial_cmd_rcv == "current time")<br />
  {<br />
    PrintfCurTime();<br />
    serial_cmd_rcv = "";<br />
    return;<br />
  }<br />
<br />
  Serial.print("rcv length:");<br />
  Serial.println(serial_cmd_rcv.length());<br />
<br />
  int indexof_d = serial_cmd_rcv.indexOf('D');<br />
  int indexof_t = serial_cmd_rcv.indexOf('T');<br />
<br />
  Serial.print("d index:");Serial.print(indexof_d);<br />
  Serial.print(" t index:");Serial.println(indexof_t);<br />
  <br />
  if (serial_cmd_rcv.length() != 20 || <br />
      serial_cmd_rcv.substring(0,1) != "D" ||<br />
      serial_cmd_rcv.substring(11,12) != "T")  <br />
  {<br />
    <br />
    Serial.println(serial_cmd_rcv);<br />
    serial_cmd_rcv="";<br />
    return;<br />
    }<br />
    <br />
  Serial.println("setting is start!");<br />
  <br />
  my_date_str.year = (byte)serial_cmd_rcv.substring(3,5).toInt();<br />
  my_date_str.month = (byte)serial_cmd_rcv.substring(6,8).toInt();<br />
  my_date_str.day = (byte)serial_cmd_rcv.substring(9,11).toInt();<br />
<br />
  my_date_str.hour = (byte)serial_cmd_rcv.substring(12,14).toInt();<br />
  my_date_str.minute = (byte)serial_cmd_rcv.substring(15,17).toInt();<br />
  my_date_str.second = (byte)serial_cmd_rcv.substring(18).toInt();<br />
<br />
  rtc.setYear(my_date_str.year);<br />
  rtc.setMonth(my_date_str.month);<br />
  rtc.setDate(my_date_str.day);<br />
  rtc.setHour(my_date_str.hour);<br />
  rtc.setMinute(my_date_str.minute);<br />
  rtc.setSecond(my_date_str.second);<br />
  <br />
  serial_cmd_rcv = ""; <br />
<br />
  Serial.println("setting is ending!");<br />
}<br />
<br />
static bool GetEdgeP(bool cur,bool old)  {return (cur &amp; !old);}<br />
static bool bOpen,bClose;<br />
<br />
void setup() {<br />
  // put your setup code here, to run once:<br />
  // Start the I2C interface<br />
  Wire.begin(SDA_PIN,SCL_PIN,40000);<br />
  <br />
  // Setup Serial connection<br />
  Serial.begin(115200);<br />
  <br />
  pinMode(RLY1_PIN,OUTPUT);<br />
  pinMode(RLY2_PIN,OUTPUT);<br />
  <br />
  // Set 12/24h mode. True is 12-h, false is 24-hour.<br />
  rtc.setClockMode(false);////24h<br />
<br />
  PrintfCurTime();<br />
<br />
  while(Serial.read()&gt;=0){}<br />
 <br />
}<br />
<br />
void loop() {<br />
  // put your main code here, to run repeatedly:<br />
   <br />
  GetSerialCmd();<br />
  <br />
  bOpen = CompareOpenDate();<br />
  bClose = CompareCloseDate();<br />
  if(GetEdgeP(bOpen,old_level_high)) digitalWrite(RLY1_PIN,HIGH);<br />
  if(GetEdgeP(bClose,old_level_low)) digitalWrite(RLY1_PIN,LOW);<br />
<br />
<br />
  old_level_high = bOpen;<br />
  old_level_low = bClose;<br />
  //delay (1000);<br />
  <br />
}</code></div></div>source code download ZIP file: <!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5144" target="_blank" title="">DS3231TST-20240428.zip</a> (Size: 1.53 KB / Downloads: 596)
<!-- end: postbit_attachments_attachment --><br />
before use code need install DS3231 arduino library firstly.<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5145" target="_blank" title="">arduino library.png</a> (Size: 24.68 KB / Downloads: 832)
<!-- end: postbit_attachments_attachment --><br />
download firmware by arduino IDE: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5146" target="_blank" title="">asr-pcb.jpg</a> (Size: 440.57 KB / Downloads: 884)
<!-- end: postbit_attachments_attachment --><br />
serial port by USB 115200bps<br />
set date and time command example: D2024-04-28T11:50:22<br />
print current date and time: current time<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5147" target="_blank" title="">set-date-time.png</a> (Size: 84.65 KB / Downloads: 893)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5149" target="_blank" title="">read-date-time.png</a> (Size: 79.07 KB / Downloads: 920)
<!-- end: postbit_attachments_attachment --><br />
<br />
because it's not easy to battery by air plane, so if you want timer work when power off, you can install the CR1220 on KC868-ASR PCB bottom side.<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5150" target="_blank" title="">asr-battery.jpg</a> (Size: 353.67 KB / Downloads: 873)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5151" target="_blank" title="">cr1220-battery.jpg</a> (Size: 39.51 KB / Downloads: 880)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[This is an arduino sample code for KC868-ASR , auto control relay ON/OFF by date and time. for example ,the demo is every year 4-26 (April 26th) relay will ON, every year 5-2 (May 2nd) relay will OFF. it support command by serial port (USB cable) to send date/time and read date/time.<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5148" target="_blank" title="">timer.png</a> (Size: 52 KB / Downloads: 885)
<!-- end: postbit_attachments_attachment --><br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;DS3231.h&gt;<br />
#include &lt;Wire.h&gt;<br />
<br />
String serial_cmd_rcv = ""; //serial port receiver<br />
<br />
typedef struct<br />
{<br />
  byte year;// Last two digits of the year, lib will add 2000.<br />
  byte month;<br />
  byte day;<br />
  byte hour ;<br />
  byte minute ;<br />
  byte second ;<br />
}MY_DATE_STR;<br />
<br />
MY_DATE_STR my_date_str = {0};<br />
<br />
#define OPEN_RLY_DATA   26<br />
#define OPEN_RLY_MONTH  4<br />
<br />
#define CLOSE_RLY_DATA   2<br />
#define CLOSE_RLY_MONTH   5<br />
<br />
#define SDA_PIN   26<br />
#define SCL_PIN   27<br />
<br />
#define RLY1_PIN  19<br />
#define RLY2_PIN  5<br />
<br />
DS3231  rtc; <br />
bool h12Flag;<br />
bool pmFlag;<br />
static bool bCentury = false;<br />
static bool old_level_high = false;<br />
static bool old_level_low = false;<br />
<br />
static bool CompareOpenDate()<br />
{<br />
  return (rtc.getDate()==OPEN_RLY_DATA)&amp;(rtc.getMonth(bCentury)==OPEN_RLY_MONTH);<br />
}<br />
<br />
static bool CompareCloseDate()<br />
{<br />
  return (rtc.getDate()==CLOSE_RLY_DATA)&amp;(rtc.getMonth(bCentury)==CLOSE_RLY_MONTH);<br />
}<br />
<br />
static void PrintfCurTime()<br />
{<br />
  Serial.print("current time is: ");<br />
  int year = rtc.getYear() + 2000;<br />
  Serial.print(year);<br />
  Serial.print("-");<br />
  <br />
  Serial.print(rtc.getMonth(bCentury), DEC);<br />
  Serial.print("-");<br />
  <br />
  // then the date<br />
  Serial.print(rtc.getDate(), DEC);<br />
  Serial.print(" ");<br />
  <br />
  // and the day of the week<br />
  //Serial.print(rtc.getDoW(), DEC);<br />
  //Serial.print(" ");<br />
  <br />
  // Finally the hour, minute, and second<br />
  Serial.print(rtc.getHour(h12Flag, pmFlag), DEC);<br />
  Serial.print(":");<br />
  Serial.print(rtc.getMinute(), DEC);<br />
  Serial.print(":");<br />
  Serial.println(rtc.getSecond(), DEC);<br />
  <br />
}<br />
static void GetSerialCmd() <br />
{ ////format:D2024-04-28T11:50:22<br />
 <br />
  /*while (Serial.available() &gt; 0)<br />
  {<br />
    serial_cmd_rcv += char(Serial.read());<br />
    delay(5);  <br />
  } */<br />
  if(Serial.available() &gt; 0)<br />
  {<br />
    delay(100);<br />
    int num_read = Serial.available();<br />
    while(num_read--)<br />
      serial_cmd_rcv += char(Serial.read());<br />
  }<br />
  else return;<br />
   <br />
  serial_cmd_rcv.trim();<br />
<br />
  if(serial_cmd_rcv == "current time")<br />
  {<br />
    PrintfCurTime();<br />
    serial_cmd_rcv = "";<br />
    return;<br />
  }<br />
<br />
  Serial.print("rcv length:");<br />
  Serial.println(serial_cmd_rcv.length());<br />
<br />
  int indexof_d = serial_cmd_rcv.indexOf('D');<br />
  int indexof_t = serial_cmd_rcv.indexOf('T');<br />
<br />
  Serial.print("d index:");Serial.print(indexof_d);<br />
  Serial.print(" t index:");Serial.println(indexof_t);<br />
  <br />
  if (serial_cmd_rcv.length() != 20 || <br />
      serial_cmd_rcv.substring(0,1) != "D" ||<br />
      serial_cmd_rcv.substring(11,12) != "T")  <br />
  {<br />
    <br />
    Serial.println(serial_cmd_rcv);<br />
    serial_cmd_rcv="";<br />
    return;<br />
    }<br />
    <br />
  Serial.println("setting is start!");<br />
  <br />
  my_date_str.year = (byte)serial_cmd_rcv.substring(3,5).toInt();<br />
  my_date_str.month = (byte)serial_cmd_rcv.substring(6,8).toInt();<br />
  my_date_str.day = (byte)serial_cmd_rcv.substring(9,11).toInt();<br />
<br />
  my_date_str.hour = (byte)serial_cmd_rcv.substring(12,14).toInt();<br />
  my_date_str.minute = (byte)serial_cmd_rcv.substring(15,17).toInt();<br />
  my_date_str.second = (byte)serial_cmd_rcv.substring(18).toInt();<br />
<br />
  rtc.setYear(my_date_str.year);<br />
  rtc.setMonth(my_date_str.month);<br />
  rtc.setDate(my_date_str.day);<br />
  rtc.setHour(my_date_str.hour);<br />
  rtc.setMinute(my_date_str.minute);<br />
  rtc.setSecond(my_date_str.second);<br />
  <br />
  serial_cmd_rcv = ""; <br />
<br />
  Serial.println("setting is ending!");<br />
}<br />
<br />
static bool GetEdgeP(bool cur,bool old)  {return (cur &amp; !old);}<br />
static bool bOpen,bClose;<br />
<br />
void setup() {<br />
  // put your setup code here, to run once:<br />
  // Start the I2C interface<br />
  Wire.begin(SDA_PIN,SCL_PIN,40000);<br />
  <br />
  // Setup Serial connection<br />
  Serial.begin(115200);<br />
  <br />
  pinMode(RLY1_PIN,OUTPUT);<br />
  pinMode(RLY2_PIN,OUTPUT);<br />
  <br />
  // Set 12/24h mode. True is 12-h, false is 24-hour.<br />
  rtc.setClockMode(false);////24h<br />
<br />
  PrintfCurTime();<br />
<br />
  while(Serial.read()&gt;=0){}<br />
 <br />
}<br />
<br />
void loop() {<br />
  // put your main code here, to run repeatedly:<br />
   <br />
  GetSerialCmd();<br />
  <br />
  bOpen = CompareOpenDate();<br />
  bClose = CompareCloseDate();<br />
  if(GetEdgeP(bOpen,old_level_high)) digitalWrite(RLY1_PIN,HIGH);<br />
  if(GetEdgeP(bClose,old_level_low)) digitalWrite(RLY1_PIN,LOW);<br />
<br />
<br />
  old_level_high = bOpen;<br />
  old_level_low = bClose;<br />
  //delay (1000);<br />
  <br />
}</code></div></div>source code download ZIP file: <!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5144" target="_blank" title="">DS3231TST-20240428.zip</a> (Size: 1.53 KB / Downloads: 596)
<!-- end: postbit_attachments_attachment --><br />
before use code need install DS3231 arduino library firstly.<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5145" target="_blank" title="">arduino library.png</a> (Size: 24.68 KB / Downloads: 832)
<!-- end: postbit_attachments_attachment --><br />
download firmware by arduino IDE: <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5146" target="_blank" title="">asr-pcb.jpg</a> (Size: 440.57 KB / Downloads: 884)
<!-- end: postbit_attachments_attachment --><br />
serial port by USB 115200bps<br />
set date and time command example: D2024-04-28T11:50:22<br />
print current date and time: current time<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5147" target="_blank" title="">set-date-time.png</a> (Size: 84.65 KB / Downloads: 893)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5149" target="_blank" title="">read-date-time.png</a> (Size: 79.07 KB / Downloads: 920)
<!-- end: postbit_attachments_attachment --><br />
<br />
because it's not easy to battery by air plane, so if you want timer work when power off, you can install the CR1220 on KC868-ASR PCB bottom side.<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5150" target="_blank" title="">asr-battery.jpg</a> (Size: 353.67 KB / Downloads: 873)
<!-- end: postbit_attachments_attachment --><br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=5151" target="_blank" title="">cr1220-battery.jpg</a> (Size: 39.51 KB / Downloads: 880)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KC868-ASR SD Card]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=4265</link>
			<pubDate>Sat, 10 Feb 2024 02:50:14 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=0">miraclecontrols@gmail.com</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=4265</guid>
			<description><![CDATA[Do we have example Arduino code for recording/logging function on TF card on KC868-ASR v1.0. Want to record Temperature as read from a DS18B20 along with Real Time (RTC) Date and time every hour on a csv file. KCS v2 firmware does not seem to have this feature.]]></description>
			<content:encoded><![CDATA[Do we have example Arduino code for recording/logging function on TF card on KC868-ASR v1.0. Want to record Temperature as read from a DS18B20 along with Real Time (RTC) Date and time every hour on a csv file. KCS v2 firmware does not seem to have this feature.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KC868-ASR  wiring diagram]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=3197</link>
			<pubDate>Thu, 24 Aug 2023 16:27:59 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=194">KinCony Support</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=3197</guid>
			<description><![CDATA[<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2924" target="_blank" title="">ASR.jpg</a> (Size: 1.8 MB / Downloads: 1040)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2924" target="_blank" title="">ASR.jpg</a> (Size: 1.8 MB / Downloads: 1040)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KC868-ASR ESPHome demo config for home assistant]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=2651</link>
			<pubDate>Sun, 05 Mar 2023 07:21:23 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=2651</guid>
			<description><![CDATA[<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2131" target="_blank" title="">home-assistant-ASR.png</a> (Size: 80.09 KB / Downloads: 954)
<!-- end: postbit_attachments_attachment --><br />
esphome:<br />
  name: asr<br />
<br />
esp32:<br />
  board: esp32dev<br />
  framework:<br />
    type: arduino<br />
<br />
# Enable logging<br />
logger:<br />
<br />
# Enable Home Assistant API<br />
api:<br />
  encryption:<br />
    key: "Xqy9f8iJ49cr7o8IWE1sFnG9EAEnxHVYlGUQBdnKE6Q="<br />
<br />
ota:<br />
  password: "d13799179d079d89758ad1a0fd1c4560"<br />
<br />
wifi:<br />
  ssid: KinCony<br />
  password: a12345678<br />
<br />
  # Enable fallback hotspot (captive portal) in case wifi connection fails<br />
  ap:<br />
    ssid: "Asr Fallback Hotspot"<br />
    password: "KqbpeFnrzcWf"<br />
<br />
captive_portal:<br />
<br />
i2c:<br />
  sda: 26<br />
  scl: 27<br />
  scan: true<br />
  id: bus_a<br />
<br />
<br />
switch:<br />
  - platform: gpio<br />
    pin: GPIO19<br />
    name: "asr-relay1"<br />
<br />
  - platform: gpio<br />
    pin: GPIO5<br />
    name: "asr-relay2"<br />
  <br />
  - platform: gpio<br />
    pin: GPIO23<br />
    name: "asr-led1"  <br />
  <br />
  - platform: gpio<br />
    pin: GPIO22<br />
    name: "asr-led2"  <br />
<br />
  - platform: gpio<br />
    pin: GPIO18<br />
    name: "asr-beep"<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    pin:<br />
      number: 0<br />
      inverted: true<br />
    name: "asr-button"<br />
<br />
dallas:<br />
  - pin: 32<br />
    update_interval: 5s<br />
<br />
sensor:<br />
  - platform: dallas<br />
    address: 0x7b062162cfe98128<br />
    name: "asr-t2"<br />
    <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2038" target="_blank" title="">KC868-ASR_ESPHome.txt</a> (Size: 1.1 KB / Downloads: 526)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/image.png" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2131" target="_blank" title="">home-assistant-ASR.png</a> (Size: 80.09 KB / Downloads: 954)
<!-- end: postbit_attachments_attachment --><br />
esphome:<br />
  name: asr<br />
<br />
esp32:<br />
  board: esp32dev<br />
  framework:<br />
    type: arduino<br />
<br />
# Enable logging<br />
logger:<br />
<br />
# Enable Home Assistant API<br />
api:<br />
  encryption:<br />
    key: "Xqy9f8iJ49cr7o8IWE1sFnG9EAEnxHVYlGUQBdnKE6Q="<br />
<br />
ota:<br />
  password: "d13799179d079d89758ad1a0fd1c4560"<br />
<br />
wifi:<br />
  ssid: KinCony<br />
  password: a12345678<br />
<br />
  # Enable fallback hotspot (captive portal) in case wifi connection fails<br />
  ap:<br />
    ssid: "Asr Fallback Hotspot"<br />
    password: "KqbpeFnrzcWf"<br />
<br />
captive_portal:<br />
<br />
i2c:<br />
  sda: 26<br />
  scl: 27<br />
  scan: true<br />
  id: bus_a<br />
<br />
<br />
switch:<br />
  - platform: gpio<br />
    pin: GPIO19<br />
    name: "asr-relay1"<br />
<br />
  - platform: gpio<br />
    pin: GPIO5<br />
    name: "asr-relay2"<br />
  <br />
  - platform: gpio<br />
    pin: GPIO23<br />
    name: "asr-led1"  <br />
  <br />
  - platform: gpio<br />
    pin: GPIO22<br />
    name: "asr-led2"  <br />
<br />
  - platform: gpio<br />
    pin: GPIO18<br />
    name: "asr-beep"<br />
<br />
binary_sensor:<br />
  - platform: gpio<br />
    pin:<br />
      number: 0<br />
      inverted: true<br />
    name: "asr-button"<br />
<br />
dallas:<br />
  - pin: 32<br />
    update_interval: 5s<br />
<br />
sensor:<br />
  - platform: dallas<br />
    address: 0x7b062162cfe98128<br />
    name: "asr-t2"<br />
    <br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2038" target="_blank" title="">KC868-ASR_ESPHome.txt</a> (Size: 1.1 KB / Downloads: 526)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KC868-ASR ESP32 I/O pin define]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=2650</link>
			<pubDate>Sun, 05 Mar 2023 07:20:24 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=2650</guid>
			<description><![CDATA[Button S2: GPIO0<br />
<br />
<br />
TH1: GPIO32  (use for DS18B20/DHT11 sensor)<br />
TH2: GPIO33  (use for DS18B20/DHT11 sensor)<br />
<br />
Relay1:GPIO19<br />
Relay2:GPIO5<br />
<br />
IIC SDA:GPIO26<br />
IIC SCL:GPIO27<br />
<br />
LED1:GPIO23<br />
LED2:GPIO22<br />
<br />
Beep: GPIO18<br />
<br />
DS3231 IIC address: 0x68<br />
<br />
TF_Card:<br />
<br />
DAT2:GPIO12<br />
DAT3: GPIO13<br />
CMD: GPIO15<br />
CLK: GPIO14<br />
DAT0:GPIO2<br />
DAT1:GPIO4<br />
<br />
free GPIO: GPIO16, GPIO17]]></description>
			<content:encoded><![CDATA[Button S2: GPIO0<br />
<br />
<br />
TH1: GPIO32  (use for DS18B20/DHT11 sensor)<br />
TH2: GPIO33  (use for DS18B20/DHT11 sensor)<br />
<br />
Relay1:GPIO19<br />
Relay2:GPIO5<br />
<br />
IIC SDA:GPIO26<br />
IIC SCL:GPIO27<br />
<br />
LED1:GPIO23<br />
LED2:GPIO22<br />
<br />
Beep: GPIO18<br />
<br />
DS3231 IIC address: 0x68<br />
<br />
TF_Card:<br />
<br />
DAT2:GPIO12<br />
DAT3: GPIO13<br />
CMD: GPIO15<br />
CLK: GPIO14<br />
DAT0:GPIO2<br />
DAT1:GPIO4<br />
<br />
free GPIO: GPIO16, GPIO17]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Arduino source code for KC868-ASR]-04 BEEP]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=2635</link>
			<pubDate>Thu, 02 Mar 2023 14:39:14 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=194">KinCony Support</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=2635</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define BEEP 18<br />
#define S2 0<br />
<br />
void setup() {<br />
  Serial.begin(115200);<br />
  pinMode(BEEP,OUTPUT);<br />
  pinMode(S2,INPUT);<br />
 <br />
  digitalWrite(BEEP, HIGH);<br />
  delay(200);<br />
  digitalWrite(BEEP,LOW);<br />
  delay(200);<br />
    <br />
}<br />
<br />
void loop() {<br />
<br />
if(digitalRead(S2)==LOW){<br />
  delay(20);<br />
  if(digitalRead(S2)==LOW)<br />
  {<br />
    digitalWrite(BEEP, HIGH);<br />
    delay(100);<br />
    digitalWrite(BEEP, LOW);<br />
    delay(10);  <br />
  }  <br />
}else digitalWrite(BEEP, LOW);<br />
 }</code></div></div><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2015" target="_blank" title="">KC868-ASR_BEEP.zip</a> (Size: 102.86 KB / Downloads: 552)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define BEEP 18<br />
#define S2 0<br />
<br />
void setup() {<br />
  Serial.begin(115200);<br />
  pinMode(BEEP,OUTPUT);<br />
  pinMode(S2,INPUT);<br />
 <br />
  digitalWrite(BEEP, HIGH);<br />
  delay(200);<br />
  digitalWrite(BEEP,LOW);<br />
  delay(200);<br />
    <br />
}<br />
<br />
void loop() {<br />
<br />
if(digitalRead(S2)==LOW){<br />
  delay(20);<br />
  if(digitalRead(S2)==LOW)<br />
  {<br />
    digitalWrite(BEEP, HIGH);<br />
    delay(100);<br />
    digitalWrite(BEEP, LOW);<br />
    delay(10);  <br />
  }  <br />
}else digitalWrite(BEEP, LOW);<br />
 }</code></div></div><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2015" target="_blank" title="">KC868-ASR_BEEP.zip</a> (Size: 102.86 KB / Downloads: 552)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Arduino source code for KC868-ASR]-03 DS18B20]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=2634</link>
			<pubDate>Thu, 02 Mar 2023 14:38:34 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=194">KinCony Support</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=2634</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;DS18B20.h&gt;<br />
<br />
DS18B20 ds1(32);  //channel-1-DS18b20<br />
DS18B20 ds2(33);  //channel-2-DS18b20<br />
<br />
<br />
void setup() {<br />
  Serial.begin(115200);<br />
}<br />
<br />
void loop() {<br />
<br />
 Serial.printf("T1:%.2f || T2:%.2f &#92;n",ds1.getTempC(),ds2.getTempC());<br />
 delay(1000);<br />
}</code></div></div><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2014" target="_blank" title="">KC868-ASR_DS18B20.zip</a> (Size: 105.14 KB / Downloads: 585)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;DS18B20.h&gt;<br />
<br />
DS18B20 ds1(32);  //channel-1-DS18b20<br />
DS18B20 ds2(33);  //channel-2-DS18b20<br />
<br />
<br />
void setup() {<br />
  Serial.begin(115200);<br />
}<br />
<br />
void loop() {<br />
<br />
 Serial.printf("T1:%.2f || T2:%.2f &#92;n",ds1.getTempC(),ds2.getTempC());<br />
 delay(1000);<br />
}</code></div></div><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2014" target="_blank" title="">KC868-ASR_DS18B20.zip</a> (Size: 105.14 KB / Downloads: 585)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Arduino source code for KC868-ASR]-02 Relay ON AND OFF]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=2633</link>
			<pubDate>Thu, 02 Mar 2023 14:37:26 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=194">KinCony Support</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=2633</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define OUT0 19<br />
#define OUT1 5<br />
void setup() {<br />
  Serial.begin(115200);<br />
 <br />
  pinMode(OUT0,OUTPUT);<br />
  pinMode(OUT1,OUTPUT);    <br />
}<br />
<br />
void loop() {<br />
      digitalWrite(OUT0, HIGH);<br />
      delay(200);<br />
      digitalWrite(OUT1, HIGH);<br />
      delay(200);  <br />
      digitalWrite(OUT0,LOW);<br />
      delay(200);<br />
      digitalWrite(OUT1, LOW);<br />
      delay(200);<br />
 }</code></div></div><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2013" target="_blank" title="">KC868-ASR_RELAY.zip</a> (Size: 102.81 KB / Downloads: 595)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define OUT0 19<br />
#define OUT1 5<br />
void setup() {<br />
  Serial.begin(115200);<br />
 <br />
  pinMode(OUT0,OUTPUT);<br />
  pinMode(OUT1,OUTPUT);    <br />
}<br />
<br />
void loop() {<br />
      digitalWrite(OUT0, HIGH);<br />
      delay(200);<br />
      digitalWrite(OUT1, HIGH);<br />
      delay(200);  <br />
      digitalWrite(OUT0,LOW);<br />
      delay(200);<br />
      digitalWrite(OUT1, LOW);<br />
      delay(200);<br />
 }</code></div></div><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2013" target="_blank" title="">KC868-ASR_RELAY.zip</a> (Size: 102.81 KB / Downloads: 595)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Arduino source code for KC868-ASR]-01 LED ON AND OFF]]></title>
			<link>https://www.kincony.com/forum/showthread.php?tid=2632</link>
			<pubDate>Thu, 02 Mar 2023 14:36:46 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.kincony.com/forum/member.php?action=profile&uid=194">KinCony Support</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.kincony.com/forum/showthread.php?tid=2632</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define LED1 23<br />
#define LED2 22<br />
<br />
void setup() {<br />
  Serial.begin(115200);<br />
  pinMode(LED1,OUTPUT);<br />
  pinMode(LED2,OUTPUT);<br />
    <br />
}<br />
<br />
void loop() {<br />
<br />
  digitalWrite(LED1, LOW);<br />
  delay(200);<br />
  digitalWrite(LED2, LOW);<br />
  delay(200); <br />
  digitalWrite(LED1, HIGH);<br />
  delay(200);<br />
  digitalWrite(LED2, HIGH);<br />
  delay(200);<br />
 }</code></div></div><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2012" target="_blank" title="">KC868-ASR_LED.zip</a> (Size: 102.79 KB / Downloads: 607)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define LED1 23<br />
#define LED2 22<br />
<br />
void setup() {<br />
  Serial.begin(115200);<br />
  pinMode(LED1,OUTPUT);<br />
  pinMode(LED2,OUTPUT);<br />
    <br />
}<br />
<br />
void loop() {<br />
<br />
  digitalWrite(LED1, LOW);<br />
  delay(200);<br />
  digitalWrite(LED2, LOW);<br />
  delay(200); <br />
  digitalWrite(LED1, HIGH);<br />
  delay(200);<br />
  digitalWrite(LED2, HIGH);<br />
  delay(200);<br />
 }</code></div></div><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://www.kincony.com/forum/images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=2012" target="_blank" title="">KC868-ASR_LED.zip</a> (Size: 102.79 KB / Downloads: 607)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
	</channel>
</rss>