Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esphome:
- name: led-matrix-hub75-huidu-wf2
- friendly_name: LED matrix Huidu HD-WF2
- platformio_options:
- board_build.flash_mode: dio
- external_components:
- - source: github://TillFleisch/ESPHome-HUB75-MatrixDisplayWrapper@main
- esp32:
- board: esp32-s3-devkitc-1
- framework:
- type: arduino
- # Enable logging
- logger:
- # Enable Home Assistant API
- api:
- encryption:
- key: "W5ufDXe+qbwF093N5dcZ4rlenzT3B5tGYBnbX90IPjo="
- ota:
- - platform: esphome
- wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "Wf2 Fallback Hotspot"
- password: "86427860"
- captive_portal:
- i2c:
- sda: 41
- scl: 42
- time:
- - platform: homeassistant
- id: homeassistant_time
- font:
- - file: "gfonts://Roboto"
- id: roboto
- size: 16
- sensor:
- - platform: homeassistant
- entity_id: sensor.fajr_azaan
- id: fajr_azaan_sensor
- display:
- - platform: hub75_matrix_display
- id: huidu_wf2_x1
- width: 128
- height: 64
- chain_length: 1
- clock_phase: false
- R1_pin: 2
- R2_pin: 3
- G1_pin: 6
- G2_pin: 7
- B1_pin: 10
- B2_pin: 11
- A_pin: 39
- B_pin: 38
- C_pin: 37
- D_pin: 36
- E_pin: 21
- OE_pin: 35
- CLK_pin: 34
- LAT_pin: 33
- lambda: |-
- it.fill(Color(0, 0, 0)); // Clear the screen
- auto red = Color(255, 0, 0);
- auto white = Color(255, 255, 255);
- // Draw a border
- it.rectangle(2, 2, 124, 60, red);
- // Display "Fajr Azaan" label
- it.print(5, 10, id(roboto), white, TextAlign::TOP_LEFT, "Fajr Azaan:");
- // Convert float to string and display it
- char time_str[6]; // Buffer for HH:MM format
- snprintf(time_str, sizeof(time_str), "%02.0f:%02.0f", floor(id(fajr_azaan_sensor).state),
- (id(fajr_azaan_sensor).state - floor(id(fajr_azaan_sensor).state)) * 60);
- it.print(5, 30, id(roboto), white, TextAlign::TOP_LEFT, time_str);
- switch:
- - platform: hub75_matrix_display
- matrix_id: huidu_wf2_x1
- restore_mode: ALWAYS_ON
- id: matrix_power
- - platform: gpio
- id: led_run
- pin: 40
- binary_sensor:
- - platform: gpio
- id: test_key
- pin:
- number: 17
- inverted: true
- number:
- - platform: hub75_matrix_display
- matrix_id: huidu_wf2_x1
- name: "Brightness"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement