Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- substitutions:
- name: "esphome-display"
- friendly_name: ESPHome Display
- esphome:
- name: ${name}
- friendly_name: ${friendly_name}
- min_version: 2024.6.0
- name_add_mac_suffix: false
- project:
- name: esphome.web
- version: dev
- esp32:
- board: esp32dev
- framework:
- type: arduino
- # Enable logging
- logger:
- level: debug
- # Enable Home Assistant API
- api:
- # Allow Over-The-Air updates
- ota:
- - platform: esphome
- # Allow provisioning Wi-Fi via serial
- improv_serial:
- wifi:
- # Set up a wifi access point
- ap: {}
- # In combination with the `ap` this allows the user
- # to provision wifi credentials to the device via WiFi AP.
- captive_portal:
- dashboard_import:
- package_import_url: github://esphome/example-configs/esphome-web/esp32.yaml@main
- import_full_config: true
- time:
- - platform: homeassistant
- id: homeassistant_time
- sensor:
- - platform: homeassistant
- id: outside_temp
- entity_id: sensor.obyvak_meteo_temperature
- internal: true
- display:
- - platform: tm1637
- id: tm1637_display
- clk_pin: GPIO23
- dio_pin: GPIO22
- inverted: false
- length: 4
- update_interval: 500ms
- lambda: |-
- static int i = 0;
- i = (i + 1) % 60; // reset čítače po 60 iteracích
- if ((i / 30) % 2 == 0) {
- // Zobrazí teplotu v případě, že je "i" mezi 0 a 29
- // Zobrazí teplotu
- char temp_str[5];
- snprintf(temp_str, sizeof(temp_str), "%2.0f C", id(outside_temp).state);
- it.print(temp_str);
- } else {
- // Střídá mezi časovým formátem s tečkou a bez ní
- if (i % 2 == 0) {
- it.strftime("%H%M", id(homeassistant_time).now());
- } else {
- it.strftime("%H.%M", id(homeassistant_time).now());
- }
- }
- # Sets up Bluetooth LE (Only on ESP32) to allow the user
- # to provision wifi credentials to the device.
- esp32_improv:
- authorizer: none
- # To have a "next url" for improv serial
- web_server:
Advertisement
Add Comment
Please, Sign In to add comment