Compare commits
4 Commits
93bbb3cebf
...
555433a76d
Author | SHA1 | Date |
---|---|---|
Matt MacAdam | 555433a76d | |
Paul Wieland | 348e4403db | |
J. Nick Koston | 046f71be6d | |
Matt MacAdam | 7f6cb19983 |
13
base.yaml
13
base.yaml
|
@ -142,13 +142,20 @@ binary_sensor:
|
||||||
name: "Dry contact open"
|
name: "Dry contact open"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
filters:
|
filters:
|
||||||
- delayed_on_off: 500ms
|
- delayed_on: 50ms
|
||||||
|
- delayed_off: 500ms
|
||||||
on_press:
|
on_press:
|
||||||
|
- delay: 50ms
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
binary_sensor.is_off: ${id_prefix}_dry_contact_close
|
binary_sensor.is_off: ${id_prefix}_dry_contact_close
|
||||||
then:
|
then:
|
||||||
- cover.open: ${id_prefix}_garage_door
|
- cover.open: ${id_prefix}_garage_door
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
binary_sensor.is_on: ${id_prefix}_dry_contact_close
|
||||||
|
then:
|
||||||
|
- cover.toggle: ${id_prefix}_garage_door
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
id: "${id_prefix}_dry_contact_close"
|
id: "${id_prefix}_dry_contact_close"
|
||||||
pin:
|
pin:
|
||||||
|
@ -160,8 +167,10 @@ binary_sensor:
|
||||||
name: "Dry contact close"
|
name: "Dry contact close"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
filters:
|
filters:
|
||||||
- delayed_on_off: 500ms
|
- delayed_on: 50ms
|
||||||
|
- delayed_off: 500ms
|
||||||
on_press:
|
on_press:
|
||||||
|
- delay: 50ms
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
binary_sensor.is_off: ${id_prefix}_dry_contact_open
|
binary_sensor.is_off: ${id_prefix}_dry_contact_open
|
||||||
|
|
|
@ -65,14 +65,14 @@ namespace ratgdo {
|
||||||
void Secplus1::wall_panel_emulation(size_t index)
|
void Secplus1::wall_panel_emulation(size_t index)
|
||||||
{
|
{
|
||||||
if (this->wall_panel_emulation_state_ == WallPanelEmulationState::WAITING) {
|
if (this->wall_panel_emulation_state_ == WallPanelEmulationState::WAITING) {
|
||||||
ESP_LOG1(TAG, "Looking for security+ 1.0 wall panel...");
|
ESP_LOGD(TAG, "Looking for security+ 1.0 wall panel...");
|
||||||
|
|
||||||
if (this->door_state != DoorState::UNKNOWN || this->light_state != LightState::UNKNOWN) {
|
if (this->door_state != DoorState::UNKNOWN || this->light_state != LightState::UNKNOWN) {
|
||||||
ESP_LOG1(TAG, "Wall panel detected");
|
ESP_LOG1(TAG, "Wall panel detected");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (millis() - this->wall_panel_emulation_start_ > 35000 && !this->wall_panel_starting_) {
|
if (millis() - this->wall_panel_emulation_start_ > 35000 && !this->wall_panel_starting_) {
|
||||||
ESP_LOG1(TAG, "No wall panel detected. Switching to emulation mode.");
|
ESP_LOGD(TAG, "No wall panel detected. Switching to emulation mode.");
|
||||||
this->wall_panel_emulation_state_ = WallPanelEmulationState::RUNNING;
|
this->wall_panel_emulation_state_ = WallPanelEmulationState::RUNNING;
|
||||||
}
|
}
|
||||||
this->scheduler_->set_timeout(this->ratgdo_, "wall_panel_emulation", 2000, [=] {
|
this->scheduler_->set_timeout(this->ratgdo_, "wall_panel_emulation", 2000, [=] {
|
||||||
|
@ -293,7 +293,10 @@ namespace ratgdo {
|
||||||
|
|
||||||
void Secplus1::handle_command(const RxCommand& cmd)
|
void Secplus1::handle_command(const RxCommand& cmd)
|
||||||
{
|
{
|
||||||
if (cmd.req == CommandType::QUERY_DOOR_STATUS) {
|
if (cmd.req == CommandType::TOGGLE_DOOR_RELEASE || cmd.resp == 0x31) {
|
||||||
|
ESP_LOGD(TAG, "wall panel is starting");
|
||||||
|
this->wall_panel_starting_ = true;
|
||||||
|
} else if (cmd.req == CommandType::QUERY_DOOR_STATUS) {
|
||||||
|
|
||||||
DoorState door_state;
|
DoorState door_state;
|
||||||
auto val = cmd.resp & 0x7;
|
auto val = cmd.resp & 0x7;
|
||||||
|
@ -365,10 +368,6 @@ namespace ratgdo {
|
||||||
} else if (cmd.req == CommandType::OBSTRUCTION) {
|
} else if (cmd.req == CommandType::OBSTRUCTION) {
|
||||||
ObstructionState obstruction_state = cmd.resp == 0 ? ObstructionState::CLEAR : ObstructionState::OBSTRUCTED;
|
ObstructionState obstruction_state = cmd.resp == 0 ? ObstructionState::CLEAR : ObstructionState::OBSTRUCTED;
|
||||||
this->ratgdo_->received(obstruction_state);
|
this->ratgdo_->received(obstruction_state);
|
||||||
} else if (cmd.req == CommandType::TOGGLE_DOOR_RELEASE) {
|
|
||||||
if (cmd.resp == 0x31) {
|
|
||||||
this->wall_panel_starting_ = true;
|
|
||||||
}
|
|
||||||
} else if (cmd.req == CommandType::TOGGLE_LIGHT_PRESS) {
|
} else if (cmd.req == CommandType::TOGGLE_LIGHT_PRESS) {
|
||||||
// motion was detected, or the light toggle button was pressed
|
// motion was detected, or the light toggle button was pressed
|
||||||
// either way it's ok to trigger motion detection
|
// either way it's ok to trigger motion detection
|
||||||
|
|
Loading…
Reference in New Issue