Advertisement
grea09

Esphome Tuya config

Dec 4th, 2020
1,142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.70 KB | None | 0 0
  1. substitutions:
  2.   devicename: moestest
  3.   oldname: $devicename
  4.  
  5. <<: !include devices/esp8266.yaml
  6. <<: !include modules/wifi.yaml
  7. <<: !include modules/common.yaml
  8.  
  9. uart:
  10.   rx_pin: GPIO3
  11.   tx_pin: GPIO1
  12.   baud_rate: 9600
  13.  
  14. tuya:
  15. switch:
  16.   - platform: "tuya"
  17.     id: relay1
  18.     name: "Test 1"
  19.     switch_datapoint: 1
  20.   - platform: "tuya"
  21.     id: relay2
  22.     name: "Test 2"
  23.     switch_datapoint: 2
  24.  
  25. binary_sensor:
  26.   - platform: tuya
  27.     id: persist1
  28.     sensor_datapoint: 1
  29.     on_state:
  30.       then:
  31.         - logger.log: "State changed for relay1"
  32.   - platform: tuya
  33.     id: persist2
  34.     sensor_datapoint: 2
  35.     on_state:
  36.       then:
  37.         - logger.log: "State changed for relay2"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement