LoraTap SC500W 百叶窗开关

GPIO 引脚功能

来源:ESPHome-Devices

GPIO 引脚 功能
3 LED 指示灯(低电平触发)
4 开关 S1 信号(低电平触发)
5 开关 S2 信号(低电平触发)
12 继电器 L1
13 配对按钮
14 继电器 L2

Flashing

外壳有三处卡扣,很容易撬开,PCB 正面:

pcb-1

反面:

pcb-2

运气不错,使用的模块是基于 ESP8266 的 TYWE2S,而不是基于 BK72XX 系列 SoC 的新模块。

根据资料,分别给 TXRXGND3V3 引脚焊上线:

flashing-wiring-1

并短接模块背面的 IO0 触点与 GND

flashing-wiring-2

ESPHome 配置示例:

esphome:
  name: roller-shutter-1
  comment: 'Roller shutter switch 1'

esp8266:
  board: esp8285 # 注意型号

preferences:
  flash_write_interval: 10min

logger:
  level: WARN
#  baud_rate: 115200

wifi:
  fast_connect: true
  networks:
    - ssid: !secret wifi_ssid
      bssid: !secret wifi_bssid
      password: !secret wifi_password

api:
ota:
  password: !secret ota_password

status_led:
  pin:
    number: 3
    inverted: true

# 用于硬重置
button:
  - platform: restart
    id: restart_button
    internal: true

binary_sensor:
  - platform: gpio
    name: 'Pairing button' # 将配对按钮作为硬重置按钮
    pin: 13
    internal: true
    on_release:
      then:
        - button.press: restart_button
  - platform: gpio
    name: 'S1 open switch'
    pin: 4
    id: switch_open
    internal: true
    filters:
      - invert:
    on_press:
      then:
        - cover.open: shutters
    on_release:
      then:
        - cover.stop: shutters
  - platform: gpio
    name: 'S2 close switch'
    pin: 5
    id: switch_close
    internal: true
    filters:
      - invert:
    on_press:
      then:
        - cover.close: shutters
    on_release:
      then:
        - cover.stop: shutters

# 继电器
output:
  - platform: gpio
    pin: 12
    id: relay_open
  - platform: gpio
    pin: 14
    id: relay_close

cover:
  - platform: time_based
    name: 'Roller Shutter 1'
    id: shutters
    device_class: shutter
    open_action:
      - output.turn_off: relay_close
      - output.turn_on: relay_open
    open_duration: 51s # 调整为实际全开时间
    close_action:
      - output.turn_off: relay_open
      - output.turn_on: relay_close
    close_duration: 47s # 调整为实际全关时间
    stop_action:
      - output.turn_off: relay_open
      - output.turn_off: relay_close

在 HASS 中的效果:

hass


0 Comments

发表评论

Avatar placeholder

您的电子邮箱地址不会被公开。