Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esphome:
- name: ${devicename}
- includes:
- - wordclock.h
- on_boot:
- priority: 800
- then:
- - light.turn_on:
- id: neopixelbuslight
- esp32:
- board: esp32dev
- framework:
- type: arduino
- substitutions:
- devicename: wordclock
- friendly_name: "Wordclock"
- wifi:
- domain: .hq
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- fast_connect: true
- reboot_timeout: 0min
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "${devicename}"
- password: !secret wifi_password
- api:
- encryption:
- key: !secret apiKey
- reboot_timeout: 30min
- ota:
- - platform: esphome
- password: !secret otaPassword
- logger:
- light:
- - platform: neopixelbus
- id: neopixelbuslight
- type: GRB
- variant: ws2812X
- pin: 23
- restore_mode: RESTORE_DEFAULT_ON
- num_leds: 113
- name: ${friendly_name}
- sensor:
- - platform: adc
- pin: A0
- id: ldr_raw
- name: ${friendly_name} LDR (raw)
- unit_of_measurement: "V"
- icon: mdi:sine-wave
- update_interval: 100s # Set this back to 0.1s if I add LDR
- internal: True
- filters:
- # - multiply: 3.3
- - exponential_moving_average:
- send_every: 50
- - platform: template
- name: ${friendly_name} LDR
- id: ldr
- icon: "mdi:brightness-percent"
- unit_of_measurement: "%"
- update_interval: 100s # Set this back to 0.1s if I add LDR
- internal: True
- lambda: |-
- return id(ldr_raw).state;
- filters:
- - calibrate_linear:
- # Map 0.0-1.0 (from sensor) to 0.0-100.0 (true value)
- - 0.0 -> 3.0
- - 0.8 -> 100.0
- - lambda: if (x > 100.0) return 100.0; else return (x);
- switch:
- - platform: template
- name: ${friendly_name} automatic brightness (LDR)
- icon: mdi:brightness-auto
- optimistic: true
- id: useldr
- restore_mode: ALWAYS_OFF
- - platform: template
- name: ${friendly_name} show date
- icon: mdi:calendar-month
- optimistic: true
- id: showdate
- restore_mode: ALWAYS_OFF
- - platform: template
- name: ${friendly_name} color cycle
- icon: mdi:palette
- optimistic: true
- id: colorcycle
- restore_mode: RESTORE_DEFAULT_ON
- select:
- - platform: template
- name: ${friendly_name} time modus
- optimistic: true
- options:
- - Minutes-plus
- - Minutes-min
- initial_option: Minutes-plus
- id: timemodus
- number:
- - platform: template
- name: ${friendly_name} color cycle speed
- optimistic: true
- restore_value: on
- min_value: 0
- max_value: 100
- step: 1
- id: ccspeed
- time:
- - platform: homeassistant
- id: current_time
- custom_component:
- - lambda: |-
- auto wordclock = new Wordclock();
- return {wordclock};
Advertisement
Add Comment
Please, Sign In to add comment