lawrencehead

Untitled

Mar 30th, 2025
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. esphome:
  2. name: ${devicename}
  3. includes:
  4. - wordclock.h
  5. on_boot:
  6. priority: 800
  7. then:
  8. - light.turn_on:
  9. id: neopixelbuslight
  10.  
  11. esp32:
  12. board: esp32dev
  13. framework:
  14. type: arduino
  15.  
  16. substitutions:
  17. devicename: wordclock
  18. friendly_name: "Wordclock"
  19.  
  20. wifi:
  21. domain: .hq
  22. ssid: !secret wifi_ssid
  23. password: !secret wifi_password
  24. fast_connect: true
  25. reboot_timeout: 0min
  26. # Enable fallback hotspot (captive portal) in case wifi connection fails
  27. ap:
  28. ssid: "${devicename}"
  29. password: !secret wifi_password
  30.  
  31. api:
  32. encryption:
  33. key: !secret apiKey
  34. reboot_timeout: 30min
  35.  
  36. ota:
  37. - platform: esphome
  38. password: !secret otaPassword
  39.  
  40. logger:
  41.  
  42. light:
  43. - platform: neopixelbus
  44. id: neopixelbuslight
  45. type: GRB
  46. variant: ws2812X
  47. pin: 23
  48. restore_mode: RESTORE_DEFAULT_ON
  49. num_leds: 113
  50. name: ${friendly_name}
  51.  
  52. sensor:
  53. - platform: adc
  54. pin: A0
  55. id: ldr_raw
  56. name: ${friendly_name} LDR (raw)
  57. unit_of_measurement: "V"
  58. icon: mdi:sine-wave
  59. update_interval: 100s # Set this back to 0.1s if I add LDR
  60. internal: True
  61. filters:
  62. # - multiply: 3.3
  63. - exponential_moving_average:
  64. send_every: 50
  65.  
  66. - platform: template
  67. name: ${friendly_name} LDR
  68. id: ldr
  69. icon: "mdi:brightness-percent"
  70. unit_of_measurement: "%"
  71. update_interval: 100s # Set this back to 0.1s if I add LDR
  72. internal: True
  73. lambda: |-
  74. return id(ldr_raw).state;
  75. filters:
  76. - calibrate_linear:
  77. # Map 0.0-1.0 (from sensor) to 0.0-100.0 (true value)
  78. - 0.0 -> 3.0
  79. - 0.8 -> 100.0
  80. - lambda: if (x > 100.0) return 100.0; else return (x);
  81.  
  82. switch:
  83. - platform: template
  84. name: ${friendly_name} automatic brightness (LDR)
  85. icon: mdi:brightness-auto
  86. optimistic: true
  87. id: useldr
  88. restore_mode: ALWAYS_OFF
  89. - platform: template
  90. name: ${friendly_name} show date
  91. icon: mdi:calendar-month
  92. optimistic: true
  93. id: showdate
  94. restore_mode: ALWAYS_OFF
  95. - platform: template
  96. name: ${friendly_name} color cycle
  97. icon: mdi:palette
  98. optimistic: true
  99. id: colorcycle
  100. restore_mode: RESTORE_DEFAULT_ON
  101.  
  102. select:
  103. - platform: template
  104. name: ${friendly_name} time modus
  105. optimistic: true
  106. options:
  107. - Minutes-plus
  108. - Minutes-min
  109. initial_option: Minutes-plus
  110. id: timemodus
  111.  
  112. number:
  113. - platform: template
  114. name: ${friendly_name} color cycle speed
  115. optimistic: true
  116. restore_value: on
  117. min_value: 0
  118. max_value: 100
  119. step: 1
  120. id: ccspeed
  121.  
  122. time:
  123. - platform: homeassistant
  124. id: current_time
  125.  
  126. custom_component:
  127. - lambda: |-
  128. auto wordclock = new Wordclock();
  129. return {wordclock};
  130.  
Advertisement
Add Comment
Please, Sign In to add comment