Advertisement
captain380

Untitled

Feb 15th, 2025
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1.  
  2. esphome:
  3. name: led-matrix-hub75-huidu-wf2
  4. friendly_name: LED matrix Huidu HD-WF2
  5. platformio_options:
  6. board_build.flash_mode: dio
  7.  
  8. external_components:
  9. - source: github://TillFleisch/ESPHome-HUB75-MatrixDisplayWrapper@main
  10.  
  11. esp32:
  12. board: esp32-s3-devkitc-1
  13. framework:
  14. type: arduino
  15.  
  16. # Enable logging
  17. logger:
  18.  
  19. # Enable Home Assistant API
  20. api:
  21. encryption:
  22. key: !secret api_encryption_key
  23.  
  24. ota:
  25. - platform: esphome
  26. password: !secret ota_password
  27.  
  28. wifi:
  29. ssid: !secret wifi_ssid
  30. password: !secret wifi_password
  31.  
  32. # Enable fallback hotspot (captive portal) in case wifi connection fails
  33. ap:
  34. ssid: "LED Matrix Huidu WF2 Fallback Hotspot"
  35. password: !secret wifi_password
  36.  
  37. captive_portal:
  38.  
  39. i2c:
  40. sda: 41
  41. scl: 42
  42.  
  43. time:
  44. - platform: pcf8563
  45. address: 0x51
  46. id: pcf8563_time
  47. - platform: homeassistant
  48. on_time_sync:
  49. then:
  50. pcf8563.write_time:
  51.  
  52. font:
  53. # gfonts://family[@weight]
  54. - file: "gfonts://Roboto"
  55. id: roboto
  56. size: 12
  57.  
  58. display:
  59. - platform: hub75_matrix_display
  60. id: huidu_wf2_x1
  61. width: 64
  62. height: 32
  63. chain_length: 2
  64. clock_phase: false
  65. R1_pin: 2
  66. R2_pin: 3
  67. G1_pin: 6
  68. G2_pin: 7
  69. B1_pin: 10
  70. B2_pin: 11
  71. A_pin: 39
  72. B_pin: 38
  73. C_pin: 37
  74. D_pin: 36
  75. E_pin: 21
  76. OE_pin: 35
  77. CLK_pin: 34
  78. LAT_pin: 33
  79. lambda: |-
  80. auto red = Color(255, 0, 0);
  81. auto blue = Color(0, 0, 255);
  82. auto rtc = id(pcf8563_time).now();
  83. it.line(4, 25, 4 + 2 * rtc.second, 25, blue);
  84. it.rectangle(2, 2, 124, 28, red);
  85. it.strftime(7, 8, id(roboto), "%Y-%m-%d %H:%M:%S", rtc);
  86. //it.print(20, 10, id(roboto), "Hello World!");
  87.  
  88. switch:
  89. - platform: hub75_matrix_display
  90. matrix_id: huidu_wf2_x1
  91. restore_mode: ALWAYS_ON
  92. id: matrix_power
  93. - platform: gpio
  94. id: led_run
  95. pin: 40
  96.  
  97. binary_sensor:
  98. - platform: gpio
  99. id: test_key
  100. pin:
  101. number: 17
  102. inverted: true
  103.  
  104. number:
  105. - platform: hub75_matrix_display
  106. matrix_id: huidu_wf2_x1
  107. name: "Brightness"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement