本帖最后由 godzqh 于 2024-10-21 10:06 编辑
每次ota更新后插座会断开继电器后重新打开,能否让其不断开?
配置如下:
esphome:
name: "x1s"
friendly_name: "x1s"
platformio_options:
board_build.bkcrypt_coeffs: "00000000000000000000000000000000"
board_build.bkota.key: "0123456789ABCDEF0123456789ABCDEF"
board_build.bkota.iv: "0123456789ABCDEF"
board_flash.download: "0x132000+0xA6000"
board_flash.kvs: "0x1D8000+0x8000"
board_flash.calibration: "0x1E0000+0x1000"
board_flash.tlv: "0x1E1000+0x1000"
board_flash.net: "0x1E2000+0x1000"
board_flash.userdata: "0x1E3000+0x1D000"
bk72xx:
board: generic-bk7231n-qfn32-tuya
logger:
# web_server:
captive_portal:
mdns:
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
substitutions:
voltage_divider: "800.4735172433958"
current_resistor: "0.0010788674067058845"
current_multiply: "0.4667266199455673"
preferences:
flash_write_interval: 10min
status_led:
pin:
number: P11
inverted: True
output:
- platform: gpio
id: led1
pin:
number: P10
inverted: True
switch:
- platform: gpio
pin: P8
name: "Relay"
id: relay
restore_mode: RESTORE_DEFAULT_OFF
on_turn_on:
- output.turn_on: led1
on_turn_off:
- output.turn_off: led1
binary_sensor:
- platform: gpio
pin:
number: P24
mode: INPUT_PULLUP
inverted: true
name: "Switch"
filters:
- delayed_on_off: 100ms
on_press:
then:
- switch.toggle: relay
sensor:
- platform: hlw8012
model: BL0937
current_resistor: ${current_resistor}
voltage_divider: ${voltage_divider}
sel_pin:
number: P26
inverted: true
cf_pin:
number: P6
inverted: true
cf1_pin:
number: P7
inverted: true
current:
name: "Current"
accuracy_decimals: 3
filters:
- multiply: ${current_multiply}
voltage:
name: "Voltage"
accuracy_decimals: 2
power:
name: "Power"
id: my_power
accuracy_decimals: 2
energy:
name: "Energy"
accuracy_decimals: 2
update_interval: 5s
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 1min
- platform: uptime
name: Uptime
update_interval: 1min
|