chore: prepare for v1 support

This commit is contained in:
J. Nick Koston 2024-01-06 09:27:39 -10:00 committed by Marius Muja
parent 4c2ed4e7c0
commit 4aad26a710
7 changed files with 103 additions and 24 deletions

View File

@ -17,26 +17,29 @@ jobs:
matrix: matrix:
firmware: firmware:
- file: v2board_esp8266_d1_mini_lite.yaml - file: v2board_esp8266_d1_mini_lite.yaml
name: V2.0 Board ESP8266 D1 Mini Lite name: V2.0 Board ESP8266 D1 Mini Lite Security+ 2.0
manifest_filename: v2board_esp8266_d1_mini_lite-manifest.json manifest_filename: v2board_esp8266_d1_mini_lite-manifest.json
- file: v2board_esp8266_d1_mini.yaml - file: v2board_esp8266_d1_mini.yaml
name: V2.0 Board ESP8266 D1 Mini name: V2.0 Board ESP8266 D1 Mini Security+ 2.0
manifest_filename: v2board_esp8266_d1_mini-manifest.json manifest_filename: v2board_esp8266_d1_mini-manifest.json
- file: v2board_esp32_d1_mini.yaml - file: v2board_esp32_d1_mini.yaml
name: V2.0 Board ESP32 D1 Mini name: V2.0 Board ESP32 D1 Mini Security+ 2.0
manifest_filename: v2board_esp32_d1_mini-manifest.json manifest_filename: v2board_esp32_d1_mini-manifest.json
- file: v2board_esp32_lolin_s2_mini.yaml - file: v2board_esp32_lolin_s2_mini.yaml
name: V2.0 Board ESP32 lolin S2 mini name: V2.0 Board ESP32 lolin S2 mini Security+ 2.0
manifest_filename: v2board_esp32_lolin_s2_mini-manifest.json manifest_filename: v2board_esp32_lolin_s2_mini-manifest.json
- file: v25board_esp8266_d1_mini_lite.yaml - file: v25board_esp8266_d1_mini_lite.yaml
name: V2.5 Board ESP8266 D1 Mini Lite name: V2.5 Board ESP8266 D1 Mini Lite Security+ 2.0
manifest_filename: v25board_esp8266_d1_mini_lite-manifest.json manifest_filename: v25board_esp8266_d1_mini_lite-manifest.json
- file: v25board_esp32_d1_mini.yaml - file: v25board_esp32_d1_mini.yaml
name: V2.5 Board ESP32 D1 Mini name: V2.5 Board ESP32 D1 Mini Security+ 2.0
manifest_filename: v25board_esp32_d1_mini-manifest.json manifest_filename: v25board_esp32_d1_mini-manifest.json
- file: v25iboard.yaml - file: v25iboard.yaml
name: V2.5i Board name: V2.5i Board Security+ 2.0
manifest_filename: v25iboard-manifest.json manifest_filename: v25iboard-manifest.json
- file: v25iboard_secplusv1.yaml
name: V2.5i Board Security+ 1.0
manifest_filename: v25iboard-manifest_secplusv1.json
fail-fast: false fail-fast: false
steps: steps:
- name: Checkout source code - name: Checkout source code

View File

@ -19,13 +19,14 @@ The ESPHome firmware will allow you to open the door to any position after calib
## ESPHome config ## ESPHome config
- [ESPHome config for v2.0 board with ESP8266 D1 Mini](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v2board_esp8266_d1_mini.yaml) - [Security+ 2.0 ESPHome config for v2.0 board with ESP8266 D1 Mini](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v2board_esp8266_d1_mini.yaml)
- [ESPHome config for v2.0 board with ESP8266 D1 Mini lite](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v2board_esp8266_d1_mini_lite.yaml) - [Security+ 2.0 ESPHome config for v2.0 board with ESP8266 D1 Mini lite](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v2board_esp8266_d1_mini_lite.yaml)
- [ESPHome config for v2.0 board with ESP32 D1 Mini](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v2board_esp32_d1_mini.yaml) - [Security+ 2.0 ESPHome config for v2.0 board with ESP32 D1 Mini](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v2board_esp32_d1_mini.yaml)
- [ESPHome config for v2.0 board with ESP32 Lolin D2 Mini](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v2board_esp32_lolin_s2_mini.yaml) - [Security+ 2.0 ESPHome config for v2.0 board with ESP32 Lolin D2 Mini](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v2board_esp32_lolin_s2_mini.yaml)
- [ESPHome config for v2.5 board with ESP8266 D1 Mini lite](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v25board_esp8266_d1_mini_lite.yaml) - [Security+ 2.0 ESPHome config for v2.5 board with ESP8266 D1 Mini lite](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v25board_esp8266_d1_mini_lite.yaml)
- [ESPHome config for v2.5 board with ESP32 D1 Mini](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v25board_esp32_d1_mini.yaml) - [Security+ 2.0 ESPHome config for v2.5 board with ESP32 D1 Mini](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v25board_esp32_d1_mini.yaml)
- [ESPHome config for v2.5i board](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v25iboard.yaml) - [Security+ 2.0 ESPHome config for v2.5i board](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v25iboard.yaml)
- [Security+ 1.0 ESPHome config for v2.5i board](https://github.com/RATGDO/esphome-ratgdo/blob/main/static/v25iboard_secplusv1.yaml)
- [Web Installer](https://ratgdo.github.io/esphome-ratgdo/) - [Web Installer](https://ratgdo.github.io/esphome-ratgdo/)

View File

@ -2,6 +2,7 @@ import esphome.codegen as cg
import esphome.config_validation as cv import esphome.config_validation as cv
from esphome import automation, pins from esphome import automation, pins
from esphome.const import CONF_ID, CONF_TRIGGER_ID from esphome.const import CONF_ID, CONF_TRIGGER_ID
import voluptuous as vol
DEPENDENCIES = ["preferences"] DEPENDENCIES = ["preferences"]
MULTI_CONF = True MULTI_CONF = True
@ -28,6 +29,11 @@ CONF_RATGDO_ID = "ratgdo_id"
CONF_ON_SYNC_FAILED = "on_sync_failed" CONF_ON_SYNC_FAILED = "on_sync_failed"
CONF_PROTOCOL = "protocol"
PROTOCOL_SECPLUSV1 = "secplusv1"
PROTOCOL_SECPLUSV2 = "secplusv2"
SUPPORTED_PROTOCOLS = [PROTOCOL_SECPLUSV1, PROTOCOL_SECPLUSV2]
CONFIG_SCHEMA = cv.Schema( CONFIG_SCHEMA = cv.Schema(
{ {
@ -46,6 +52,9 @@ CONFIG_SCHEMA = cv.Schema(
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(SyncFailed), cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(SyncFailed),
} }
), ),
cv.Optional(
CONF_PROTOCOL, default=PROTOCOL_SECPLUSV2
): vol.In(SUPPORTED_PROTOCOLS)
} }
).extend(cv.COMPONENT_SCHEMA) ).extend(cv.COMPONENT_SCHEMA)
@ -85,3 +94,8 @@ async def to_code(config):
repository="https://github.com/ratgdo/espsoftwareserial#autobaud", repository="https://github.com/ratgdo/espsoftwareserial#autobaud",
version=None, version=None,
) )
if config[CONF_PROTOCOL] == PROTOCOL_SECPLUSV1:
cg.add_define("PROTOCOL_SECPLUSV1")
elif config[CONF_PROTOCOL] == PROTOCOL_SECPLUSV2:
cg.add_define("PROTOCOL_SECPLUSV2")

View File

@ -158,11 +158,11 @@
<p><em>Note: At the moment ESPHome only supports Security + 2.0 door openers (Yellow learn button). Support for other protocols is coming.</em></p> <p><em>Note: At the moment ESPHome only supports Security + 2.0 door openers (Yellow learn button). Support for other protocols is coming.</em></p>
<h3>v2.5i/2.52i Board</h3> <h3>v2.5i/2.52i Board Security+ 2.0</h3>
<div class="radios"> <div class="radios">
<label> <label>
<input type="radio" name="type" value="v25iboard" checked /> <input type="radio" name="type" value="v25iboard" checked />
<img src="./v25iboard.png" alt="ratgdo v2.5i/2.52i board" /> <img src="./v25iboard.png" alt="ratgdo v2.5i/2.52i board with Security+ 2.0" />
</label> </label>
</div> </div>
<p> <p>
@ -171,16 +171,24 @@
<li><a href="https://user-images.githubusercontent.com/4663918/277838851-e338c3bf-4eda-447a-9e79-737aa1a622a0.png">Version 2.5i Dry Contact Wiring Diagram</a></li> <li><a href="https://user-images.githubusercontent.com/4663918/277838851-e338c3bf-4eda-447a-9e79-737aa1a622a0.png">Version 2.5i Dry Contact Wiring Diagram</a></li>
</ul> </ul>
</p> </p>
<h3>v2.5i/2.52i Board Security+ 1.0</h3>
<div class="radios">
<label>
<input type="radio" name="type" value="v25iboard_secplusv1" checked />
<img src="./v25iboard_secplusv1.png" alt="ratgdo v2.5i/2.52i board with Security+ 1.0" />
</label>
</div>
<h3>v2.5 Board</h3>
<h3>v2.5 Board Security+ 2.0</h3>
<div class="radios"> <div class="radios">
<label> <label>
<input type="radio" name="type" value="v25board_esp8266_d1_mini_lite" /> <input type="radio" name="type" value="v25board_esp8266_d1_mini_lite" />
<img src="./v25board_esp8266_d1_mini_lite.png" alt="ratgdo v2.5 board with ESP8266 D1 Mini Lite" /> <img src="./v25board_esp8266_d1_mini_lite.png" alt="ratgdo v2.5 board with ESP8266 D1 Mini Lite with Security+ 2.0" />
</label> </label>
<label> <label>
<input type="radio" name="type" value="v25board_esp32_d1_mini" /> <input type="radio" name="type" value="v25board_esp32_d1_mini" />
<img src="./v25board_esp32_d1_mini.png" alt="ratgdo v2.5 board with ESP32 D1 Mini" /> <img src="./v25board_esp32_d1_mini.png" alt="ratgdo v2.5 board with ESP32 D1 Mini with Security+ 2.0" />
</label> </label>
</div> </div>
<p> <p>
@ -190,23 +198,23 @@
</ul> </ul>
</p> </p>
<h3>v2.0 Board</h3> <h3>v2.0 Board Security+ 2.0</h3>
<div class="radios"> <div class="radios">
<label> <label>
<input type="radio" name="type" value="v2board_esp8266_d1_mini_lite" /> <input type="radio" name="type" value="v2board_esp8266_d1_mini_lite" />
<img src="./v2board_esp8266_d1_mini_lite.png" alt="ratgdo v2.0 board with ESP8266 D1 Mini Lite" /> <img src="./v2board_esp8266_d1_mini_lite.png" alt="ratgdo v2.0 board with ESP8266 D1 Mini Lite with Security+ 2.0" />
</label> </label>
<label> <label>
<input type="radio" name="type" value="v2board_esp8266_d1_mini" /> <input type="radio" name="type" value="v2board_esp8266_d1_mini" />
<img src="./v2board_esp8266_d1_mini.png" alt="ratgdo v2.0 board with ESP8266 D1 Mini" /> <img src="./v2board_esp8266_d1_mini.png" alt="ratgdo v2.0 board with ESP8266 D1 Mini with Security+ 2.0" />
</label> </label>
<label> <label>
<input type="radio" name="type" value="v2board_esp32_d1_mini" /> <input type="radio" name="type" value="v2board_esp32_d1_mini" />
<img src="./v2board_esp32_d1_mini.png" alt="ratgdo v2.0 board with ESP32 D1 Mini" /> <img src="./v2board_esp32_d1_mini.png" alt="ratgdo v2.0 board with ESP32 D1 Mini with Security+ 2.0" />
</label> </label>
<label> <label>
<input type="radio" name="type" value="v2board_esp32_lolin_s2_mini" /> <input type="radio" name="type" value="v2board_esp32_lolin_s2_mini" />
<img src="./v2board_esp32_lolin_s2_mini.png" alt="ratgdo v2.0 board with ESP32 lolin s2 mini" /> <img src="./v2board_esp32_lolin_s2_mini.png" alt="ratgdo v2.0 board with ESP32 lolin s2 mini with Security+ 2.0" />
</label> </label>
</div> </div>
<p> <p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

View File

@ -0,0 +1,52 @@
---
substitutions:
id_prefix: ratgdov25i
friendly_name: "ratgdov2.5i"
uart_tx_pin: D1
uart_rx_pin: D2
input_obst_pin: D7
status_door_pin: D0
status_obstruction_pin: D8
dry_contact_open_pin: D5
dry_contact_close_pin: D6
dry_contact_light_pin: D3
web_server:
esphome:
name: ${id_prefix}
friendly_name: ${friendly_name}
name_add_mac_suffix: true
project:
name: ratgdo.esphome
version: "2.5i"
esp8266:
board: d1_mini
restore_from_flash: true
dashboard_import:
package_import_url: github://ratgdo/esphome-ratgdo/v25iboard.yaml@main
packages:
remote_package:
url: https://github.com/ratgdo/esphome-ratgdo
files: [base.yaml]
refresh: 1s
# Sync time with Home Assistant.
time:
- platform: homeassistant
id: homeassistant_time
api:
id: api_server
ota:
improv_serial:
wifi:
ap:
logger:

1
v25iboard_secplusv1.yaml Symbolic link
View File

@ -0,0 +1 @@
static/v25iboard_secplusv1.yaml