39 lines
937 B
YAML
39 lines
937 B
YAML
substitutions:
|
|
device_name: "watervalve"
|
|
friendly_name: "WaterValve Garage"
|
|
comment: "ESP8266, tuya-hack"
|
|
location: "Garage"
|
|
api_password: !secret watervalve_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 watervalve_ip
|
|
pin_status: GPIO0
|
|
pin_motor: GPIO13
|
|
pin_button: GPIO12
|
|
|
|
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
|
|
|
|
switch:
|
|
- platform: gpio
|
|
id: valveMotor
|
|
pin: ${pin_motor}
|
|
name: "Valve"
|
|
icon: mdi:pipe-valve
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
name: "Button"
|
|
pin: ${pin_button}
|
|
on_click:
|
|
min_length: 50ms
|
|
max_length: 1000ms
|
|
then:
|
|
- switch.toggle: valveMotor |