1
0
mirror of https://github.com/Utyff/Zintercom.git synced 2026-01-12 17:27:42 +03:00

8 Commits
1.0.0 ... 1.0.1

Author SHA1 Message Date
lost
c833dc48ab updated EVT_ID thanks to @Anton_ACE 2021-04-23 01:31:45 +03:00
xyzroe
bc3f698efc Merge pull request #2 from diyruz/hold_btn
long button press
2021-04-23 01:25:13 +03:00
lost
29ff218b19 trying to add long press button event 2021-04-23 00:34:20 +03:00
lost
44087fceb9 changed default timings 2021-04-23 00:30:19 +03:00
xyzroe
a4fe271d30 update images markup 2021-04-16 10:22:14 +03:00
xyzroe
deafb7667e update images links 2021-04-16 09:51:56 +03:00
xyzroe
29c71487ea Merge pull request #1 from aprosvetova/patch-1
Fix the converter link
2021-04-15 21:09:10 +03:00
Anna Prosvetova
5e02f3c97a Fix the converter link 2021-04-15 21:01:58 +03:00
4 changed files with 39 additions and 30 deletions

View File

@@ -23,24 +23,25 @@ Reset to FN by press and hold BTN for 5 seconds.
LED will flash during reset.
<img src="./images/z2m_dashboard.gif" width="45%">
![](/images/z2m_dashboard.gif)
### How to add device into zigbe2mqtt
Use [external converters](https://www.zigbee2mqtt.io/information/configuration.html#external-converters-configuration) feature
Converter file located [here](./converters/DIY_Zintercom.js)
Converter file located [here](https://github.com/diyruz/Zintercom/blob/master/converters/DIYRuZ_Zintercom.js)
<img src="./images/z2m_exposes.png" width="90%">
![](/images/z2m_exposes.png)
### Schematic
<img src="./hardware/Schematic_Zintercom.png" width="90%">
![](/hardware/Schematic_Zintercom.png)
### PCB size
`57.5mm x 27.3mm`
<img src="./images/dimensions.png" width="60%">
![](/images/dimensions.png)
### DC Power
@@ -48,9 +49,9 @@ Converter file located [here](./converters/DIY_Zintercom.js)
Support `router` and `end device` modes.
Install `E18-MS1PA1`, `E18-MS1PA2` or `E18-MS1-PCB`.
<img src="./images/front_side.png" width="70%">
![](/images/front_side.png)
<img src="./images/back_DC_5-9V.png" width="70%">
![](/images/back_DC_5-9V.png)
### Battery Power
@@ -65,7 +66,7 @@ But you have the ability to set the button mode or at the time of the call.
If any commands are in the coordinator's queue, they will be executed after a button is pressed or a call is received.
<img src="./images/back_2xAAA.png" width="70%">
![](/images/back_2xAAA.png)
##### The mode set by the Zigbee command `overwrites` the mode set by the button.

View File

@@ -88,8 +88,6 @@ static void zclApp_RingRun(void);
static void zclApp_TalkStart(void);
static void zclApp_RingEnd(void);
//static uint32 pressTime = 0;
/*********************************************************************
* ZCL General Profile Callback table
*/
@@ -141,6 +139,8 @@ static void zclApp_HandleKeys(byte portAndAction, byte keyCode) {
//exit old stop timer
osal_stop_timerEx(zclApp_TaskID, APP_RING_STOP_EVT);
osal_clear_event(zclApp_TaskID, APP_RING_STOP_EVT);
//start new stop timer (ring ends timer)
osal_start_reload_timer(zclApp_TaskID, APP_RING_STOP_EVT, 3000);
if (portAndAction & HAL_KEY_PRESS) {
//osal_pwrmgr_task_state(zclApp_TaskID, PWRMGR_HOLD);
@@ -148,26 +148,36 @@ static void zclApp_HandleKeys(byte portAndAction, byte keyCode) {
//start ring
if (zclApp_State.RingRunStep == 0) {
LREPMaster("Ring start\r\n");
HalLedSet(LED_PIN, HAL_LED_MODE_BLINK);
zclApp_State.RingRunStep = 1;
osal_start_reload_timer(zclApp_TaskID, APP_RING_RUN_EVT, 500);
afAddrType_t inderect_DstAddr = {.addrMode = (afAddrMode_t)AddrNotPresent, .endPoint = 0, .addr.shortAddr = 0};
zclGeneral_SendOnOff_CmdOn(zclApp_FirstEP.EndPoint, &inderect_DstAddr, FALSE, bdb_getZCLFrameCounter());
LREPMaster("Ring start\r\n");
HalLedSet(LED_PIN, HAL_LED_MODE_BLINK);
zclApp_State.RingRunStep = 1;
osal_start_reload_timer(zclApp_TaskID, APP_RING_RUN_EVT, 500);
afAddrType_t inderect_DstAddr = {.addrMode = (afAddrMode_t)AddrNotPresent, .endPoint = 0, .addr.shortAddr = 0};
zclGeneral_SendOnOff_CmdOn(zclApp_FirstEP.EndPoint, &inderect_DstAddr, FALSE, bdb_getZCLFrameCounter());
}
}
//start new stop timer (ring ends timer)
osal_start_reload_timer(zclApp_TaskID, APP_RING_STOP_EVT, 3000);
}
if (portAndAction & 0x04) { //P2 Btn //S2 P2_0
zclFactoryResetter_HandleKeys(portAndAction, keyCode);
if (portAndAction & HAL_KEY_PRESS) {
LREPMaster("Key pressed\r\n");
osal_start_reload_timer(zclApp_TaskID, APP_BTN_CLICK_EVT, 50);
zclApp_State.pressTime = osal_getClock();
LREP("pressTime = %d\r\n", zclApp_State.pressTime);
}
if (portAndAction & HAL_KEY_RELEASE) {
LREPMaster("Key released\r\n");
uint32 holdTime = osal_getClock() - zclApp_State.pressTime;
LREP("holdTime = %d \r\n", holdTime);
zclApp_State.pressTime = 0;
if (holdTime >= 1) { //seconds
osal_start_reload_timer(zclApp_TaskID, APP_BTN_HOLD_EVT, 50);
}
else {
osal_start_reload_timer(zclApp_TaskID, APP_BTN_CLICK_EVT, 50);
}
}
}
}
@@ -286,7 +296,7 @@ static void zclApp_RingRun(void) {
}
break;
case Droped:
if (zclApp_State.RingRunStep > 3) {
if (zclApp_State.RingRunStep > 1) {
zclApp_RingEnd();
}
break;
@@ -379,9 +389,6 @@ static void zclApp_BtnClick(bool hold) {
currentBtnClickPhase = 0;
break;
}
#if defined( ZIC_BATTERY_MODE )
zclBattery_Report();
#endif
}
static void zclApp_Report(void) {

View File

@@ -21,9 +21,9 @@ extern "C" {
#define APP_SAVE_ATTRS_EVT 0x0002
#define APP_BTN_CLICK_EVT 0x0004
#define APP_RING_RUN_EVT 0x0008
#define APP_BTN_HOLD_EVT 0x0016
#define APP_RING_STOP_EVT 0x0032
#define APP_TALK_START_EVT 0x0064
#define APP_BTN_HOLD_EVT 0x0010
#define APP_RING_STOP_EVT 0x0020
#define APP_TALK_START_EVT 0x0040
/*********************************************************************
* MACROS

View File

@@ -64,8 +64,8 @@ const uint8 zclApp_PowerSource = POWER_SOURCE_DC;
#define DEFAULT_ModeOpen Never
#define DEFAULT_ModeSound TRUE
#define DEFAULT_TimeRing 3 //seconds to ring, before answer
#define DEFAULT_TimeTalk 1 //seconds to talk, before open
#define DEFAULT_TimeRing 7 //seconds to ring, before answer
#define DEFAULT_TimeTalk 3 //seconds to talk, before open
#define DEFAULT_TimeOpen 2 //seconds to hold open
@@ -81,6 +81,7 @@ application_config_t zclApp_Config = {
device_state_t zclApp_State = {
.State = Idle,
.RingRunStep = 0,
.pressTime = 0,
};