Advertisement
Guest User

Untitled

a guest
Jul 9th, 2023
498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. esphome:
  2. name: esphome-web-0dec48
  3. friendly_name: M5 Matrix
  4.  
  5. esp32:
  6. board: m5stack-atom
  7. framework:
  8. type: arduino
  9.  
  10. # Enable logging
  11. logger:
  12. level: DEBUG
  13.  
  14. # Enable Home Assistant API
  15. api:
  16. encryption:
  17. key: ""
  18. services:
  19. - service: m5_matrix_change_page
  20. variables:
  21. page: int
  22. then:
  23. - display.page.show: !lambda |-
  24. if (page == 1) {
  25. return id(page1);
  26. } else {
  27. if (page == 2) {
  28. return id(page2);
  29. } else {
  30. return id(page1);
  31. } }
  32. ota:
  33.  
  34.  
  35. wifi:
  36. ssid: !secret wifi_ssid
  37. password: !secret wifi_password
  38.  
  39. # Enable fallback hotspot (captive portal) in case wifi connection fails
  40. ap:
  41. ssid: "Esphome-Web-0Dec48"
  42. password: ""
  43.  
  44. captive_portal:
  45.  
  46.  
  47. sensor:
  48. - platform: wifi_signal
  49. id: wifi_value
  50. name: "WiFi Signal Sensor"
  51.  
  52. #binary_sensor:
  53. # - platform: gpio # btn
  54. # name: "Timer Button"
  55. # id: button1
  56. # pin:
  57. # number: 39
  58. # inverted: true
  59.  
  60.  
  61. switch:
  62. - platform: gpio
  63. id: "myled"
  64. pin: 27
  65.  
  66. light:
  67. - platform: fastled_clockless
  68. chipset: WS2812B
  69. pin: 27
  70. num_leds: 25
  71. rgb_order: GRB
  72. id: status_led
  73. color_correct: [50%, 50%, 50%]
  74. name: 'M5 Light'
  75. effects:
  76. - random:
  77. - flicker:
  78. - addressable_rainbow:
  79. - pulse
  80. - strobe:
  81. name: Strobe Effect With Custom Values
  82. colors:
  83. - state: true
  84. brightness: 100%
  85. red: 100%
  86. green: 90%
  87. blue: 0%
  88. duration: 500ms
  89. - state: false
  90. duration: 250ms
  91. - state: true
  92. brightness: 100%
  93. red: 0%
  94. green: 100%
  95. blue: 0%
  96. duration: 500ms
  97.  
  98. binary_sensor:
  99. - platform: gpio
  100. pin:
  101. number: 39
  102. inverted: true
  103. name: 'M5 Button'
  104. on_press:
  105. then:
  106. # - light.toggle: status_led
  107. - display.page.show_next: led_matrix_display
  108.  
  109.  
  110. display:
  111. - platform: addressable_light
  112. id: led_matrix_display
  113. addressable_light_id: status_led
  114. width: 5
  115. height: 5
  116. rotation: 180°
  117. update_interval: 16ms
  118. pages:
  119. - id: page1
  120. lambda: |-
  121. Color red = Color(0xFF0000);
  122. Color green = Color(0x00FF00);
  123. it.fill(green);
  124. - id: page2
  125. lambda: |-
  126. Color red = Color(0xFF0000);
  127. Color green = Color(0x00FF00);
  128. it.rectangle(0, 0, 0, 0, green);
  129. - id: page3
  130. lambda: |-
  131. Color green = Color(0x00FF00);
  132. it.rectangle(0, 0, 0, 0, green);
  133. - id: page4
  134. lambda: |-
  135. Color green = Color(0x00FF00);
  136. it.rectangle(5,5, 0, 0, green);
  137.  
  138.  
  139.  
  140. select:
  141. - platform: template
  142. name: "Template select"
  143. optimistic: true
  144. options:
  145. - one
  146. - two
  147. - three
  148. initial_option: two
  149.  
  150.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement