- 积分
- 168
- 金钱
- 138
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
注册会员
- 积分
- 168
- 金钱
- 138
- HASS币
- 0
|
本帖最后由 luckhy 于 2023-12-12 16:53 编辑
继电器会动作可打开, 但无法关闭
我按下Desk_down和Desk_up继电器都会动作"打开"但继电器不会"关闭"我看LOG有发送UART,请问前辈神人是什么问题造成呢? ,谢谢。
esphome:
on_boot:
priority: 1000
then:
- lambda: |-
delay(7000);
name: auto-updown-desk
friendly_name: auto-updown-desk
esp8266:
board: esp01_1m
restore_from_flash: true
preferences:
flash_write_interval: 3sec
# Enable Home Assistant API
api:
encryption:
key: "****"
ota:
captive_portal:
# Enable logging
logger:
baud_rate: 0 #need this to free up UART pins
uart:
baud_rate: 115200
tx_pin: GPIO1
rx_pin: GPIO3
debug:
direction: BOTH
dummy_receiver: false
after:
delimiter: "\n"
sequence:
- lambda: UARTDebug::log_string(direction, bytes);
switch:
- platform: template
id: relay1
optimistic: true
turn_on_action:
- uart.write: [0xA0, 0x01, 0x01, 0xA2]
turn_off_action:
- uart.write: [0xA0, 0x01, 0x00, 0xA1]
- platform: template
id: relay2
optimistic: true
turn_on_action:
- uart.write: [0xA0, 0x02, 0x01, 0xA3]
turn_off_action:
- uart.write: [0xA0, 0x02, 0x00, 0xA2]
#internal: yes
- platform: template
name: "Desk_up"
id: deskup
turn_on_action:
- switch.turn_on: relay1
- delay: 1000ms
- switch.turn_off: relay1
- delay: 1000ms
- switch.turn_off: deskup
- platform: template
name: "Desk_down"
id: deskdown
turn_on_action:
- switch.turn_on: relay2
- delay: 1000ms
- switch.turn_off: relay2
- delay: 1000ms
- switch.turn_off: deskdown
|
|