Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- substitutions:
- name: "plate2"
- device_description: Wall display
- allowed_characters: " !#%'()+,-./0123456789:;<>?&@AÁBCDEÉFGHIÍJKLMNOÓÖŐPQRSTUÚÜŰVWYZ[]_aábcdeéfghiíjklmnoóöőpqrstuúüűvwxyz{|}°"
- globals:
- - id: active_page
- type: int
- restore_value: no
- initial_value: "1"
- esphome:
- name: "${name}"
- comment: "${device_description}"
- platformio_options:
- build_flags: "-DBOARD_HAS_PSRAM"
- board_build.arduino.memory_type: qio_opi
- board_build.flash_mode: dio
- on_boot:
- - delay: 5s
- - lvgl.widget.hide: boot_screen
- esp32:
- board: esp32-s3-devkitc-1
- framework:
- type: esp-idf
- sdkconfig_options:
- COMPILER_OPTIMIZATION_SIZE: y
- CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
- CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
- CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"
- CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
- CONFIG_SPIRAM_RODATA: y
- flash_size: 16MB
- partitions: "default_16MB.csv"
- psram:
- mode: octal
- speed: 80MHz
- logger:
- level: DEBUG
- api:
- encryption:
- key: !secret api_key
- reboot_timeout: 10 min
- ota:
- - platform: esphome
- password: !secret wifi_password
- wifi:
- id: iptime
- ssid: !secret ssid
- password: !secret wifi_pass
- reboot_timeout: 10 min
- manual_ip:
- static_ip: 192.168.1.177
- gateway: 192.168.1.1
- subnet: 255.255.255.0
- dns1: !secret dns1
- dns2: !secret dns2
- power_save_mode: HIGH
- fast_connect: false
- ap:
- ssid: "${name} hotspot"
- password: !secret wifi_password
- captive_portal:
- i2c:
- scl: GPIO45
- sda: GPIO19
- scan: True
- spi:
- clk_pin: GPIO48
- mosi_pin: GPIO47
- interval:
- - interval: 60s
- then:
- - lvgl.label.update:
- id: info_label_1
- text: !lambda 'return id(info_panel).state.c_str();'
- - lvgl.label.update:
- id: info_label_2
- text: !lambda 'return id(info_panel).state.c_str();'
- light:
- - platform: monochromatic
- output: backlight_pwm
- id: backlight
- name: "${name} háttérvilágítás"
- restore_mode: RESTORE_AND_ON
- - platform: binary
- output: internal_relay
- name: "${name} Light Switch"
- id: light_switch_1
- restore_mode: RESTORE_DEFAULT_OFF
- output:
- - platform: ledc
- id: backlight_pwm
- pin: GPIO38
- frequency: 1000Hz
- min_power: 0.3
- zero_means_zero: True
- - platform: gpio
- id: internal_relay
- pin: 40
- display:
- - platform: st7701s
- id: my_display
- update_interval: 1s
- auto_clear_enabled: false
- data_rate: 2MHz
- spi_mode: MODE3
- color_order: RGB
- invert_colors: false
- dimensions:
- width: 480
- height: 480
- cs_pin: 39
- de_pin: 18
- hsync_pin: 16
- vsync_pin: 17
- pclk_pin: 21
- pclk_frequency: 12MHz
- pclk_inverted: false
- hsync_pulse_width: 8
- hsync_front_porch: 10
- hsync_back_porch: 20
- vsync_pulse_width: 8
- vsync_front_porch: 10
- vsync_back_porch: 10
- init_sequence:
- - 1
- - [0xFF, 0x77, 0x01, 0x00, 0x00, 0x10]
- - [0xCD, 0x00]
- data_pins:
- red:
- - 11 # R1
- - 12 # R2
- - 13 # R3
- - 14 # R4
- - 0 # R5
- green:
- - 8 # G0
- - 20 # G1
- - 3 # G2
- - 46 # G3
- - 9 # G4
- - 10 # G5
- blue:
- - 4 # B1
- - 5 # B2
- - 6 # B3
- - 7 # B4
- - 15 # B5
- touchscreen:
- platform: gt911
- transform:
- mirror_x: false
- mirror_y: false
- id: my_touchscreen
- display: my_display
- on_touch:
- - lambda: |-
- ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
- touch.x,
- touch.y,
- touch.x_raw,
- touch.y_raw
- );
- - if:
- condition:
- - light.is_off: backlight
- then:
- - lvgl.resume:
- - lvgl.widget.redraw:
- - light.turn_on:
- id: backlight
- brightness: 100%
- - lvgl.page.show: workshop_page
- time:
- platform: sntp
- timezone: !secret timezone
- id: time1
- servers: !secret servers
- on_time_sync:
- - script.execute: time_update
- - logger.log: "Time updated"
- on_time:
- - minutes: '*'
- seconds: 0
- then:
- - script.execute: time_update
- - lvgl.label.update:
- id: time_now
- text: !lambda |-
- return id(time1).now().strftime("%H:%M");
- sun:
- latitude: !secret lat
- longitude: !secret long
- ################################################################################### Fonts ##########
- font:
- - file: "/root/config/fonts/Amiko.ttf"
- id: amiko16
- size: 16
- bpp: 4
- glyphs: ${allowed_characters}
- - file: "/root/config/fonts/Amiko.ttf"
- id: amiko20
- size: 20
- bpp: 4
- glyphs: ${allowed_characters}
- - file: "/root/config/fonts/Amiko.ttf"
- id: amiko24
- size: 24
- bpp: 4
- glyphs: ${allowed_characters}
- - file: "/root/config/fonts/Amiko.ttf"
- id: amiko32
- size: 32
- bpp: 4
- glyphs: ${allowed_characters}
- - file: "/root/config/fonts/Amiko.ttf"
- id: amiko40
- size: 40
- bpp: 4
- glyphs: ${allowed_characters}
- - file: "/root/config/fonts/Amiko.ttf"
- id: amiko48
- size: 48
- bpp: 4
- glyphs: ${allowed_characters}
- extras:
- - file: "fonts/mdi.ttf"
- id: mdi48
- size: 48
- bpp: 4
- glyphs: [
- "\U000F11DC", # window-open-variant
- "\U000F11DB", # window-closed-variant
- "\U000F1092", # soldering-iron
- "\U000F095F", # desk-lamp
- "\U000F1051", # led-strip-variant
- "\U000F02E3", # bed
- "\U000F04B9", # sofa
- "\U000F02DC", # home
- "\U000F0013", # account-outline
- "\U000F0004", # account
- "\U000F1435", # motion-sensor-off
- "\U000F0D91", # motion-sensor
- "\U000F0769", # ceiling-lamp
- "\U000F08DD", # floor-lamp
- "\U000F081B", # door-closed
- "\U000F081C", # door-open
- "\U000F0060", # arrow-up-bold-circle-outline
- "\U000F0048", # arrow-down-bold-circle-outline
- "\U000F04DB", # stop
- "\U000F0CCB", # shield-home-outline
- "\U000F11A3", # shield-sync-outline
- "\U000F0ECD", # shield-alert-outline
- "\U000F0CC8" # shiel-check-outline
- ]
- ################################################################################## Images ##########
- image:
- - file: "icons/sunny.png"
- id: sunny
- type: RGB565
- use_transparency: true
- - file: "icons/cloudy_sunny.png"
- id: cloudysunny
- type: RGB565
- use_transparency: true
- - file: "icons/cloudy.png"
- id: cloudy
- type: RGB565
- use_transparency: true
- - file: "icons/lightning.png"
- id: lightning
- type: RGB565
- use_transparency: true
- - file: "icons/partlycloudy.png"
- id: partlycloudy
- type: RGB565
- use_transparency: true
- - file: "icons/rainy.png"
- id: rainy
- type: RGB565
- use_transparency: true
- - file: "icons/snowy.png"
- id: snowy
- type: RGB565
- use_transparency: true
- - file: "icons/windy.png"
- id: windy
- type: RGB565
- use_transparency: true
- - file: "icons/hail.png"
- id: hail
- type: RGB565
- use_transparency: true
- - file: "icons/pouring.png"
- id: pouring
- type: RGB565
- use_transparency: true
- - file: "icons/clearnight.png"
- id: clearnight
- type: RGB565
- use_transparency: true
- - file: "icons/snight.png"
- id: scloud
- type: RGB565
- use_transparency: true
- - file: "/root/config/backgrounds/hk-Bedroom_2.png"
- id: bedroom
- type: RGB565
- use_transparency: true
- - file: "/root/config/backgrounds/hk-Office_1.png"
- id: workshop
- type: RGB565
- use_transparency: true
- - file: "/root/config/backgrounds/hk-Living_Room.png"
- id: livingroom
- type: RGB565
- use_transparency: true
- - file: "/root/config/backgrounds/hk-House.png"
- id: house
- type: RGB565
- use_transparency: true
- - file: "/root/config/backgrounds/hk-Alarm.png"
- id: alarm_bg
- type: RGB565
- use_transparency: true
- - file: https://esphome.io/_static/favicon-512x512.png
- id: boot_logo
- resize: 200x200
- type: RGB565
- use_transparency: true
- ################################################################################# Sensors ##########
- sensor:
- - platform: homeassistant
- entity_id: sensor.homerseklet_kulso
- name: Külső hőmérséklet
- id: temp_outside_ha
- accuracy_decimals: 1
- on_value:
- - lvgl.label.update:
- id: temp_outside
- text:
- format: "%.1f°C"
- args: [ 'x' ]
- - platform: homeassistant
- entity_id: sensor.homerseklet_dolgozo
- name: Dolgozó hőmérséklet
- id: temp_workshop_ha
- accuracy_decimals: 0
- on_value:
- - lvgl.label.update:
- id: temp_workshop
- text:
- format: "%.0f°C"
- args: [ 'x' ]
- - platform: homeassistant
- entity_id: sensor.homerseklet_haloszoba
- name: Hálószoba hőmérséklet
- id: temp_bedroom_ha
- accuracy_decimals: 0
- on_value:
- - lvgl.label.update:
- id: temp_bedroom
- text:
- format: "%.0f°C"
- args: [ 'x' ]
- - platform: homeassistant
- entity_id: sensor.homero_nappali_temperature
- name: Nappali hőmérséklet
- id: temp_livingroom_ha
- accuracy_decimals: 0
- on_value:
- - lvgl.label.update:
- id: temp_livingroom
- text:
- format: "%.0f°C"
- args: [ 'x' ]
- ############################################################################ Text sensors ##########
- text_sensor:
- - platform: homeassistant
- entity_id: weather.otthon_2
- name: Időjárás ikon
- id: weather_icon_ha
- on_value:
- - script.execute: update_weather_icon
- - script.execute: update_weather_text
- - platform: homeassistant
- entity_id: sensor.info_panel
- id: info_panel
- ################################################################################ Workshop ##########
- - platform: homeassistant
- entity_id: binary_sensor.workshop_presence
- id: workshop_presence
- on_value:
- - script.execute: update_workshop_presence_button
- - platform: homeassistant
- entity_id: binary_sensor.nyitaserzekelo_dolgozo_ablak_contact
- id: workshop_window
- on_value:
- - script.execute: update_workshop_window_button
- - platform: homeassistant
- entity_id: light.mennyezeti_lampa_dolgozo
- id: ceiling_lamp_workshop
- on_value:
- - script.execute: update_ceiling_lamp_workshop_button
- - platform: homeassistant
- entity_id: light.allolampa_dolgozo
- id: standing_lamp_workshop
- on_value:
- - script.execute: update_standing_lamp_workshop_button
- - platform: homeassistant
- entity_id: light.iroasztal_vilagitas
- id: desk_lamp_workshop
- on_value:
- - script.execute: update_desk_lamp_workshop_button
- ################################################################################# Bedroom ##########
- - platform: homeassistant
- entity_id: binary_sensor.haloszoba_jelenleterzekelo_any_presence
- id: bedroom_presence
- on_value:
- - script.execute: update_bedroom_presence_button
- - platform: homeassistant
- entity_id: binary_sensor.nyitaserzekelo_haloszoba_ablak_contact
- id: bedroom_window
- on_value:
- - script.execute: update_bedroom_window_button
- - platform: homeassistant
- entity_id: switch.fali_kapcsolo_haloszoba_l1
- id: ceiling_lamp_bedroom
- on_value:
- - script.execute: update_ceiling_lamp_bedroom_button
- - platform: homeassistant
- entity_id: light.allolampa_haloszoba
- id: standing_lamp_bedroom
- on_value:
- - script.execute: update_standing_lamp_bedroom_button
- - platform: homeassistant
- entity_id: light.headboard
- id: headboard_bedroom
- on_value:
- - script.execute: update_headboard_bedroom_button
- ############################################################################## Livingroom ##########
- - platform: homeassistant
- entity_id: binary_sensor.mozgaserzekelo_nappali_occupancy
- id: livingroom_presence
- on_value:
- - script.execute: update_livingroom_presence_button
- - platform: homeassistant
- entity_id: binary_sensor.nyitaserzekelo_nappali_ablak_jobb_contact
- id: livingroom_window
- on_value:
- - script.execute: update_livingroom_window_button
- - platform: homeassistant
- entity_id: light.fali_kapcsolo_nappali_left
- id: ceiling_lamp_livingroom
- on_value:
- - script.execute: update_ceiling_lamp_livingroom_button
- - platform: homeassistant
- entity_id: light.nappali_ambient
- id: ambient_livingroom
- on_value:
- - script.execute: update_ambient_livingroom_button
- ################################################################################ Entrance ##########
- - platform: homeassistant
- entity_id: binary_sensor.nyitaserzekelo_bejarati_ajto_contact
- id: door_entrance
- on_value:
- - script.execute: update_door_entrance_button
- - platform: homeassistant
- entity_id: alarm_control_panel.alarmo
- id: alarm_state
- on_value:
- - script.execute: update_alarm_button
- - platform: homeassistant
- entity_id: binary_sensor.mozgaserzekelo_eloszoba_foldszint_occupancy
- id: presence_entrance
- on_value:
- - script.execute: update_presence_entrance_button
- #################################################################################### LVGL ##########
- lvgl:
- displays:
- - my_display
- touchscreens:
- - my_touchscreen
- # log_level: INFO
- on_idle:
- - timeout: 120s
- then:
- if:
- condition:
- - light.is_on: backlight
- then:
- - lvgl.page.show: clock_page
- - light.turn_on:
- id: backlight
- brightness: 1%
- - lambda: |-
- id(active_page) = 0;
- - logger.log: "Active page: 0"
- - script.execute: refresh_buttons
- # - timeout: 5min
- # then:
- # if:
- # condition:
- # - light.is_on: backlight
- # then:
- # - light.turn_off: backlight
- # - lvgl.pause:
- # - logger.log: "Inactive mode"
- ################################################################################## Styles ##########
- style_definitions:
- - id: top_layer_buttons
- width: 130
- height: 50
- bg_opa: TRANSP
- border_opa: TRANSP
- shadow_opa: TRANSP
- - id: top_layer_icons
- text_color: 0xff9e00
- text_font: mdi48
- bg_opa: TRANSP
- border_opa: TRANSP
- align: CENTER
- - id: title
- x: 130
- y: 5
- width: 350
- height: 50
- bg_opa: TRANSP
- border_opa: TRANSP
- shadow_opa: TRANSP
- text_color: 0xFFFFFF
- text_font: amiko48
- text_align: CENTER
- - id: status_row_button
- width: 98
- height: 98
- radius: 35
- bg_opa: TRANSP
- border_width: 1
- border_opa: COVER
- border_color: 0xfffff
- shadow_opa: TRANSP
- - id: status_row_active_button
- width: 98
- height: 98
- radius: 35
- bg_opa: 90%
- bg_color: 0xffffff
- border_width: 1
- border_opa: COVER
- border_color: 0xfffff
- shadow_opa: TRANSP
- - id: status_row_label
- text_color: 0xFFFFFF
- text_font: mdi48
- align: CENTER
- - id: status_row_active_label
- text_color: 0xff9e00
- text_font: mdi48
- bg_opa: TRANSP
- align: CENTER
- - id: actual_button
- width: 110
- height: 110
- radius: 10
- shadow_opa: TRANSP
- bg_color: 0x000000
- bg_opa: 50%
- - id: actual_button_active
- width: 110
- height: 110
- radius: 10
- shadow_opa: TRANSP
- bg_color: 0xffffff
- bg_opa: 90%
- - id: actual_button_label_icon
- width: 50
- height: 50
- text_color: 0xffffff
- text_font: mdi48
- opa: 50%
- - id: actual_button_label_icon_active
- width: 50
- height: 50
- text_color: 0xff9e00
- text_font: mdi48
- opa: 90%
- - id: actual_button_label_name
- width: 105
- height: 20
- text_color: 0xffffff
- text_font: amiko16
- opa: 50%
- - id: actual_button_label_name_active
- width: 105
- height: 20
- text_color: 0x000000
- text_font: amiko16
- opa: 90%
- - id: actual_button_label_status
- width: 100
- height: 30
- text_color: 0xffffff
- text_font: amiko24
- opa: 50%
- - id: actual_button_label_status_active
- width: 100
- height: 30
- text_color: 0x000000
- text_font: amiko24
- opa: 90%
- - id: blind_obj
- width: 110
- height: 225
- radius: 10
- shadow_opa: TRANSP
- bg_color: 0xffffff
- bg_opa: 80%
- pad_all: 0
- scrollbar_mode: "OFF"
- - id: blind_control_button
- width: 100
- height: 50
- bg_opa: TRANSP
- border_opa: TRANSP
- shadow_opa: TRANSP
- - id: blind_control_button_label
- text_color: 0x000000
- text_font: mdi48
- align: CENTER
- opa: 90%
- bg_opa: TRANSP
- ############################################################################### Top layer ##########
- top_layer:
- widgets:
- - button:
- x: 0
- y: 0
- styles: top_layer_buttons
- widgets:
- - label:
- id: time_now
- text: --:--
- text_color: 0xFFFFFF
- text_font: amiko40
- - button:
- x: 0
- y: 50
- width: 130
- height: 130
- bg_opa: TRANSP
- shadow_opa: TRANSP
- widgets:
- - image:
- id: weather_icon
- src: partlycloudy
- align: CENTER
- - button:
- x: 0
- y: 160
- styles: top_layer_buttons
- widgets:
- - label:
- id: weather_text
- text: "Nem elérhető"
- text_color: 0xFFFFFF
- text_font: amiko16
- align: CENTER
- - button:
- x: 0
- y: 210
- styles: top_layer_buttons
- widgets:
- - label:
- id: temp_outside
- text: "--.-°C"
- text_color: 0xFFFFFF
- text_font: amiko32
- text_align: CENTER
- - button:
- id: button_workshop
- x: 0
- y: 280
- styles: top_layer_buttons
- on_press:
- then:
- - lvgl.page.show: workshop_page
- - lambda: |-
- id(active_page) = 1;
- - logger.log: "Active page: 1"
- - script.execute: refresh_buttons
- widgets:
- - label:
- id: button_workshop_label
- text: "\U000F095F"
- styles: top_layer_icons
- text_color: 0xff9e00
- - button:
- id: button_bedroom
- x: 0
- y: 330
- styles: top_layer_buttons
- on_press:
- then:
- - lvgl.page.show: bedroom_page
- - lambda: |-
- id(active_page) = 2;
- - logger.log: "Active page: 2"
- - script.execute: refresh_buttons
- widgets:
- - label:
- id: button_bedroom_label
- text: "\U000F02E3"
- styles: top_layer_icons
- text_color: 0xffffff
- - button:
- id: button_livingroom
- x: 0
- y: 380
- styles: top_layer_buttons
- on_press:
- then:
- - lvgl.page.show: livingroom_page
- - lambda: |-
- id(active_page) = 3;
- - logger.log: "Active page: 3"
- - script.execute: refresh_buttons
- widgets:
- - label:
- id: button_livingroom_label
- text: "\U000F04B9"
- styles: top_layer_icons
- text_color: 0xffffff
- - button:
- id: button_house
- x: 0
- y: 430
- styles: top_layer_buttons
- on_press:
- then:
- - lvgl.page.show: house_page
- - lambda: |-
- id(active_page) = 4;
- - logger.log: "Active page: 4"
- - script.execute: refresh_buttons
- widgets:
- - label:
- id: button_house_label
- text: "\U000F02DC"
- styles: top_layer_icons
- text_color: 0xffffff
- # make sure it's the last one in this list:
- - obj:
- id: boot_screen
- x: 0
- y: 0
- width: 100%
- height: 100%
- bg_color: 0xffffff
- bg_opa: COVER
- radius: 0
- pad_all: 0
- border_width: 0
- widgets:
- - image:
- align: CENTER
- src: boot_logo
- y: -40
- - spinner:
- align: CENTER
- y: 95
- height: 50
- width: 50
- spin_time: 1s
- arc_length: 60deg
- arc_width: 8
- indicator:
- arc_color: 0x18bcf2
- arc_width: 8
- on_press:
- - lvgl.widget.hide: boot_screen
- pages:
- ########################################################################### Workshop page ##########
- - id: workshop_page
- widgets:
- - image:
- x: 0
- y: 0
- width: 480
- height: 480
- src: workshop
- - label:
- text: "Dolgozó"
- styles: title
- - button:
- x: 150
- y: 83
- styles: status_row_button
- widgets:
- - label:
- id: temp_workshop
- text: "23°C"
- text_color: 0xFFFFFF
- text_font: amiko24
- align: CENTER
- - label:
- x: 148
- y: 178
- width: 102
- height: 20
- text: "Hőmérséklet"
- text_color: 0xFFFFFF
- text_font: amiko16
- text_align: CENTER
- - button:
- id: presence_workshop
- x: 260
- y: 83
- styles: status_row_button
- widgets:
- - label:
- id: presence_workshop_label
- text: "\U000F0013"
- styles: status_row_label
- - label:
- x: 260
- y: 178
- width: 98
- height: 20
- text: "Jelenlét"
- text_color: 0xFFFFFF
- text_font: amiko16
- text_align: CENTER
- - button:
- id: window_workshop_button
- x: 370
- y: 83
- styles: status_row_button
- widgets:
- - label:
- id: window_workshop_label
- text: "\U000F11DB"
- styles: status_row_label
- - label:
- x: 370
- y: 178
- width: 98
- height: 20
- text: "Ablak"
- text_color: 0xFFFFFF
- text_font: amiko16
- text_align: CENTER
- - button:
- id: ceiling_lamp_workshop_button
- x: 135
- y: 220
- styles: actual_button
- checkable: true
- checked:
- styles: actual_button_active
- on_click:
- - light.toggle: light_switch_1
- widgets:
- - label:
- id: ceiling_lamp_workshop_label_icon
- x: -10
- y: -10
- text: "\U000F0769"
- styles: actual_button_label_icon
- - label:
- id: ceiling_lamp_workshop_label_name
- x: -5
- y: 50
- text: "Mennyezeti lámpa"
- long_mode: SCROLL_CIRCULAR
- styles: actual_button_label_name
- - label:
- id: ceiling_lamp_workshop_label_status
- x: 10
- y: 70
- text: "KI"
- styles: actual_button_label_status
- - button:
- id: standing_lamp_workshop_button
- x: 250
- y: 220
- styles: actual_button
- on_click:
- - homeassistant.action:
- action: light.toggle
- data:
- entity_id: light.allolampa_dolgozo
- widgets:
- - label:
- id: standing_lamp_workshop_label_icon
- x: -10
- y: -10
- text: "\U000F08DD"
- styles: actual_button_label_icon
- - label:
- id: standing_lamp_workshop_label_name
- x: -5
- y: 50
- text: "Állólámpa"
- styles: actual_button_label_name
- - label:
- id: standing_lamp_workshop_label_status
- x: 10
- y: 70
- text: "KI"
- styles: actual_button_label_status
- - button:
- id: desk_lamp_button
- x: 135
- y: 350
- styles: actual_button
- on_click:
- - homeassistant.action:
- action: light.toggle
- data:
- entity_id: light.iroasztal_vilagitas
- widgets:
- - label:
- id: desk_lamp_label_icon
- x: -10
- y: -10
- text: "\U000F095F"
- styles: actual_button_label_icon
- - label:
- id: desk_lamp_label_name
- x: -5
- y: 50
- text: "Íróasztal"
- styles: actual_button_label_name
- - label:
- id: desk_lamp_label_status
- x: 10
- y: 70
- text: "KI"
- styles: actual_button_label_status
- ############################################################################ Bedroom page ##########
- - id: bedroom_page
- widgets:
- - image:
- x: 0
- y: 0
- width: 480
- height: 480
- src: bedroom
- - label:
- text: "Hálószoba"
- styles: title
- - button:
- x: 150
- y: 83
- styles: status_row_button
- widgets:
- - label:
- id: temp_bedroom
- text: "23°C"
- text_color: 0xFFFFFF
- text_font: amiko24
- align: CENTER
- - label:
- x: 148
- y: 178
- width: 102
- height: 20
- text: "Hőmérséklet"
- text_color: 0xFFFFFF
- text_font: amiko16
- - button:
- id: presence_bedroom
- x: 260
- y: 83
- styles: status_row_button
- widgets:
- - label:
- id: presence_bedroom_label
- text: "\U000F0013"
- styles: status_row_label
- - label:
- x: 280
- y: 178
- width: 78
- height: 20
- text: "Jelenlét"
- text_color: 0xFFFFFF
- text_font: amiko16
- - button:
- id: window_bedroom_button
- x: 370
- y: 83
- styles: status_row_button
- widgets:
- - label:
- id: window_bedroom_label
- text: "\U000F11DB"
- styles: status_row_label
- - label:
- x: 395
- y: 178
- width: 83
- height: 20
- text: "Ablak"
- text_color: 0xFFFFFF
- text_font: amiko16
- - button:
- id: ceiling_lamp_bedroom_button
- x: 135
- y: 220
- styles: actual_button
- on_click:
- - homeassistant.action:
- action: switch.toggle
- data:
- entity_id: switch.fali_kapcsolo_haloszoba_l1
- widgets:
- - label:
- id: ceiling_lamp_bedroom_label_icon
- x: -10
- y: -10
- text: "\U000F0769"
- styles: actual_button_label_icon
- - label:
- id: ceiling_lamp_bedroom_label_name
- x: -5
- y: 50
- text: "Mennyezeti lámpa"
- long_mode: SCROLL_CIRCULAR
- styles: actual_button_label_name
- - label:
- id: ceiling_lamp_bedroom_label_status
- x: 10
- y: 70
- text: "KI"
- styles: actual_button_label_status
- - button:
- id: standing_lamp_bedroom_button
- x: 250
- y: 220
- styles: actual_button
- on_click:
- - homeassistant.action:
- action: light.toggle
- data:
- entity_id: light.allolampa_haloszoba
- widgets:
- - label:
- id: standing_lamp_bedroom_label_icon
- x: -10
- y: -10
- text: "\U000F08DD"
- styles: actual_button_label_icon
- - label:
- id: standing_lamp_bedroom_label_name
- x: -5
- y: 50
- text: "Állólámpa"
- styles: actual_button_label_name
- - label:
- id: standing_lamp_bedroom_label_status
- x: 10
- y: 70
- text: "KI"
- styles: actual_button_label_status
- - obj:
- id: blind_bedroom_button
- x: 365
- y: 220
- styles: blind_obj
- widgets:
- - button:
- id: blind_up_button
- x: 0
- y: 0
- styles: blind_control_button
- on_click:
- - homeassistant.action:
- action: cover.open
- data:
- entity_id: cover.haloszoba_sotetito
- widgets:
- - label:
- text: "\U000F0060"
- styles: blind_control_button_label
- - label:
- id: blind_label_name
- x: 0
- y: 60
- text: "Sötétítő"
- text_align: CENTER
- styles: actual_button_label_name_active
- - button:
- id: blind_stop_button
- x: 0
- y: 85
- styles: blind_control_button
- on_click:
- - homeassistant.action:
- action: cover.stop
- data:
- entity_id: cover.haloszoba_sotetito
- widgets:
- - label:
- text: "\U000F04DB"
- styles: blind_control_button_label
- - label:
- id: blind_label_state
- x: 0
- y: 150
- text: "Nyitva"
- text_align: CENTER
- styles: actual_button_label_name_active
- - button:
- id: blind_down_button
- x: 0
- y: 155
- styles: blind_control_button
- on_click:
- - homeassistant.action:
- action: cover.close
- data:
- entity_id: cover.haloszoba_sotetito
- widgets:
- - label:
- text: "\U000F0048"
- styles: blind_control_button_label
- - button:
- id: headboard_bedroom_button
- x: 135
- y: 340
- styles: actual_button
- on_click:
- - homeassistant.action:
- action: light.toggle
- data:
- entity_id: light.headboard
- widgets:
- - label:
- id: headboard_bedroom_label_icon
- x: -10
- y: -10
- text: "\U000F1051"
- styles: actual_button_label_icon
- - label:
- id: headboard_bedroom_label_name
- x: -5
- y: 50
- text: "Headboard"
- styles: actual_button_label_name
- - label:
- id: headboard_bedroom_label_status
- x: 10
- y: 70
- text: "KI"
- styles: actual_button_label_status
- ######################################################################### Livingroom page ##########
- - id: livingroom_page
- widgets:
- - image:
- x: 0
- y: 0
- width: 480
- height: 480
- src: livingroom
- - label:
- text: "Nappali"
- styles: title
- - button:
- x: 150
- y: 83
- styles: status_row_button
- widgets:
- - label:
- id: temp_livingroom
- text: "23°C"
- text_color: 0xFFFFFF
- text_font: amiko24
- align: CENTER
- - label:
- x: 148
- y: 178
- width: 102
- height: 20
- text: "Hőmérséklet"
- text_color: 0xFFFFFF
- text_font: amiko16
- - button:
- id: presence_livingroom
- x: 260
- y: 83
- styles: status_row_button
- widgets:
- - label:
- id: presence_livingroom_label
- text: "\U000F1435"
- styles: status_row_label
- - label:
- x: 280
- y: 178
- width: 78
- height: 20
- text: "Mozgás"
- text_color: 0xFFFFFF
- text_font: amiko16
- - button:
- id: window_livingroom_button
- x: 370
- y: 83
- styles: status_row_button
- widgets:
- - label:
- id: window_livingroom_label
- text: "\U000F11DB"
- styles: status_row_label
- - label:
- x: 395
- y: 178
- width: 83
- height: 20
- text: "Ablak"
- text_color: 0xFFFFFF
- text_font: amiko16
- - button:
- id: ceiling_lamp_livingroom_button
- x: 250
- y: 220
- styles: actual_button
- on_click:
- - homeassistant.action:
- action: light.toggle
- data:
- entity_id: light.fali_kapcsolo_nappali_left
- widgets:
- - label:
- id: ceiling_lamp_livingroom_label_icon
- x: -10
- y: -10
- text: "\U000F0769"
- styles: actual_button_label_icon
- - label:
- id: ceiling_lamp_livingroom_label_name
- x: -5
- y: 50
- text: "Mennyezeti lámpa"
- long_mode: SCROLL_CIRCULAR
- styles: actual_button_label_name
- - label:
- id: ceiling_lamp_livingroom_label_status
- x: 10
- y: 70
- text: "KI"
- styles: actual_button_label_status
- - button:
- id: ambient_livingroom_button
- x: 250
- y: 340
- styles: actual_button
- on_click:
- - homeassistant.action:
- action: light.toggle
- data:
- entity_id: light.nappali_ambient
- widgets:
- - label:
- id: ambient_livingroom_label_icon
- x: -10
- y: -10
- text: "\U000F1051"
- styles: actual_button_label_icon
- - label:
- id: ambient_livingroom_label_name
- x: -5
- y: 50
- text: "Ambient"
- styles: actual_button_label_name
- - label:
- id: ambient_livingroom_label_status
- x: 10
- y: 70
- text: "KI"
- styles: actual_button_label_status
- ############################################################################## House page ##########
- - id: house_page
- widgets:
- - image:
- x: 0
- y: 0
- width: 480
- height: 480
- src: house
- - label:
- text: "Zita & Imilak"
- styles: title
- - button:
- id: presence_entrance_button
- x: 150
- y: 83
- styles: status_row_button
- widgets:
- - label:
- id: presence_entrance_label
- text: "\U000F1435"
- styles: status_row_label
- - label:
- x: 148
- y: 178
- width: 98
- height: 20
- text: "Mozgás"
- text_color: 0xFFFFFF
- text_font: amiko16
- text_align: CENTER
- - button:
- id: alarm_button
- x: 260
- y: 83
- styles: status_row_button
- on_press:
- - lvgl.page.show:
- id: alarm_page
- - lambda: |-
- id(active_page) = 5;
- - logger.log: "Active page: 5"
- widgets:
- - label:
- id: alarm_label
- text: "\U000F11A3"
- styles: status_row_label
- - label:
- x: 260
- y: 178
- width: 98
- height: 20
- text: "Riasztó"
- text_color: 0xFFFFFF
- text_font: amiko16
- text_align: CENTER
- - button:
- id: door_entrance_button
- x: 370
- y: 83
- styles: status_row_button
- widgets:
- - label:
- id: door_entrance_label
- text: "\U000F081B"
- styles: status_row_label
- - label:
- x: 370
- y: 178
- width: 98
- height: 20
- text: "Ajtó"
- text_color: 0xFFFFFF
- text_font: amiko16
- text_align: CENTER
- - label:
- id: info_label_1
- x: 130
- y: 200
- width: 350
- height: SIZE_CONTENT
- text: "Betöltés..."
- text_font: amiko24
- text_color: 0xffffff
- text_align: CENTER
- long_mode: WRAP
- ############################################################################## Clock page ##########
- - id: clock_page
- widgets:
- - obj: # clock container
- width: 480
- height: 480
- align: CENTER
- radius: 0
- pad_all: 0
- border_width: 0
- bg_color: 0x000000
- widgets:
- - meter: # clock face
- height: 350
- width: 350
- align: TOP_RIGHT
- bg_opa: TRANSP
- border_width: 0
- text_color: 0xFFFFFF
- scales:
- - range_from: 0 # minutes scale
- range_to: 60
- angle_range: 360
- rotation: 270
- ticks:
- width: 1
- count: 61
- length: 10
- color: 0xFFFFFF
- indicators:
- - line:
- id: minute_hand
- width: 3
- color: 0xa6a6a6
- r_mod: -4
- value: 0
- - range_from: 1 # hours scale for labels
- range_to: 12
- angle_range: 330
- rotation: 300
- ticks:
- width: 1
- count: 12
- length: 1
- major:
- stride: 1
- width: 4
- length: 10
- color: 0xC0C0C0
- label_gap: 12
- - range_from: 0 # hi-res hours scale for hand
- range_to: 720
- angle_range: 360
- rotation: 270
- ticks:
- count: 0
- indicators:
- - line:
- id: hour_hand
- width: 5
- color: 0xa6a6a6
- r_mod: -30
- value: 0
- - label:
- id: day_label
- text_color: 0xffffff
- text_font: amiko16
- y: 100
- x: 275
- - label:
- id: date_label
- text_color: 0xffffff
- text_font: amiko16
- y: 240
- x: 280
- - label:
- id: info_label_2
- x: 130
- y: 380
- width: 350
- height: 50
- text: "Betöltés..."
- text_font: amiko32
- text_color: 0x808080
- long_mode: SCROLL_CIRCULAR
- ############################################################################## Alarm page ##########
- - id: alarm_page
- widgets:
- - image:
- x: 0
- y: 0
- width: 480
- height: 480
- src: alarm_bg
- - label:
- text: "Riasztó"
- styles: title
- - led:
- id: alarm_page_led
- x: 150
- y: 70
- color: 0xFF0000
- brightness: 70%
- - obj:
- width: 240
- height: 30
- align_to:
- id: alarm_page_led
- align: OUT_RIGHT_MID
- x: 50
- border_width: 1
- border_color: 0
- border_opa: 50%
- pad_all: 0
- bg_opa: 50%
- bg_color: 0xFFFFFF
- shadow_color: 0
- shadow_opa: 50%
- shadow_width: 10
- shadow_spread: 3
- radius: 5
- widgets:
- - label:
- id: alarm_page_label
- align: CENTER
- text: "Kérem a kódot"
- text_align: CENTER
- text_font: amiko20
- - buttonmatrix:
- id: alarm_page_keypad
- x: 130
- y: 130
- width: 350
- height: 350
- opa: 40%
- items:
- pressed:
- bg_color: 0xFFFF00
- opa: 80%
- rows:
- - buttons:
- - text: 1
- control:
- no_repeat: true
- - text: 2
- control:
- no_repeat: true
- - text: 3
- control:
- no_repeat: true
- - buttons:
- - text: 4
- control:
- no_repeat: true
- - text: 5
- control:
- no_repeat: true
- - text: 6
- control:
- no_repeat: true
- - buttons:
- - text: 7
- control:
- no_repeat: true
- - text: 8
- control:
- no_repeat: true
- - text: 9
- control:
- no_repeat: true
- - buttons:
- - text: "\uF55A"
- key_code: "*"
- control:
- no_repeat: true
- - text: 0
- control:
- no_repeat: true
- - text: "\uF00C"
- key_code: "#"
- control:
- no_repeat: true
- ########################################################################## Pop-up windows ##########
- msgboxes:
- - id: alarm_panel_popup
- close_button: true
- title: Riasztó
- opa: 80%
- body:
- text: "Riasztó deaktiválva"
- text_font: amiko16
- buttons:
- - id: msgbox_close
- text: "OK"
- on_click:
- then:
- - lvgl.widget.hide: alarm_panel_popup
- ########################################################################### Key collector ##########
- key_collector:
- - source_id: alarm_page_keypad
- min_length: 4
- max_length: 4
- end_keys: "#"
- end_key_required: true
- back_keys: "*"
- allowed_keys: "0123456789*#"
- timeout: 5s
- on_progress:
- - if:
- condition:
- lambda: return (0 != x.compare(std::string{""}));
- then:
- - lvgl.label.update:
- id: alarm_page_label
- text: !lambda 'return x.c_str();'
- else:
- - lvgl.label.update:
- id: alarm_page_label
- text: "Kérem a kódot"
- text_font: amiko20
- on_result:
- - if:
- condition:
- lambda: return (0 == x.compare(std::string{"7809"}));
- then:
- - lvgl.led.update:
- id: alarm_page_led
- color: 0x00FF00
- - lvgl.label.update:
- id: alarm_page_label
- text: "Kód elfogadva"
- text_font: amiko20
- - delay: 2s
- - lvgl.page.show:
- id: house_page
- - lambda: |-
- (id(active_page) = 4);
- - lvgl.widget.show:
- id: alarm_panel_popup
- else:
- - lvgl.led.update:
- id: alarm_page_led
- color: 0xFF0000
- - lvgl.label.update:
- id: alarm_page_label
- text: "Hibás kód"
- text_font: amiko20
- ################################################################################# Scripts ##########
- script:
- - id: update_weather_icon
- then:
- - if:
- condition:
- or:
- - lambda: 'return id(weather_icon_ha).state == "sunny";'
- - lambda: 'return id(weather_icon_ha).state == "clear";'
- then:
- - lvgl.image.update:
- id: weather_icon
- src: sunny
- - if:
- condition:
- or:
- - lambda: 'return id(weather_icon_ha).state == "clear-night";'
- - lambda: 'return id(weather_icon_ha).state == "night";'
- then:
- - lvgl.image.update:
- id: weather_icon
- src: clearnight
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "partlycloudy";'
- then:
- - lvgl.image.update:
- id: weather_icon
- src: partlycloudy
- - if:
- condition:
- and:
- - lambda: 'return id(weather_icon_ha).state == "partlycloudy";'
- - sun.is_below_horizon:
- then:
- - lvgl.image.update:
- id: weather_icon
- src: partlycloudy
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "cloudy";'
- - sun.is_below_horizon:
- then:
- - lvgl.image.update:
- id: weather_icon
- src: scloud
- - if:
- condition:
- and:
- - lambda: 'return id(weather_icon_ha).state == "cloudy";'
- then:
- - lvgl.image.update:
- id: weather_icon
- src: cloudy
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "rainy";'
- then:
- - lvgl.image.update:
- id: weather_icon
- src: rainy
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "pouring";'
- then:
- - lvgl.image.update:
- id: weather_icon
- src: pouring
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "hail";'
- then:
- - lvgl.image.update:
- id: weather_icon
- src: hail
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "snowy";'
- then:
- - lvgl.image.update:
- id: weather_icon
- src: snowy
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "windy";'
- then:
- - lvgl.image.update:
- id: weather_icon
- src: windy
- - if:
- condition:
- or:
- - lambda: 'return id(weather_icon_ha).state == "lightning";'
- - lambda: 'return id(weather_icon_ha).state == "lightning-rainy";'
- - lambda: 'return id(weather_icon_ha).state == "thender";'
- then:
- - lvgl.image.update:
- id: weather_icon
- src: lightning
- - id: update_weather_text
- then:
- - if:
- condition:
- or:
- - lambda: 'return id(weather_icon_ha).state == "sunny";'
- then:
- - lvgl.label.update:
- id: weather_text
- text: Napos
- - if:
- condition:
- or:
- - lambda: 'return id(weather_icon_ha).state == "clear-night";'
- - lambda: 'return id(weather_icon_ha).state == "night";'
- then:
- - lvgl.label.update:
- id: weather_text
- text: Tiszta éjszaka
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "partlycloudy";'
- then:
- - lvgl.label.update:
- id: weather_text
- text: Részben felhős
- - if:
- condition:
- and:
- - lambda: 'return id(weather_icon_ha).state == "cloudy";'
- then:
- - lvgl.label.update:
- id: weather_text
- text: Felhős
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "rainy";'
- then:
- - lvgl.label.update:
- id: weather_text
- text: Esős
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "pouring";'
- then:
- - lvgl.label.update:
- id: weather_text
- text: Szakadó eső
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "hail";'
- then:
- - lvgl.label.update:
- id: weather_text
- text: Jégeső
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "snowy";'
- then:
- - lvgl.label.update:
- id: weather_text
- text: Havazás
- - if:
- condition:
- - lambda: 'return id(weather_icon_ha).state == "windy";'
- then:
- - lvgl.label.update:
- id: weather_text
- text: Szeles
- - if:
- condition:
- or:
- - lambda: 'return id(weather_icon_ha).state == "lightning";'
- - lambda: 'return id(weather_icon_ha).state == "lightning-rainy";'
- - lambda: 'return id(weather_icon_ha).state == "thender";'
- then:
- - lvgl.label.update:
- id: weather_text
- text: Viharos
- ############################################################################# Time update ##########
- - id: time_update
- then:
- - lvgl.indicator.update:
- id: minute_hand
- value: !lambda |-
- return id(time1).now().minute;
- - lvgl.indicator.update:
- id: hour_hand
- value: !lambda |-
- auto now = id(time1).now();
- return std::fmod(now.hour, 12) * 60 + now.minute;
- - lvgl.label.update:
- id: date_label
- text: !lambda |-
- static const char * const mon_names[] = {"Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Szep", "Okt", "Nov", "Dec"};
- static char date_buf[8];
- auto now = id(time1).now();
- snprintf(date_buf, sizeof(date_buf), "%s %2d", mon_names[now.month-1], now.day_of_month);
- return date_buf;
- - lvgl.label.update:
- id: day_label
- text: !lambda |-
- static const char * const day_names[] = {"Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat"};
- return day_names[id(time1).now().day_of_week - 1];
- ################################################################ Top layer buttons update ##########
- - id: refresh_buttons
- then:
- - if:
- condition:
- lambda: 'return id(active_page) == 1;'
- then:
- - lvgl.label.update:
- id: button_workshop_label
- text_color: 0xff9e00
- else:
- - lvgl.label.update:
- id: button_workshop_label
- text_color: 0xffffff
- - if:
- condition:
- lambda: 'return id(active_page) == 2;'
- then:
- - lvgl.label.update:
- id: button_bedroom_label
- text_color: 0xff9e00
- else:
- - lvgl.label.update:
- id: button_bedroom_label
- text_color: 0xffffff
- - if:
- condition:
- lambda: 'return id(active_page) == 3;'
- then:
- - lvgl.label.update:
- id: button_livingroom_label
- text_color: 0xff9e00
- else:
- - lvgl.label.update:
- id: button_livingroom_label
- text_color: 0xffffff
- - if:
- condition:
- lambda: 'return id(active_page) == 4;'
- then:
- - lvgl.label.update:
- id: button_house_label
- text_color: 0xff9e00
- else:
- - lvgl.label.update:
- id: button_house_label
- text_color: 0xffffff
- - if:
- condition:
- lambda: 'return id(active_page) == 5;'
- then:
- - lvgl.widget.hide:
- id: button_workshop
- - lvgl.widget.hide:
- id: button_bedroom
- - lvgl.widget.hide:
- id: button_livingroom
- - lvgl.widget.hide:
- id: button_house
- - if:
- condition:
- lambda: 'return id(active_page) == 0;'
- then:
- - lvgl.label.update:
- id: button_workshop_label
- text_color: 0x808080
- - lvgl.label.update:
- id: button_bedroom_label
- text_color: 0x808080
- - lvgl.label.update:
- id: button_livingroom_label
- text_color: 0x808080
- - lvgl.label.update:
- id: button_house_label
- text_color: 0x808080
- ############################################################## Workshop status row update ##########
- - id: update_workshop_presence_button
- then:
- - if:
- condition:
- lambda: 'return id(workshop_presence).state == "on";'
- then:
- - lvgl.button.update:
- id: presence_workshop
- styles: status_row_active_button
- - lvgl.label.update:
- id: presence_workshop_label
- text: "\U000F0004"
- styles: status_row_active_label
- else:
- - lvgl.button.update:
- id: presence_workshop
- styles: status_row_button
- - lvgl.label.update:
- id: presence_workshop_label
- text: "\U000F0013"
- styles: status_row_label
- - id: update_workshop_window_button
- then:
- - if:
- condition:
- lambda: 'return id(workshop_window).state == "on";'
- then:
- - lvgl.button.update:
- id: window_workshop_button
- styles: status_row_active_button
- - lvgl.label.update:
- id: window_workshop_label
- text: "\U000F11DC"
- styles: status_row_active_label
- else:
- - lvgl.button.update:
- id: window_workshop_button
- styles: status_row_button
- - lvgl.label.update:
- id: window_workshop_label
- text: "\U000F11DB"
- styles: status_row_label
- ############################################################### Bedroom status row update ##########
- - id: update_bedroom_presence_button
- then:
- - if:
- condition:
- lambda: 'return id(bedroom_presence).state == "on";'
- then:
- - lvgl.button.update:
- id: presence_bedroom
- styles: status_row_active_button
- - lvgl.label.update:
- id: presence_bedroom_label
- text: "\U000F0004"
- styles: status_row_active_label
- else:
- - lvgl.button.update:
- id: presence_bedroom
- styles: status_row_button
- - lvgl.label.update:
- id: presence_bedroom_label
- text: "\U000F0013"
- styles: status_row_label
- - id: update_bedroom_window_button
- then:
- - if:
- condition:
- lambda: 'return id(bedroom_window).state == "on";'
- then:
- - lvgl.button.update:
- id: window_bedroom_button
- styles: status_row_active_button
- - lvgl.label.update:
- id: window_bedroom_label
- text: "\U000F11DC"
- styles: status_row_active_label
- else:
- - lvgl.button.update:
- id: window_bedroom_button
- styles: status_row_button
- - lvgl.label.update:
- id: window_bedroom_label
- text: "\U000F11DB"
- styles: status_row_label
- ############################################################ Livingroom status row update ##########
- - id: update_livingroom_presence_button
- then:
- - if:
- condition:
- lambda: 'return id(livingroom_presence).state == "on";'
- then:
- - lvgl.button.update:
- id: presence_livingroom
- styles: status_row_active_button
- - lvgl.label.update:
- id: presence_livingroom_label
- text: "\U000F0D91"
- styles: status_row_active_label
- else:
- - lvgl.button.update:
- id: presence_livingroom
- styles: status_row_button
- - lvgl.label.update:
- id: presence_livingroom_label
- text: "\U000F1435"
- styles: status_row_label
- - id: update_livingroom_window_button
- then:
- - if:
- condition:
- lambda: 'return id(livingroom_window).state == "on";'
- then:
- - lvgl.button.update:
- id: window_livingroom_button
- styles: status_row_active_button
- - lvgl.label.update:
- id: window_livingroom_label
- text: "\U000F11DC"
- styles: status_row_active_label
- else:
- - lvgl.button.update:
- id: window_livingroom_button
- styles: status_row_button
- - lvgl.label.update:
- id: window_livingroom_label
- text: "\U000F11DB"
- styles: status_row_label
- ############################################################## Entrance status row update ##########
- - id: update_presence_entrance_button
- then:
- - if:
- condition:
- lambda: 'return id(presence_entrance).state == "on";'
- then:
- - lvgl.button.update:
- id: presence_entrance_button
- styles: status_row_active_button
- - lvgl.label.update:
- id: presence_entrance_label
- text: "\U000F0D91"
- styles: status_row_active_label
- else:
- - lvgl.button.update:
- id: presence_entrance_button
- styles: status_row_button
- - lvgl.label.update:
- id: presence_entrance_label
- text: "\U000F1435"
- styles: status_row_label
- - id: update_door_entrance_button
- then:
- - if:
- condition:
- lambda: 'return id(door_entrance).state == "on";'
- then:
- - lvgl.button.update:
- id: door_entrance_button
- styles: status_row_active_button
- - lvgl.label.update:
- id: door_entrance_label
- text: "\U000F081C"
- styles: status_row_active_label
- else:
- - lvgl.button.update:
- id: door_entrance_button
- styles: status_row_button
- - lvgl.label.update:
- id: door_entrance_label
- text: "\U000F081B"
- styles: status_row_label
- ######################################################################### Switch updates ###########
- - id: update_ceiling_lamp_workshop_button
- then:
- - if:
- condition:
- lambda: 'return id(ceiling_lamp_workshop).state == "on";'
- then:
- - lvgl.button.update:
- id: ceiling_lamp_workshop_button
- styles: actual_button_active
- - lvgl.label.update:
- id: ceiling_lamp_workshop_label_icon
- styles: actual_button_label_icon_active
- - lvgl.label.update:
- id: ceiling_lamp_workshop_label_name
- styles: actual_button_label_name_active
- - lvgl.label.update:
- id: ceiling_lamp_workshop_label_status
- styles: actual_button_label_status_active
- text: "BE"
- else:
- - lvgl.button.update:
- id: ceiling_lamp_workshop_button
- styles: actual_button
- - lvgl.label.update:
- id: ceiling_lamp_workshop_label_icon
- styles: actual_button_label_icon
- - lvgl.label.update:
- id: ceiling_lamp_workshop_label_name
- styles: actual_button_label_name
- - lvgl.label.update:
- id: ceiling_lamp_workshop_label_status
- styles: actual_button_label_status
- text: "KI"
- - id: update_standing_lamp_workshop_button
- then:
- - if:
- condition:
- lambda: 'return id(standing_lamp_workshop).state == "on";'
- then:
- - lvgl.button.update:
- id: standing_lamp_workshop_button
- styles: actual_button_active
- - lvgl.label.update:
- id: standing_lamp_workshop_label_icon
- styles: actual_button_label_icon_active
- - lvgl.label.update:
- id: standing_lamp_workshop_label_name
- styles: actual_button_label_name_active
- - lvgl.label.update:
- id: standing_lamp_workshop_label_status
- styles: actual_button_label_status_active
- text: "BE"
- else:
- - lvgl.button.update:
- id: standing_lamp_workshop_button
- styles: actual_button
- - lvgl.label.update:
- id: standing_lamp_workshop_label_icon
- styles: actual_button_label_icon
- - lvgl.label.update:
- id: standing_lamp_workshop_label_name
- styles: actual_button_label_name
- - lvgl.label.update:
- id: standing_lamp_workshop_label_status
- styles: actual_button_label_status
- text: "KI"
- - id: update_desk_lamp_workshop_button
- then:
- - if:
- condition:
- lambda: 'return id(desk_lamp_workshop).state == "on";'
- then:
- - lvgl.button.update:
- id: desk_lamp_button
- styles: actual_button_active
- - lvgl.label.update:
- id: desk_lamp_label_icon
- styles: actual_button_label_icon_active
- - lvgl.label.update:
- id: desk_lamp_label_name
- styles: actual_button_label_name_active
- - lvgl.label.update:
- id: desk_lamp_label_status
- styles: actual_button_label_status_active
- text: "BE"
- else:
- - lvgl.button.update:
- id: desk_lamp_button
- styles: actual_button
- - lvgl.label.update:
- id: desk_lamp_label_icon
- styles: actual_button_label_icon
- - lvgl.label.update:
- id: desk_lamp_label_name
- styles: actual_button_label_name
- - lvgl.label.update:
- id: desk_lamp_label_status
- styles: actual_button_label_status
- text: "KI"
- - id: update_ceiling_lamp_bedroom_button
- then:
- - if:
- condition:
- lambda: 'return id(ceiling_lamp_bedroom).state == "on";'
- then:
- - lvgl.button.update:
- id: ceiling_lamp_bedroom_button
- styles: actual_button_active
- - lvgl.label.update:
- id: ceiling_lamp_bedroom_label_icon
- styles: actual_button_label_icon_active
- - lvgl.label.update:
- id: ceiling_lamp_bedroom_label_name
- styles: actual_button_label_name_active
- - lvgl.label.update:
- id: ceiling_lamp_bedroom_label_status
- styles: actual_button_label_status_active
- text: "BE"
- else:
- - lvgl.button.update:
- id: ceiling_lamp_bedroom_button
- styles: actual_button
- - lvgl.label.update:
- id: ceiling_lamp_bedroom_label_icon
- styles: actual_button_label_icon
- - lvgl.label.update:
- id: ceiling_lamp_bedroom_label_name
- styles: actual_button_label_name
- - lvgl.label.update:
- id: ceiling_lamp_bedroom_label_status
- styles: actual_button_label_status
- text: "KI"
- - id: update_headboard_bedroom_button
- then:
- - if:
- condition:
- lambda: 'return id(headboard_bedroom).state == "on";'
- then:
- - lvgl.button.update:
- id: headboard_bedroom_button
- styles: actual_button_active
- - lvgl.label.update:
- id: headboard_bedroom_label_icon
- styles: actual_button_label_icon_active
- - lvgl.label.update:
- id: headboard_bedroom_label_name
- styles: actual_button_label_name_active
- - lvgl.label.update:
- id: headboard_bedroom_label_status
- styles: actual_button_label_status_active
- text: "BE"
- else:
- - lvgl.button.update:
- id: headboard_bedroom_button
- styles: actual_button
- - lvgl.label.update:
- id: headboard_bedroom_label_icon
- styles: actual_button_label_icon
- - lvgl.label.update:
- id: headboard_bedroom_label_name
- styles: actual_button_label_name
- - lvgl.label.update:
- id: headboard_bedroom_label_status
- styles: actual_button_label_status
- text: "KI"
- - id: update_standing_lamp_bedroom_button
- then:
- - if:
- condition:
- lambda: 'return id(standing_lamp_bedroom).state == "on";'
- then:
- - lvgl.button.update:
- id: standing_lamp_bedroom_button
- styles: actual_button_active
- - lvgl.label.update:
- id: standing_lamp_bedroom_label_icon
- styles: actual_button_label_icon_active
- - lvgl.label.update:
- id: standing_lamp_bedroom_label_name
- styles: actual_button_label_name_active
- - lvgl.label.update:
- id: standing_lamp_bedroom_label_status
- styles: actual_button_label_status_active
- text: "BE"
- else:
- - lvgl.button.update:
- id: standing_lamp_bedroom_button
- styles: actual_button
- - lvgl.label.update:
- id: standing_lamp_bedroom_label_icon
- styles: actual_button_label_icon
- - lvgl.label.update:
- id: standing_lamp_bedroom_label_name
- styles: actual_button_label_name
- - lvgl.label.update:
- id: standing_lamp_bedroom_label_status
- styles: actual_button_label_status
- text: "KI"
- - id: update_ceiling_lamp_livingroom_button
- then:
- - if:
- condition:
- lambda: 'return id(ceiling_lamp_livingroom).state == "on";'
- then:
- - lvgl.button.update:
- id: ceiling_lamp_livingroom_button
- styles: actual_button_active
- - lvgl.label.update:
- id: ceiling_lamp_livingroom_label_icon
- styles: actual_button_label_icon_active
- - lvgl.label.update:
- id: ceiling_lamp_livingroom_label_name
- styles: actual_button_label_name_active
- - lvgl.label.update:
- id: ceiling_lamp_livingroom_label_status
- styles: actual_button_label_status_active
- text: "BE"
- else:
- - lvgl.button.update:
- id: ceiling_lamp_livingroom_button
- styles: actual_button
- - lvgl.label.update:
- id: ceiling_lamp_livingroom_label_icon
- styles: actual_button_label_icon
- - lvgl.label.update:
- id: ceiling_lamp_livingroom_label_name
- styles: actual_button_label_name
- - lvgl.label.update:
- id: ceiling_lamp_livingroom_label_status
- styles: actual_button_label_status
- text: "KI"
- - id: update_ambient_livingroom_button
- then:
- - if:
- condition:
- lambda: 'return id(ambient_livingroom).state == "on";'
- then:
- - lvgl.button.update:
- id: ambient_livingroom_button
- styles: actual_button_active
- - lvgl.label.update:
- id: ambient_livingroom_label_icon
- styles: actual_button_label_icon_active
- - lvgl.label.update:
- id: ambient_livingroom_label_name
- styles: actual_button_label_name_active
- - lvgl.label.update:
- id: ambient_livingroom_label_status
- styles: actual_button_label_status_active
- text: "BE"
- else:
- - lvgl.button.update:
- id: ambient_livingroom_button
- styles: actual_button
- - lvgl.label.update:
- id: ambient_livingroom_label_icon
- styles: actual_button_label_icon
- - lvgl.label.update:
- id: ambient_livingroom_label_name
- styles: actual_button_label_name
- - lvgl.label.update:
- id: ambient_livingroom_label_status
- styles: actual_button_label_status
- text: "KI"
- - id: update_alarm_button
- then:
- - if:
- condition:
- lambda: 'return id(alarm_state).state == "disarmed";'
- then:
- - lvgl.button.update:
- id: alarm_button
- styles: status_row_button
- border_color: green
- - lvgl.label.update:
- id: alarm_label
- text: "\U000F0CC8" # Ikon disarmed
- styles: status_row_label
- text_color: green
- - lvgl.widget.hide:
- id: alarm_panel_popup
- - if:
- condition:
- lambda: 'return id(alarm_state).state == "arming";'
- then:
- - lvgl.button.update:
- id: alarm_button
- styles: status_row_button
- border_color: yellow # Egyedi stílus az arming állapotra
- - lvgl.label.update:
- id: alarm_label
- text: "\U000F11A3" # Ikon arming
- styles: status_row_label
- text_color: yellow
- - if:
- condition:
- lambda: 'return id(alarm_state).state == "armed_away";'
- then:
- - lvgl.button.update:
- id: alarm_button
- styles: status_row_button
- border_color: red
- - lvgl.label.update:
- id: alarm_label
- text: "\U000F0CCB" # Ikon armed_away
- styles: status_row_label
- text_color: red
- - if:
- condition:
- lambda: 'return id(alarm_state).state == "triggered";'
- then:
- - lvgl.button.update:
- id: alarm_button
- styles: status_row_button
- border_color: orange # Egyedi stílus triggered állapotra
- - lvgl.label.update:
- id: alarm_label
- text: "\U000F0ECD" # Ikon triggered
- styles: status_row_label
- text_color: orange
- - lvgl.page.show:
- id: alarm_page
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement