esphome: name: "wordclock" esp8266: board: d1_mini framework: version: recommended # esp32: # board: ttgo-t7-v13-mini32 # framework: # type: arduino external_components: - source: type: local path: components components: [ wordclock ] wifi: ssid: !secret wifi_ssid password: !secret wifi_password ap: ssid: "WordClock Configuration" password: !secret ap_password manual_ip: static_ip: !secret manualip_static_ip gateway: !secret manualip_gateway subnet: !secret manualip_subnet dns1: 1.1.1.1 dns2: 1.0.0.1 captive_portal: api: ota: password: "wordclock" logger: select: - platform: template name: "Template select" restore_value: true set_action: - lambda: |- return id(wordclock_1)->set_effect_active(false); optimistic: true options: - effect - color initial_option: effect web_server: port: 80 version: 1 time: - platform: sntp id: current_time timezone: !secret timezone light: - name: NeoPixel Strip 1 id: neopixel_strip_1 platform: neopixelbus type: GRB variant: WS2812 pin: GPIO3 # pin: GPIO22 num_leds: 198 restore_mode: ALWAYS_OFF method: type: esp8266_dma # type: esp32_i2s effects: - addressable_random_twinkle: name: "random_twinkle" display: - platform: addressable_light id: led_matrix_display addressable_light_id: neopixel_strip_1 width: 18 height: 11 rotation: 270° update_interval: 16ms auto_clear_enabled: false pixel_mapper: |- int mapping_even[] = {0, 2, 4, 6,8,10,11,13,15,17, 16,16,16,16, 16,16,16,16}; int mapping_odd[] = {17,15,13,11,9, 7, 6, 4, 2, 0, 16,16,16,16, 16,16,16,16}; if (x > 9) return -1; if (y % 2 == 0) { return (y * 18 + mapping_even[x]); } else { return (y * 18 + mapping_odd[x]); } color: - id: col_on red: 90% green: 50% blue: 0% - id: col_off red: 0% green: 0% blue: 0% wordclock: id: wordclock_1 time_id: current_time display_id: led_matrix_display addressable_light_id: neopixel_strip_1 brightness: 100% color_on: col_on color_off: col_off update_interval: 16ms static_segments: ["IT", "IS"] segments: - {name: "IT", line: {x1: 0, x2: 1, y1: 0}} - {name: "IS", line: {x1: 3, x2: 4, y1: 0}} - {name: "AM", line: {x1: 7, x2: 8, y1: 0}} - {name: "PM", line: {x1: 9, x2: 10, y1: 0}} - {name: "QUARTER", line: {x1: 2, x2: 8, y1: 1}} - {name: "TWENTY", line: {x1: 0, x2: 5, y1: 2}} - {name: "FIVE_MINUTES", line: {x1: 6, x2: 9, y1: 2}} - {name: "HALF", line: {x1: 0, x2: 3, y1: 3}} - {name: "TEN_MINUTES", line: {x1: 5, x2: 7, y1: 3}} - {name: "TO", line: {x1: 9, x2: 10, y1: 3}} - {name: "PAST", line: {x1: 0, x2: 3, y1: 4}} - {name: "NINE", line: {x1: 7, x2: 10, y1: 4}} - {name: "ONE", line: {x1: 0, x2: 2, y1: 5}} - {name: "SIX", line: {x1: 3, x2: 5, y1: 5}} - {name: "THREE", line: {x1: 6, x2: 10, y1: 5}} - {name: "FOUR", line: {x1: 0, x2: 3, y1: 6}} - {name: "FIVE", line: {x1: 4, x2: 7, y1: 6}} - {name: "TWO", line: {x1: 8, x2: 10, y1: 6}} - {name: "EIGHT", line: {x1: 0, x2: 4, y1: 7}} - {name: "ELEVEN", line: {x1: 5, x2: 10, y1: 7}} - {name: "SEVEN", line: {x1: 0, x2: 4, y1: 8}} - {name: "TWELVE", line: {x1: 5, x2: 10, y1: 8}} - {name: "TEN", line: {x1: 0, x2: 2, y1: 9}} - {name: "OCLOCK", line: {x1: 5, x2: 10, y1: 9}} minutes: - {minute: 0, hour_offset: 0, segments: ["OCLOCK"]} - {minute: 5, hour_offset: 0, segments: ["FIVE_MINUTES", "PAST"]} - {minute: 10, hour_offset: 0, segments: ["TEN_MINUTES", "PAST"]} - {minute: 15, hour_offset: 0, segments: ["QUARTER", "PAST"]} - {minute: 20, hour_offset: 0, segments: ["TWENTY", "PAST"]} - {minute: 25, hour_offset: 0, segments: ["TWENTY", "FIVE_MINUTES", "PAST"]} - {minute: 30, hour_offset: 0, segments: ["HALF", "PAST"]} - {minute: 35, hour_offset: 1, segments: ["TWENTY", "FIVE_MINUTES", "TO"]} - {minute: 40, hour_offset: 1, segments: ["TWENTY", "TO"]} - {minute: 45, hour_offset: 1, segments: ["QUARTER", "TO"]} - {minute: 50, hour_offset: 1, segments: ["TEN_MINUTES", "TO"]} - {minute: 55, hour_offset: 1, segments: ["FIVE_MINUTES", "TO"]} hours: - {hour: 0, segments: "TWELVE"} - {hour: 1, segments: "ONE"} - {hour: 2, segments: "TWO"} - {hour: 3, segments: "THREE"} - {hour: 4, segments: "FOUR"} - {hour: 5, segments: "FIVE"} - {hour: 6, segments: "SIX"} - {hour: 7, segments: "SEVEN"} - {hour: 8, segments: "EIGHT"} - {hour: 9, segments: "NINE"} - {hour: 10, segments: "TEN"} - {hour: 11, segments: "ELEVEN"} - {hour: 12, segments: "TWELVE"} - {hour: 13, segments: "ONE"} - {hour: 14, segments: "TWO"} - {hour: 15, segments: "THREE"} - {hour: 16, segments: "FOUR"} - {hour: 17, segments: "FIVE"} - {hour: 18, segments: "SIX"} - {hour: 19, segments: "SEVEN"} - {hour: 20, segments: "EIGHT"} - {hour: 21, segments: "NINE"} - {hour: 22, segments: "TEN"} - {hour: 23, segments: "ELEVEN"}