Compare commits

..

11 Commits

Author SHA1 Message Date
Paul Wieland fbf979cab9
Merge branch 'main' into trigger-dry-contact-door-toggle 2024-04-17 16:53:46 -04:00
Paul Wieland 0cbb3722ae A dirty ifdef
refactor of this needed
2024-04-17 16:52:11 -04:00
Paul Wieland 1ba198e286 Update ratgdo.cpp 2024-04-17 16:26:15 -04:00
Paul Wieland 4578097306 Merge branch 'main' of https://github.com/ratgdo/esphome-ratgdo 2024-04-17 16:24:10 -04:00
Paul Wieland da0776ff12
Adds dry contact opener control (#258)
* Setting up dry contact protocol

* limit switch implementation

* setup door controls

* Initial commit to make the component aware of the dry_contact sensors… (#249)

Initial commit to make the component aware of the dry_contact sensors  and eliminate the need for lamda calls

Co-authored-by: bradmck <bradmck@gmail.com>

* send both sensor values

* removing irrelevant dry contact config

* Add triple button (discrete) control for commercial openers & gates

* point to git

* Add dry contact to installer

* rm whitespace

* updated wiring diagram

* organize dry contact methods & fix initial limit switch state

---------

Co-authored-by: bradmck <bradmck@gmail.com>
2024-04-17 16:17:29 -04:00
Paul Wieland f72cea2e8b organize dry contact methods & fix initial limit switch state 2024-04-17 14:56:48 -04:00
Paul Wieland 93383489c3
Revert "Dry contact support" (#257)
Revert "Dry contact support (#255)"

This reverts commit 7362f46aca.
2024-04-17 11:21:20 -04:00
Paul Wieland 7362f46aca
Dry contact support (#255)
* Setting up dry contact protocol

* limit switch implementation

* setup door controls

* Initial commit to make the component aware of the dry_contact sensors… (#249)

Initial commit to make the component aware of the dry_contact sensors  and eliminate the need for lamda calls

Co-authored-by: bradmck <bradmck@gmail.com>

* send both sensor values

* removing irrelevant dry contact config

* Add triple button (discrete) control for commercial openers & gates

* point to git

* Add dry contact to installer

* rm whitespace

* updated wiring diagram

---------

Co-authored-by: bradmck <bradmck@gmail.com>
2024-04-17 10:11:55 -04:00
Paul Wieland 705f381a12 Update ratgdo.cpp 2024-03-21 14:28:51 -04:00
Paul Wieland e3eacef44d Add firmware version to web ui 2024-03-08 11:32:08 -05:00
rlowens 471e78a8e9
Update v25board_esp8266_d1_mini_secplusv1.yaml (#219) 2024-02-04 17:22:48 -06:00
8 changed files with 41 additions and 16 deletions

View File

@ -9,6 +9,10 @@ external_components:
preferences:
flash_write_interval: 1min
text_sensor:
- platform: version
name: "Firmware Version"
ratgdo:
id: ${id_prefix}
input_gdo_pin: ${uart_rx_pin}

View File

@ -9,6 +9,10 @@ external_components:
preferences:
flash_write_interval: 1min
text_sensor:
- platform: version
name: "Firmware Version"
ratgdo:
id: ${id_prefix}
input_gdo_pin: ${uart_rx_pin}

View File

@ -102,9 +102,10 @@ namespace ratgdo {
virtual void dump_config();
virtual void sync();
// dry contact methods
virtual void set_open_limit(bool);
virtual void set_close_limit(bool);
virtual void set_discrete_open_pin(InternalGPIOPin* pin);
virtual void set_discrete_close_pin(InternalGPIOPin* pin);

View File

@ -52,6 +52,11 @@ namespace ratgdo {
// many things happening at startup, use some delay for sync
set_timeout(SYNC_DELAY, [=] { this->sync(); });
ESP_LOGD(TAG, " _____ _____ _____ _____ ____ _____ ");
ESP_LOGD(TAG, "| __ | _ |_ _| __| \\| |");
ESP_LOGD(TAG, "| -| | | | | | | | | | |");
ESP_LOGD(TAG, "|__|__|__|__| |_| |_____|____/|_____|");
ESP_LOGD(TAG, "https://paulwieland.github.io/ratgdo/");
}
// initializing protocol, this gets called before setup() because
@ -418,16 +423,14 @@ namespace ratgdo {
void RATGDOComponent::sync()
{
this->protocol_->sync();
}
void RATGDOComponent::set_open_limit(bool state)
{
this->protocol_->set_open_limit(state);
}
void RATGDOComponent::set_close_limit(bool state)
{
this->protocol_->set_close_limit(state);
// dry contact protocol:
// needed to trigger the intial state of the limit switch sensors
// ideally this would be in drycontact::sync
#ifdef PROTOCOL_DRYCONTACT
this->protocol_->set_open_limit(this->dry_contact_open_sensor_->state);
this->protocol_->set_close_limit(this->dry_contact_close_sensor_->state);
#endif
}
void RATGDOComponent::door_open()
@ -683,21 +686,23 @@ namespace ratgdo {
this->learn_state.subscribe([=](LearnState state) { defer("learn_state", [=] { f(state); }); });
}
// dry contact methods
void RATGDOComponent::set_dry_contact_open_sensor(esphome::gpio::GPIOBinarySensor* dry_contact_open_sensor)
{
dry_contact_open_sensor_ = dry_contact_open_sensor;
dry_contact_open_sensor_->add_on_state_callback([this](bool sensor_value)
{
this->set_open_limit(sensor_value);
this->protocol_->set_open_limit(sensor_value);
}
);
}
void RATGDOComponent::set_dry_contact_close_sensor(esphome::gpio::GPIOBinarySensor* dry_contact_close_sensor)
{
dry_contact_close_sensor_ = dry_contact_close_sensor;
dry_contact_close_sensor_->add_on_state_callback([this](bool sensor_value)
{
this->set_close_limit(sensor_value);
this->protocol_->set_close_limit(sensor_value);
}
);
}

View File

@ -92,9 +92,9 @@ namespace ratgdo {
void set_input_gdo_pin(InternalGPIOPin* pin) { this->input_gdo_pin_ = pin; }
void set_input_obst_pin(InternalGPIOPin* pin) { this->input_obst_pin_ = pin; }
// dry contact methods
void set_dry_contact_open_sensor(esphome::gpio::GPIOBinarySensor* dry_contact_open_sensor_);
void set_dry_contact_close_sensor(esphome::gpio::GPIOBinarySensor* dry_contact_close_sensor_);
void set_discrete_open_pin(InternalGPIOPin* pin){ this->protocol_->set_discrete_open_pin(pin); }
void set_discrete_close_pin(InternalGPIOPin* pin){ this->protocol_->set_discrete_close_pin(pin); }
@ -152,8 +152,6 @@ namespace ratgdo {
void query_status();
void query_openings();
void sync();
void set_open_limit(bool);
void set_close_limit(bool);
// children subscriptions
void subscribe_rolling_code_counter(std::function<void(uint32_t)>&& f);

View File

@ -96,6 +96,13 @@ namespace ratgdo {
const Traits& traits() const { return this->traits_; }
// methods not used by secplus1
void set_open_limit(bool state){}
void set_close_limit(bool state){}
void set_discrete_open_pin(InternalGPIOPin* pin){}
void set_discrete_close_pin(InternalGPIOPin* pin){}
protected:
void wall_panel_emulation(size_t index = 0);

View File

@ -101,6 +101,12 @@ namespace ratgdo {
const Traits& traits() const { return this->traits_; }
// methods not used by secplus2
void set_open_limit(bool state){}
void set_close_limit(bool state){}
void set_discrete_open_pin(InternalGPIOPin* pin){}
void set_discrete_close_pin(InternalGPIOPin* pin){}
protected:
void increment_rolling_code_counter(int delta = 1);
void set_rolling_code_counter(uint32_t counter);

View File

@ -22,7 +22,7 @@ esphome:
version: "2.5"
esp8266:
board: d1_mini_lite
board: d1_mini
restore_from_flash: true
dashboard_import: