bl-relay6-01.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. substitutions:
  2. devicename: bl-relay6-01
  3. low_devicenaeme: bl-relay6-01
  4. friendly_name: Waveshare Relay Board Garaz Podlewanie
  5. area: "Garage"
  6. esphome:
  7. name: ${devicename}
  8. friendly_name: ${friendly_name}
  9. area: ${area}
  10. # name_add_mac_suffix: true
  11. # project:
  12. # name: waveshare.esp32-s3-relay-6ch
  13. # version: 1.0.0
  14. esp32:
  15. board: esp32-s3-devkitc-1
  16. framework:
  17. type: arduino
  18. # Enable Home Assistant API
  19. api:
  20. services:
  21. - service: play_rtttl
  22. variables:
  23. song_str: string
  24. then:
  25. - rtttl.play:
  26. rtttl: !lambda "return song_str;"
  27. packages:
  28. # Enable Home Assistant API
  29. esphome: !include common/keys.yaml
  30. # Enable logging
  31. logger:
  32. wifi:
  33. ssid: !secret iot_ssid
  34. password: !secret iot_password
  35. domain: .int.mmax.cloud
  36. web_server:
  37. port: 80
  38. time:
  39. - platform: homeassistant
  40. id: homeassistant_time
  41. binary_sensor:
  42. - platform: status
  43. name: "Status"
  44. - platform: gpio
  45. name: "Boot Button"
  46. pin:
  47. number: 0
  48. ignore_strapping_warning: true
  49. mode:
  50. input: true
  51. inverted: true
  52. disabled_by_default: true
  53. on_press:
  54. then:
  55. - button.press: restart_button
  56. text_sensor:
  57. - platform: version
  58. name: "Firmware Version"
  59. - platform: wifi_info
  60. ip_address:
  61. name: "IP Address"
  62. entity_category: diagnostic
  63. ssid:
  64. name: "Connected SSID"
  65. entity_category: diagnostic
  66. mac_address:
  67. name: "Mac Address"
  68. entity_category: diagnostic
  69. switch:
  70. - platform: gpio
  71. pin: GPIO1
  72. id: relay1
  73. name: Relay 1
  74. restore_mode: RESTORE_DEFAULT_OFF
  75. - platform: gpio
  76. pin: GPIO2
  77. id: relay2
  78. name: Relay 2
  79. restore_mode: RESTORE_DEFAULT_OFF
  80. - platform: gpio
  81. pin: GPIO41
  82. id: relay3
  83. name: Relay 3
  84. restore_mode: RESTORE_DEFAULT_OFF
  85. - platform: gpio
  86. pin: GPIO42
  87. id: relay4
  88. name: Relay 4
  89. restore_mode: RESTORE_DEFAULT_OFF
  90. - platform: gpio
  91. pin:
  92. number: GPIO45
  93. ignore_strapping_warning: true
  94. id: relay5
  95. name: Relay 5
  96. restore_mode: RESTORE_DEFAULT_OFF
  97. - platform: gpio
  98. pin:
  99. number: GPIO46
  100. ignore_strapping_warning: true
  101. id: relay6
  102. name: Relay 6
  103. restore_mode: RESTORE_DEFAULT_OFF
  104. uart:
  105. tx_pin: GPIO17
  106. rx_pin: GPIO18
  107. baud_rate: 115200
  108. # buzzer
  109. output:
  110. - platform: ledc
  111. pin: GPIO21
  112. id: buzzer
  113. rtttl:
  114. output: buzzer
  115. id: rtttl_buzzer
  116. gain: 30%
  117. light:
  118. - platform: neopixelbus
  119. type: RGB
  120. variant: 800KBPS
  121. pin: GPIO38
  122. num_leds: 1
  123. name: "RGB LED"
  124. id: rgb_led
  125. button:
  126. - platform: restart
  127. name: "Restart"
  128. id: restart_button
  129. entity_category: config
  130. - platform: factory_reset
  131. name: "Factory Reset"
  132. id: reset
  133. entity_category: config
  134. - platform: safe_mode
  135. name: "Safe Mode"
  136. internal: false
  137. entity_category: config
  138. sensor:
  139. - platform: wifi_signal
  140. name: "WiFi Signal"
  141. id: wifi_signal_db
  142. update_interval: 60s
  143. entity_category: diagnostic
  144. # Reports the WiFi signal strength in %
  145. - platform: copy
  146. source_id: wifi_signal_db
  147. name: "WiFi Strength"
  148. filters:
  149. - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
  150. unit_of_measurement: "%"
  151. entity_category: diagnostic