Skip to content

Commit

Permalink
Try fix #1 and fid Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-deluca committed Jun 20, 2022
1 parent 2f54de6 commit af5d5f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ service: esphome.espkyogate_arm_area
data:
arm_type: 1 (total arm) - 2 (partially arm)
area: <area_number>
specific_area: 1 (arm <area_number> and disarm others) - 0 (arm only <area_number> without changing the others)
specific_area: 1 (arm only <area_number> and disarm others) - 0 (arm only <area_number> without changing the others)
```

### Area Disarm
``` yaml
service: esphome.espkyogate_disarm_area
data:
area: <area_number>
specific_area: 1 (disarm all areas) - 0 (disarm only <area_number> without changing the others)
specific_area: 0 (disarm all areas) - 1 (disarm only <area_number> without changing the others)
```

### Reset Alarm Memory
Expand Down Expand Up @@ -269,7 +269,8 @@ Ff you have any problems, make the following checks:
* Check that the cables are connected correctly
* Check the 232 converter is properly powered
* Try to reverse TX and RX
* Verify that the central unit has firmware **2.13**
* Verify that the central unit has firmware **2.13**, if it isn't you've to update central unit firmware to this version.


### Diagnostics Service
For diagnostics you can enable additional software logs through this service.
Expand All @@ -280,7 +281,11 @@ service: esphome.espkyogate_debug_command
data:
serial_trace: 1
log_trace: 1
polling_kyo: 1
```
* serial_trace * Enable or Disable Serial Log communication to central unit
* log_trace * Enable or Disable Application Log
* polling_kyo * Enable or Disable continuative polling to central unit (default always Enable)

## License
GNU AGPLv3 © [Lorenzo De Luca][https://lorenzodeluca.dev]
12 changes: 5 additions & 7 deletions bentel-kyo/bentel_kyo32.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Bentel_Kyo32 : public esphome::PollingComponent, public uart::UARTDevice,
return;
}

ESP_LOGI("arm_area", "request arm type %d area %d", arm_type, area);
ESP_LOGI("arm_area", "request arm type %d area %d specific %d", arm_type, area, specific_area);
byte cmdArmPartition[11] = {0x0F, 0x00, 0xF0, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0xCC, 0xFF};

byte total_insert_area_status = 0x00, partial_insert_area_status = 0x00;
Expand Down Expand Up @@ -118,7 +118,7 @@ class Bentel_Kyo32 : public esphome::PollingComponent, public uart::UARTDevice,
return;
}

ESP_LOGI("disarm_area", "request disarm area %d", area);
ESP_LOGI("disarm_area", "request disarm area %d , specific %d", area, specific_area);
byte cmdDisarmPartition[11] = {0x0F, 0x00, 0xF0, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0xFF, 0xFF};

byte total_insert_area_status = 0x00, partial_insert_area_status = 0x00;
Expand All @@ -131,18 +131,16 @@ class Bentel_Kyo32 : public esphome::PollingComponent, public uart::UARTDevice,
partial_insert_area_status |= (this->inserimento_parziale_area[i].state) << i;
}

if (this->inserimento_totale_area[area - 1].state)
total_insert_area_status |= 0 << (area - 1);
else
partial_insert_area_status |= 1 << (area - 1);
total_insert_area_status |= 0 << (area - 1);
partial_insert_area_status |= 0 << (area - 1);
}

cmdDisarmPartition[6] = total_insert_area_status;
cmdDisarmPartition[7] = partial_insert_area_status;
cmdDisarmPartition[9] = calculateCRC(cmdDisarmPartition, 8);

byte Rx[255];
int Count = sendMessageToKyo(cmdDisarmPartition, sizeof(cmdDisarmPartition), Rx, 80);
int Count = sendMessageToKyo(cmdDisarmPartition, sizeof(cmdDisarmPartition), Rx, 100);
ESP_LOGD("disarm_area", "kyo respond %i", Count);
}

Expand Down

0 comments on commit af5d5f7

Please sign in to comment.