Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sphome:
- name: led-panel
- external_components:
- - source: github://TillFleisch/ESPHome-HUB75-MatrixDisplayWrapper@main
- esp32:
- board: esp32dev
- framework:
- type: arduino
- # Enable logging
- logger:
- # Enable Home Assistant API
- api:
- encryption:
- key: "0Nda/x6F+J7sowdpsCuVfmqvL9aY6qWWT/Gb2G3FF3k="
- ota:
- - platform: esphome
- password: "3e8eb7143d09bfe6f00487feaba2a543"
- wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- font:
- # gfonts://family[@weight]
- - file: "gfonts://Roboto"
- id: roboto
- size: 25
- - file: "gfonts://Roboto"
- id: roboto2
- size: 16
- - file: "arial.ttf"
- id: my_font2
- size: 14
- glyphs:
- - "ř"
- - "ý"
- - "á"
- - "č"
- - "š"
- - "ě"
- - "ú"
- - "ů"
- - "ž"
- - "í"
- - "ó"
- - " "
- - "v"
- - "r"
- - "o"
- - "b"
- - "a"
- - "s"
- - "p"
- - "t"
- - "e"
- - "i"
- - file: "mdi-icons.ttf" # nahraď cestu k TTF souboru
- id: mdi_font
- size: 12 # Nastav velikost ikonky, podle potřeby
- glyphs:
- - "" # Kód ikony pro mdi:solar-power-variant
- - "" # kod pro hodiny
- - "" #100
- - "" #90
- - "" #80
- - "" #70
- - "" #60
- - "" #50
- - "" #40
- - "" #30
- - "" #20
- - "" #0
- - "" # mdi sun thermometer
- - "" # mdi windy
- globals:
- - id: screen_state
- type: int
- initial_value: '0'
- - id: display_time
- type: int
- initial_value: '0'
- interval:
- - interval: 1s
- then:
- - lambda: |-
- if (id(screen_state) == 0) {
- // Pokud je obrazovka hodin, počítej čas
- id(display_time)++;
- if (id(display_time) >= 25) { // 25 sekund pro hodiny
- id(screen_state) = 1; // Přepnout na obrazovku s teplotou
- id(display_time) = 0; // Resetuj čas
- }
- } else {
- // Pokud je obrazovka s teplotou, počítej čas
- id(display_time)++;
- if (id(display_time) >= 7) { // 7 sekund pro teplotu
- id(screen_state) = 0; // Přepnout na hodiny
- id(display_time) = 0; // Resetuj čas
- }
- }
- display:
- - platform: hub75_matrix_display
- id: matrix
- width: 64
- height: 32
- # R1_pin: GPIO21
- #G1_pin: GPIO1
- # B1_pin: GPIO3
- # R2_pin: GPIO19
- # G2_pin: GPIO22
- # B2_pin: GPIO25
- # A_pin: GPIO23
- # B_pin: GPIO26
- # C_pin: GPIO17
- # D_pin: GPIO16
- # E_pin: GPIO4
- # LAT_pin: GPIO27
- # OE_pin: GPIO14
- # CLK_pin: GPIO18
- lambda: |-
- if (id(screen_state) == 0) {
- // Obrazovka 1: Zobraz hodiny
- it.strftime(0, 1, id(roboto), id(oranzova), "%H:%M", id(my_ha_time).now());
- } else {
- // Obrazovka 2: Zobraz teplotu a vítr
- if (id(teplota).has_state()) {
- it.printf(0, 0, id(roboto2), id(bila), " %.1f °C", id(teplota).state);
- }
- if (id(vitr).has_state()) {
- it.printf(0, 15, id(roboto2), id(zelena), " %.1fm/s", id(vitr).state);
- }
- }
- // Zobraz hodiny v HH:MM formátu
- // it.strftime(0, 1, id(roboto), id(cervena), "%H:%M", id(my_ha_time).now());
- //if (id(teplota).has_state() ) {
- // it.printf(0, 0, id(roboto2), id(bila), " %.1f °C", id(teplota).state);
- //}
- //if (id(vitr).has_state() ) {
- // it.printf(0, 15, id(roboto2), id(bordo), " %.1fm/s", id(vitr).state);
- // it.print(0, 20, id(mdi_font), id(svetle_modra), ""); // Zobrazí ikonku mdi:swindy
- //}
- color:
- - id: zluta
- red_int: 200
- green_int: 212
- blue_int: 42
- - id: svetle_zluta
- red_int: 242
- green_int: 255
- blue_int: 158
- - id: bila
- red_int: 255
- green_int: 255
- blue_int: 255
- - id: cervena
- red_int: 255
- green_int: 0
- blue_int: 0
- - id: modra
- red_int: 0
- green_int: 0
- blue_int: 250
- - id: svetle_modra
- red_int: 132
- green_int: 130
- blue_int: 255
- - id: tmave_zelena
- red_int: 22
- green_int: 133
- blue_int: 12
- - id: svetle_zelena
- red_int: 131
- green_int: 242
- blue_int: 161
- - id: zelena
- red_int: 59
- green_int: 255
- blue_int: 41
- - id: oranzova
- red_int: 255
- green_int: 157
- blue_int: 0
- - id: bordo
- red_int: 92
- green_int: 27
- blue_int: 33
- - id: cerna
- red_int: 0
- green_int: 0
- blue_int: 0
- switch:
- - platform: hub75_matrix_display
- matrix_id: matrix
- name: "Power"
- restore_mode: ALWAYS_ON
- id: power
- - platform: restart
- name: "restart led panel"
- number:
- - platform: hub75_matrix_display
- matrix_id: matrix
- name: "Brightness"
- time:
- - platform: homeassistant
- id: my_ha_time
- sensor:
- - platform: homeassistant
- id: "teplota"
- entity_id: sensor.lumi_lumi_weather_temperature
- internal: true
- - platform: homeassistant
- id: "vitr"
- entity_id: sensor.anemometr
- internal: true
- captive_portal:
Advertisement