Azuria

Untitled

Dec 10th, 2022
1,317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.25 KB | None | 0 0
  1. esphome:
  2.   name: sonoff_dualr2_03
  3.   platform: ESP8266
  4.   board: esp01_1m
  5.  
  6. # Enable logging
  7. logger:
  8. # Enable Home Assistant API
  9. api:
  10. ota:
  11.   password: "1ea575456fb1d95ecd2cb71f67fb65c1"
  12.  
  13. wifi:
  14.   ssid: !secret iot_ssid
  15.   password: !secret iot_pass
  16.  
  17.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  18.   ap:
  19.     ssid: "Nocemcu Fallback Hotspot"
  20.     password: "gQSbSS5bC4HZ"
  21.  
  22. captive_portal:
  23. spi:
  24.   miso_pin: GPIO01
  25.   clk_pin: GPIO03
  26.  
  27.  
  28. mqtt:
  29.   broker: a3160c7746asdad43ac973eebe480b11841.s1.eu.hivemq.cloud
  30.   username: mqttuser
  31.   password: mqttpass
  32.   birth_message:
  33.     topic: temperature/smoke
  34.     payload: online
  35.    
  36. binary_sensor:
  37.   - platform: gpio
  38.     pin:
  39.       number: GPIO10
  40.       mode: INPUT_PULLUP
  41.       inverted: True
  42.     name: "sonoff_dualr2_03_button"
  43.     #toggle both relays on push
  44.     on_press:
  45.       - switch.toggle: relay
  46.       - switch.toggle: relay2
  47.   - platform: gpio
  48.     pin:
  49.       number: GPIO00
  50.       mode: INPUT_PULLUP
  51.       inverted: True
  52.     name: "sonoff_dualr2_03_button0"
  53.     #toggle only relay1
  54.     on_press:
  55.       - switch.toggle: relay
  56.   - platform: gpio
  57.     pin:
  58.       number: GPIO09
  59.       mode: INPUT_PULLUP
  60.       inverted: True
  61.     name: "sonoff_dualr2_03_button1"
  62.     #toggle only relay2
  63.     on_press:
  64.       - switch.toggle: relay2
  65.  
  66. switch:
  67.   - platform: gpio
  68.     name: sonoff_dualr2_03_relay1
  69.     pin: GPIO12
  70.     id: relay
  71.   - platform: gpio
  72.     name: sonoff_dualr2_03_relay2
  73.     pin: GPIO05
  74.     id: relay2
  75.   - platform: shutdown
  76.     name: "sonoff_dualr2_03_shutdown"
  77.   - platform: restart
  78.     name: "sonoff_dualr2_03_restart"
  79.  
  80. status_led:
  81.   pin:
  82.     number: GPIO13
  83.     inverted: yes
  84.  
  85. sensor:
  86.   - platform: wifi_signal
  87.     #name: "${dev_name}_wifi_signal"
  88.     name: "sonoff_dualr2_03_wifi_signal"
  89.     update_interval: 30s
  90.   - platform: uptime
  91.     name: "sonoff_dualr2_03_uptime"
  92.     update_interval: 120s
  93.  
  94.   - platform: max6675
  95.     name: "Temperature Chimney"
  96.     cs_pin: GPIO00
  97.     update_interval: 60s
  98.     on_value_range:
  99.       - above: 96
  100.         then:
  101.           - switch.turn_on: relay
  102.       - below: 30
  103.         then:
  104.           - switch.turn_off: relay
  105.  
  106. text_sensor:
  107.   - platform: version
  108.     name: "sonoff_dualr2_03_version"
Advertisement
Add Comment
Please, Sign In to add comment