55 lines
1.1 KiB
YAML
55 lines
1.1 KiB
YAML
|
|
substitutions:
|
|
device_name: "tuyaplug001"
|
|
friendly_name: "tuya plug 001"
|
|
comment: "eps-02S, tuya-hack"
|
|
location: "zolder"
|
|
api_password: !secret tuya_plug_api
|
|
ota_password: !secret ota_password
|
|
wifi_ssid: !secret wifi_ssid
|
|
wifi_password: !secret wifi_password
|
|
gateway: !secret ip_gateway
|
|
subnet: !secret ip_subnet
|
|
ip: !secret tuya_plug_001_ip
|
|
pin_relay: GPIO12
|
|
pin_button: GPIO14
|
|
pin_status: GPIO04
|
|
|
|
packages:
|
|
board: !include boards/esp12f.yaml
|
|
connection: !include common/wifi.yaml
|
|
device_base: !include common/common.yaml
|
|
status: !include templates/status.yaml
|
|
logger: !include templates/logger.yaml
|
|
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: ${pin_button}
|
|
mode:
|
|
input: true
|
|
pullup: true
|
|
inverted: true
|
|
name: "Button"
|
|
on_press:
|
|
- light.toggle: lamp_relay
|
|
|
|
# switch:
|
|
# - platform: gpio
|
|
# name: "Sonoff Basic Relay"
|
|
# pin: ${pin_relay}
|
|
# id: relay
|
|
# device_class: light
|
|
|
|
output:
|
|
- platform: gpio
|
|
pin: ${pin_relay}
|
|
id: relay
|
|
|
|
light:
|
|
- platform: binary
|
|
name: "light"
|
|
output: relay
|
|
id: lamp_relay
|
|
restore_mode: RESTORE_DEFAULT_ON |