Bonjour,
J’ai un ESP01 connecté sur une carte 2 relais :
j’ai réussi à l’intégrer à HA grâce au forum.
Seulement j’aimerais qu’il ne soit pas possible activer les 2 relais en même temps.
Sur ESPHOME j’ai vu l’option
interlock: [relay2]
je l’ai donc ajouté à la config :
esphome:
name: esp01-2relay
friendly_name: esp01-2relay
esp8266:
board: esp01_1m
# Enable logging
logger:
baud_rate: 0 #need this to free up UART pin
# Enable Home Assistant API
api:
encryption:
key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
ota:
password: "xxxxxxxxxxxxxxxxxxxxxxxxxx"
# Enable Web server.
web_server:
port: 80
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Optional manual IP
manual_ip:
static_ip: 10.x.x.x
gateway: 10.x.x.x
subnet: 255.255.255.0
dns1: 10.x.x.x
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp01-2Relay Hotspot"
password: "esp01-xxxxxx"
captive_portal:
uart:
baud_rate: 115200 # speed to STC15L101EW
tx_pin: GPIO1
rx_pin: GPIO3
switch:
- platform: template
name: 'Relay 1'
id: relay1
turn_on_action:
- uart.write: [0xA0, 0x01, 0x01, 0xA2]
turn_off_action:
- uart.write: [0xA0, 0x01, 0x00, 0xA1]
optimistic: true
interlock: [relay2]
- platform: template
name: 'Relay 2'
id: relay2
turn_on_action:
- uart.write: [0xA0, 0x02, 0x01, 0xA3]
turn_off_action:
- uart.write: [0xA0, 0x02, 0x00, 0xA2]
optimistic: true
interlock: [relay1]
comme écrit là :
https://esphome.io/components/switch/gpio
mais quand je téléverse j’ai l’erreur :
switch.template: [source /config/esphome/esp01-2relay.yaml:47]
platform: template
name: Relay 1
id: relay1
turn_on_action:
- uart.write:
- 160
- 1
- 1
- 162
turn_off_action:
- uart.write:
- 160
- 1
- 0
- 161
optimistic: True
[interlock] is an invalid option for [switch.template]. Did you mean [internal]?
interlock:
- relay2
switch.template: [source /config/esphome/esp01-2relay.yaml:56]
platform: template
name: Relay 2
id: relay2
turn_on_action:
- uart.write:
- 160
- 2
- 1
- 163
turn_off_action:
- uart.write:
- 160
- 2
- 0
- 162
optimistic: True
[interlock] is an invalid option for [switch.template]. Did you mean [internal]?
interlock:
- relay1
est-ce incompatible avec cet équipement ?