1
0
ansible-home-assistant/esphome/esp12-kvm.yaml

74 lines
1.1 KiB
YAML

esphome:
name: esp12-kvm
friendly_name: esp12-kvm
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key:
ota:
password:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Kvm Fallback Hotspot"
password:
captive_portal:
binary_sensor:
- platform: gpio
id: pc1_selected
pin:
number: 5
mode: INPUT
on_press:
then:
- select.set:
id: select_input
option: PC 1
- platform: gpio
id: pc2_selected
pin:
number: 4
mode: INPUT
on_press:
then:
- select.set:
id: select_input
option: PC 2
select:
- platform: template
id: select_input
name: "KVM Select Input"
options:
- PC 1
- PC 2
optimistic: true
switch:
- platform: gpio
pin:
number: 12
inverted: true
mode:
output: True
open_drain: True
id: change_input
name: "Switch input"
on_turn_on:
- delay: 50ms
- switch.turn_off: change_input