Advertisement
iMike78

ESP32-4848S040C EPShome code

Dec 15th, 2024
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 76.40 KB | Source Code | 0 0
  1. substitutions:
  2.   name: "plate2"
  3.   device_description: Wall display
  4.   allowed_characters: " !#%'()+,-./0123456789:;<>?&@AÁBCDEÉFGHIÍJKLMNOÓÖŐPQRSTUÚÜŰVWYZ[]_aábcdeéfghiíjklmnoóöőpqrstuúüűvwxyz{|}°"
  5.  
  6. globals:
  7.   - id: active_page
  8.     type: int
  9.     restore_value: no
  10.     initial_value: "1"
  11.  
  12. esphome:
  13.   name: "${name}"
  14.   comment: "${device_description}"
  15.   platformio_options:
  16.     build_flags: "-DBOARD_HAS_PSRAM"
  17.     board_build.arduino.memory_type: qio_opi
  18.     board_build.flash_mode: dio
  19.   on_boot:
  20.     - delay: 5s
  21.     - lvgl.widget.hide: boot_screen
  22.  
  23. esp32:
  24.   board: esp32-s3-devkitc-1
  25.   framework:
  26.     type: esp-idf
  27.     sdkconfig_options:
  28.       COMPILER_OPTIMIZATION_SIZE: y
  29.       CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
  30.       CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
  31.       CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"
  32.       CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
  33.       CONFIG_SPIRAM_RODATA: y
  34.  
  35.   flash_size: 16MB
  36.   partitions: "default_16MB.csv"
  37.  
  38. psram:
  39.   mode: octal
  40.   speed: 80MHz
  41.  
  42. logger:
  43.   level: DEBUG
  44.  
  45. api:
  46.   encryption:
  47.     key: !secret api_key
  48.   reboot_timeout: 10 min
  49.  
  50. ota:
  51.   - platform: esphome
  52.     password: !secret wifi_password
  53.  
  54. wifi:
  55.   id: iptime
  56.   ssid: !secret ssid
  57.   password: !secret wifi_pass
  58.   reboot_timeout: 10 min
  59.   manual_ip:
  60.     static_ip: 192.168.1.177
  61.     gateway: 192.168.1.1
  62.     subnet: 255.255.255.0
  63.     dns1: !secret dns1
  64.     dns2: !secret dns2
  65.   power_save_mode: HIGH
  66.   fast_connect: false
  67.  
  68.   ap:
  69.     ssid: "${name} hotspot"
  70.     password: !secret wifi_password
  71.  
  72. captive_portal:
  73. i2c:
  74.   scl: GPIO45
  75.   sda: GPIO19
  76.   scan: True
  77.  
  78. spi:
  79.   clk_pin: GPIO48
  80.   mosi_pin: GPIO47
  81.  
  82. interval:
  83.   - interval: 60s
  84.     then:
  85.       - lvgl.label.update:
  86.           id: info_label_1
  87.           text: !lambda 'return id(info_panel).state.c_str();'
  88.       - lvgl.label.update:
  89.           id: info_label_2
  90.           text: !lambda 'return id(info_panel).state.c_str();'
  91.  
  92. light:
  93.   - platform: monochromatic
  94.     output: backlight_pwm
  95.     id: backlight
  96.     name: "${name} háttérvilágítás"
  97.     restore_mode: RESTORE_AND_ON
  98.  
  99.   - platform: binary
  100.     output: internal_relay
  101.     name: "${name} Light Switch"
  102.     id: light_switch_1
  103.     restore_mode: RESTORE_DEFAULT_OFF
  104.  
  105. output:
  106.   - platform: ledc
  107.     id: backlight_pwm
  108.     pin: GPIO38
  109.     frequency: 1000Hz
  110.     min_power: 0.3
  111.     zero_means_zero: True  
  112.  
  113.   - platform: gpio
  114.     id: internal_relay
  115.     pin: 40
  116.  
  117. display:
  118.   - platform: st7701s
  119.     id: my_display
  120.     update_interval: 1s
  121.     auto_clear_enabled: false
  122.     data_rate: 2MHz
  123.     spi_mode: MODE3
  124.     color_order: RGB
  125.     invert_colors: false
  126.     dimensions:
  127.       width: 480
  128.       height: 480
  129.     cs_pin: 39
  130.     de_pin: 18
  131.     hsync_pin: 16
  132.     vsync_pin: 17
  133.     pclk_pin: 21
  134.     pclk_frequency: 12MHz
  135.     pclk_inverted: false
  136.     hsync_pulse_width: 8
  137.     hsync_front_porch: 10
  138.     hsync_back_porch: 20
  139.     vsync_pulse_width: 8
  140.     vsync_front_porch: 10
  141.     vsync_back_porch: 10
  142.     init_sequence:
  143.      - 1
  144.       - [0xFF, 0x77, 0x01, 0x00, 0x00, 0x10]
  145.       - [0xCD, 0x00]
  146.     data_pins:
  147.       red:
  148.        - 11         # R1
  149.         - 12         # R2
  150.         - 13         # R3
  151.         - 14         # R4
  152.         - 0          # R5
  153.       green:
  154.        - 8          # G0
  155.         - 20         # G1
  156.         - 3          # G2
  157.         - 46         # G3
  158.         - 9          # G4
  159.         - 10         # G5
  160.       blue:
  161.        - 4          # B1
  162.         - 5          # B2
  163.         - 6          # B3
  164.         - 7          # B4
  165.         - 15         # B5
  166.  
  167. touchscreen:
  168.   platform: gt911
  169.   transform:
  170.     mirror_x: false
  171.     mirror_y: false
  172.   id: my_touchscreen
  173.   display: my_display
  174.   on_touch:
  175.     - lambda: |-
  176.           ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
  177.               touch.x,
  178.               touch.y,
  179.               touch.x_raw,
  180.               touch.y_raw
  181.               );
  182.     - if:
  183.         condition:
  184.           - light.is_off: backlight
  185.         then:
  186.           - lvgl.resume:
  187.           - lvgl.widget.redraw:
  188.           - light.turn_on:
  189.               id: backlight
  190.               brightness: 100%
  191.           - lvgl.page.show: workshop_page
  192.  
  193. time:
  194.   platform: sntp
  195.   timezone: !secret timezone
  196.   id: time1
  197.   servers: !secret servers
  198.   on_time_sync:
  199.     - script.execute: time_update
  200.     - logger.log: "Time updated"
  201.   on_time:
  202.     - minutes: '*'
  203.       seconds: 0
  204.       then:
  205.         - script.execute: time_update
  206.         - lvgl.label.update:
  207.             id: time_now
  208.             text: !lambda |-
  209.               return id(time1).now().strftime("%H:%M");
  210. sun:
  211.   latitude: !secret lat
  212.   longitude: !secret long
  213.  
  214. ###################################################################################    Fonts    ##########
  215.  
  216. font:
  217.   - file: "/root/config/fonts/Amiko.ttf"
  218.     id: amiko16
  219.     size: 16
  220.     bpp: 4
  221.     glyphs: ${allowed_characters}
  222.   - file: "/root/config/fonts/Amiko.ttf"
  223.     id: amiko20
  224.     size: 20
  225.     bpp: 4
  226.     glyphs: ${allowed_characters}
  227.   - file: "/root/config/fonts/Amiko.ttf"
  228.     id: amiko24
  229.     size: 24
  230.     bpp: 4
  231.     glyphs: ${allowed_characters}
  232.   - file: "/root/config/fonts/Amiko.ttf"
  233.     id: amiko32
  234.     size: 32
  235.     bpp: 4
  236.     glyphs: ${allowed_characters}
  237.   - file: "/root/config/fonts/Amiko.ttf"
  238.     id: amiko40
  239.     size: 40
  240.     bpp: 4
  241.     glyphs: ${allowed_characters}
  242.   - file: "/root/config/fonts/Amiko.ttf"
  243.     id: amiko48
  244.     size: 48
  245.     bpp: 4
  246.     glyphs: ${allowed_characters}
  247.     extras:
  248.   - file: "fonts/mdi.ttf"
  249.     id: mdi48
  250.     size: 48
  251.     bpp: 4
  252.     glyphs: [
  253.       "\U000F11DC", # window-open-variant
  254.       "\U000F11DB", # window-closed-variant
  255.       "\U000F1092", # soldering-iron
  256.       "\U000F095F", # desk-lamp
  257.       "\U000F1051", # led-strip-variant
  258.       "\U000F02E3", # bed
  259.       "\U000F04B9", # sofa
  260.       "\U000F02DC", # home
  261.       "\U000F0013", # account-outline
  262.       "\U000F0004", # account
  263.       "\U000F1435", # motion-sensor-off
  264.       "\U000F0D91", # motion-sensor
  265.       "\U000F0769", # ceiling-lamp
  266.       "\U000F08DD", # floor-lamp
  267.       "\U000F081B", # door-closed
  268.       "\U000F081C", # door-open
  269.       "\U000F0060", # arrow-up-bold-circle-outline
  270.       "\U000F0048", # arrow-down-bold-circle-outline
  271.       "\U000F04DB", # stop
  272.       "\U000F0CCB", # shield-home-outline
  273.       "\U000F11A3", # shield-sync-outline
  274.       "\U000F0ECD", # shield-alert-outline
  275.       "\U000F0CC8" # shiel-check-outline
  276.       ]
  277.  
  278. ##################################################################################    Images    ##########
  279.  
  280. image:
  281.   - file: "icons/sunny.png"
  282.     id: sunny
  283.     type: RGB565
  284.     use_transparency: true
  285.   - file: "icons/cloudy_sunny.png"
  286.     id: cloudysunny
  287.     type: RGB565
  288.     use_transparency: true
  289.   - file: "icons/cloudy.png"
  290.     id: cloudy
  291.     type: RGB565
  292.     use_transparency: true    
  293.   - file: "icons/lightning.png"
  294.     id: lightning
  295.     type: RGB565
  296.     use_transparency: true
  297.   - file: "icons/partlycloudy.png"
  298.     id: partlycloudy
  299.     type: RGB565
  300.     use_transparency: true
  301.   - file: "icons/rainy.png"
  302.     id: rainy
  303.     type: RGB565
  304.     use_transparency: true
  305.   - file: "icons/snowy.png"
  306.     id: snowy
  307.     type: RGB565
  308.     use_transparency: true
  309.   - file: "icons/windy.png"
  310.     id: windy
  311.     type: RGB565
  312.     use_transparency: true                      
  313.   - file: "icons/hail.png"
  314.     id: hail
  315.     type: RGB565
  316.     use_transparency: true                      
  317.   - file: "icons/pouring.png"
  318.     id: pouring
  319.     type: RGB565
  320.     use_transparency: true                      
  321.   - file: "icons/clearnight.png"
  322.     id: clearnight
  323.     type: RGB565
  324.     use_transparency: true                      
  325.   - file: "icons/snight.png"
  326.     id: scloud
  327.     type: RGB565
  328.     use_transparency: true                      
  329.   - file: "/root/config/backgrounds/hk-Bedroom_2.png"
  330.     id: bedroom
  331.     type: RGB565
  332.     use_transparency: true                      
  333.   - file: "/root/config/backgrounds/hk-Office_1.png"
  334.     id: workshop
  335.     type: RGB565
  336.     use_transparency: true                      
  337.   - file: "/root/config/backgrounds/hk-Living_Room.png"
  338.     id: livingroom
  339.     type: RGB565
  340.     use_transparency: true                      
  341.   - file: "/root/config/backgrounds/hk-House.png"
  342.     id: house
  343.     type: RGB565
  344.     use_transparency: true                      
  345.   - file: "/root/config/backgrounds/hk-Alarm.png"
  346.     id: alarm_bg
  347.     type: RGB565
  348.     use_transparency: true                      
  349.   - file: https://esphome.io/_static/favicon-512x512.png
  350.     id: boot_logo
  351.     resize: 200x200
  352.     type: RGB565
  353.     use_transparency: true
  354.  
  355. #################################################################################    Sensors    ##########
  356.  
  357. sensor:
  358.   - platform: homeassistant
  359.     entity_id: sensor.homerseklet_kulso
  360.     name: Külső hőmérséklet
  361.     id: temp_outside_ha
  362.     accuracy_decimals: 1
  363.     on_value:
  364.       - lvgl.label.update:
  365.           id: temp_outside
  366.           text:
  367.             format: "%.1f°C"
  368.             args: [ 'x' ]
  369.   - platform: homeassistant
  370.     entity_id: sensor.homerseklet_dolgozo
  371.     name: Dolgozó hőmérséklet
  372.     id: temp_workshop_ha
  373.     accuracy_decimals: 0
  374.     on_value:
  375.       - lvgl.label.update:
  376.           id: temp_workshop
  377.           text:
  378.             format: "%.0f°C"
  379.             args: [ 'x' ]
  380.   - platform: homeassistant
  381.     entity_id: sensor.homerseklet_haloszoba
  382.     name: Hálószoba hőmérséklet
  383.     id: temp_bedroom_ha
  384.     accuracy_decimals: 0
  385.     on_value:
  386.       - lvgl.label.update:
  387.           id: temp_bedroom
  388.           text:
  389.             format: "%.0f°C"
  390.             args: [ 'x' ]
  391.   - platform: homeassistant
  392.     entity_id: sensor.homero_nappali_temperature
  393.     name: Nappali hőmérséklet
  394.     id: temp_livingroom_ha
  395.     accuracy_decimals: 0
  396.     on_value:
  397.       - lvgl.label.update:
  398.           id: temp_livingroom
  399.           text:
  400.             format: "%.0f°C"
  401.             args: [ 'x' ]
  402.  
  403. ############################################################################    Text sensors    ##########
  404.  
  405. text_sensor:
  406.   - platform: homeassistant
  407.     entity_id: weather.otthon_2
  408.     name: Időjárás ikon
  409.     id: weather_icon_ha
  410.     on_value:
  411.       - script.execute: update_weather_icon
  412.       - script.execute: update_weather_text
  413.  
  414.   - platform: homeassistant
  415.     entity_id: sensor.info_panel
  416.     id: info_panel
  417. ################################################################################    Workshop    ##########
  418.   - platform: homeassistant
  419.     entity_id: binary_sensor.workshop_presence
  420.     id: workshop_presence
  421.     on_value:
  422.       - script.execute: update_workshop_presence_button
  423.  
  424.   - platform: homeassistant
  425.     entity_id: binary_sensor.nyitaserzekelo_dolgozo_ablak_contact
  426.     id: workshop_window
  427.     on_value:
  428.       - script.execute: update_workshop_window_button
  429.  
  430.   - platform: homeassistant
  431.     entity_id: light.mennyezeti_lampa_dolgozo
  432.     id: ceiling_lamp_workshop
  433.     on_value:
  434.       - script.execute: update_ceiling_lamp_workshop_button
  435.  
  436.   - platform: homeassistant
  437.     entity_id: light.allolampa_dolgozo
  438.     id: standing_lamp_workshop
  439.     on_value:
  440.       - script.execute: update_standing_lamp_workshop_button
  441.  
  442.   - platform: homeassistant
  443.     entity_id: light.iroasztal_vilagitas
  444.     id: desk_lamp_workshop
  445.     on_value:
  446.       - script.execute: update_desk_lamp_workshop_button
  447. #################################################################################    Bedroom    ##########
  448.   - platform: homeassistant
  449.     entity_id: binary_sensor.haloszoba_jelenleterzekelo_any_presence
  450.     id: bedroom_presence
  451.     on_value:
  452.       - script.execute: update_bedroom_presence_button
  453.  
  454.   - platform: homeassistant
  455.     entity_id: binary_sensor.nyitaserzekelo_haloszoba_ablak_contact
  456.     id: bedroom_window
  457.     on_value:
  458.       - script.execute: update_bedroom_window_button
  459.  
  460.   - platform: homeassistant
  461.     entity_id: switch.fali_kapcsolo_haloszoba_l1
  462.     id: ceiling_lamp_bedroom
  463.     on_value:
  464.       - script.execute: update_ceiling_lamp_bedroom_button
  465.  
  466.   - platform: homeassistant
  467.     entity_id: light.allolampa_haloszoba
  468.     id: standing_lamp_bedroom
  469.     on_value:
  470.       - script.execute: update_standing_lamp_bedroom_button
  471.  
  472.   - platform: homeassistant
  473.     entity_id: light.headboard
  474.     id: headboard_bedroom
  475.     on_value:
  476.       - script.execute: update_headboard_bedroom_button
  477. ##############################################################################    Livingroom    ##########
  478.   - platform: homeassistant
  479.     entity_id: binary_sensor.mozgaserzekelo_nappali_occupancy
  480.     id: livingroom_presence
  481.     on_value:
  482.       - script.execute: update_livingroom_presence_button
  483.  
  484.   - platform: homeassistant
  485.     entity_id: binary_sensor.nyitaserzekelo_nappali_ablak_jobb_contact
  486.     id: livingroom_window
  487.     on_value:
  488.       - script.execute: update_livingroom_window_button
  489.  
  490.   - platform: homeassistant
  491.     entity_id: light.fali_kapcsolo_nappali_left
  492.     id: ceiling_lamp_livingroom
  493.     on_value:
  494.       - script.execute: update_ceiling_lamp_livingroom_button
  495.  
  496.   - platform: homeassistant
  497.     entity_id: light.nappali_ambient
  498.     id: ambient_livingroom
  499.     on_value:
  500.       - script.execute: update_ambient_livingroom_button
  501. ################################################################################    Entrance    ##########
  502.   - platform: homeassistant
  503.     entity_id: binary_sensor.nyitaserzekelo_bejarati_ajto_contact
  504.     id: door_entrance
  505.     on_value:
  506.       - script.execute: update_door_entrance_button
  507.  
  508.   - platform: homeassistant
  509.     entity_id: alarm_control_panel.alarmo
  510.     id: alarm_state
  511.     on_value:
  512.       - script.execute: update_alarm_button
  513.  
  514.   - platform: homeassistant
  515.     entity_id: binary_sensor.mozgaserzekelo_eloszoba_foldszint_occupancy
  516.     id: presence_entrance
  517.     on_value:
  518.       - script.execute: update_presence_entrance_button
  519.  
  520. ####################################################################################    LVGL    ##########
  521.  
  522. lvgl:
  523.   displays:
  524.     - my_display
  525.   touchscreens:
  526.    - my_touchscreen
  527. #  log_level: INFO
  528.   on_idle:
  529.     - timeout: 120s
  530.       then:
  531.         if:
  532.           condition:
  533.             - light.is_on: backlight
  534.           then:
  535.             - lvgl.page.show: clock_page
  536.             - light.turn_on:
  537.                 id: backlight
  538.                 brightness: 1%
  539.             - lambda: |-
  540.                 id(active_page) = 0;
  541.             - logger.log: "Active page: 0"
  542.             - script.execute: refresh_buttons
  543. #    - timeout: 5min
  544. #      then:
  545. #        if:
  546. #          condition:
  547. #            - light.is_on: backlight
  548. #          then:
  549. #            - light.turn_off: backlight
  550. #            - lvgl.pause:
  551. #            - logger.log: "Inactive mode"
  552.  
  553. ##################################################################################    Styles    ##########
  554.  
  555.   style_definitions:
  556.     - id: top_layer_buttons
  557.       width: 130
  558.       height: 50
  559.       bg_opa: TRANSP
  560.       border_opa: TRANSP
  561.       shadow_opa: TRANSP
  562.     - id: top_layer_icons
  563.       text_color: 0xff9e00
  564.       text_font: mdi48
  565.       bg_opa: TRANSP
  566.       border_opa: TRANSP
  567.       align: CENTER
  568.     - id: title
  569.       x: 130
  570.       y: 5
  571.       width: 350
  572.       height: 50
  573.       bg_opa: TRANSP
  574.       border_opa: TRANSP
  575.       shadow_opa: TRANSP
  576.       text_color: 0xFFFFFF
  577.       text_font: amiko48
  578.       text_align: CENTER
  579.     - id: status_row_button
  580.       width: 98
  581.       height: 98
  582.       radius: 35
  583.       bg_opa: TRANSP
  584.       border_width: 1
  585.       border_opa: COVER
  586.       border_color: 0xfffff
  587.       shadow_opa: TRANSP
  588.     - id: status_row_active_button
  589.       width: 98
  590.       height: 98
  591.       radius: 35
  592.       bg_opa: 90%
  593.       bg_color: 0xffffff
  594.       border_width: 1
  595.       border_opa: COVER
  596.       border_color: 0xfffff
  597.       shadow_opa: TRANSP
  598.     - id: status_row_label
  599.       text_color: 0xFFFFFF
  600.       text_font: mdi48
  601.       align: CENTER
  602.     - id: status_row_active_label
  603.       text_color: 0xff9e00
  604.       text_font: mdi48
  605.       bg_opa: TRANSP
  606.       align: CENTER
  607.     - id: actual_button
  608.       width: 110
  609.       height: 110
  610.       radius: 10
  611.       shadow_opa: TRANSP
  612.       bg_color: 0x000000
  613.       bg_opa: 50%
  614.     - id: actual_button_active
  615.       width: 110
  616.       height: 110
  617.       radius: 10
  618.       shadow_opa: TRANSP
  619.       bg_color: 0xffffff
  620.       bg_opa: 90%
  621.     - id: actual_button_label_icon
  622.       width: 50
  623.       height: 50
  624.       text_color: 0xffffff
  625.       text_font: mdi48
  626.       opa: 50%
  627.     - id: actual_button_label_icon_active
  628.       width: 50
  629.       height: 50
  630.       text_color: 0xff9e00
  631.       text_font: mdi48
  632.       opa: 90%
  633.     - id: actual_button_label_name
  634.       width: 105
  635.       height: 20
  636.       text_color: 0xffffff
  637.       text_font: amiko16
  638.       opa: 50%
  639.     - id: actual_button_label_name_active
  640.       width: 105
  641.       height: 20
  642.       text_color: 0x000000
  643.       text_font: amiko16
  644.       opa: 90%
  645.     - id: actual_button_label_status
  646.       width: 100
  647.       height: 30
  648.       text_color: 0xffffff
  649.       text_font: amiko24
  650.       opa: 50%
  651.     - id: actual_button_label_status_active
  652.       width: 100
  653.       height: 30
  654.       text_color: 0x000000
  655.       text_font: amiko24
  656.       opa: 90%
  657.     - id: blind_obj
  658.       width: 110
  659.       height: 225
  660.       radius: 10
  661.       shadow_opa: TRANSP
  662.       bg_color: 0xffffff
  663.       bg_opa: 80%
  664.       pad_all: 0
  665.       scrollbar_mode: "OFF"
  666.     - id: blind_control_button
  667.       width: 100
  668.       height: 50
  669.       bg_opa: TRANSP
  670.       border_opa: TRANSP
  671.       shadow_opa: TRANSP
  672.     - id: blind_control_button_label
  673.       text_color: 0x000000
  674.       text_font: mdi48
  675.       align: CENTER
  676.       opa: 90%
  677.       bg_opa: TRANSP
  678.  
  679. ###############################################################################    Top layer    ##########
  680.  
  681.   top_layer:
  682.     widgets:
  683.       - button:
  684.           x: 0
  685.           y: 0
  686.           styles: top_layer_buttons
  687.           widgets:
  688.             - label:
  689.                 id: time_now
  690.                 text: --:--
  691.                 text_color: 0xFFFFFF
  692.                 text_font: amiko40
  693.       - button:
  694.           x: 0
  695.           y: 50
  696.           width: 130
  697.           height: 130
  698.           bg_opa: TRANSP
  699.           shadow_opa: TRANSP
  700.           widgets:
  701.             - image:
  702.                 id: weather_icon
  703.                 src: partlycloudy
  704.                 align: CENTER
  705.       - button:
  706.           x: 0
  707.           y: 160
  708.           styles: top_layer_buttons
  709.           widgets:
  710.             - label:
  711.                 id: weather_text
  712.                 text: "Nem elérhető"
  713.                 text_color: 0xFFFFFF
  714.                 text_font: amiko16
  715.                 align: CENTER
  716.       - button:
  717.           x: 0
  718.           y: 210
  719.           styles: top_layer_buttons
  720.           widgets:
  721.             - label:
  722.                 id: temp_outside
  723.                 text: "--.-°C"
  724.                 text_color: 0xFFFFFF
  725.                 text_font: amiko32
  726.                 text_align: CENTER
  727.       - button:
  728.           id: button_workshop
  729.           x: 0
  730.           y: 280
  731.           styles: top_layer_buttons
  732.           on_press:
  733.             then:
  734.               - lvgl.page.show: workshop_page
  735.               - lambda: |-
  736.                   id(active_page) = 1;
  737.               - logger.log: "Active page: 1"
  738.               - script.execute: refresh_buttons
  739.           widgets:
  740.             - label:
  741.                 id: button_workshop_label
  742.                 text: "\U000F095F"
  743.                 styles: top_layer_icons
  744.                 text_color: 0xff9e00
  745.       - button:
  746.           id: button_bedroom
  747.           x: 0
  748.           y: 330
  749.           styles: top_layer_buttons
  750.           on_press:
  751.             then:
  752.               - lvgl.page.show: bedroom_page
  753.               - lambda: |-
  754.                   id(active_page) = 2;
  755.               - logger.log: "Active page: 2"
  756.               - script.execute: refresh_buttons
  757.           widgets:
  758.             - label:
  759.                 id: button_bedroom_label
  760.                 text: "\U000F02E3"
  761.                 styles: top_layer_icons
  762.                 text_color: 0xffffff
  763.       - button:
  764.           id: button_livingroom
  765.           x: 0
  766.           y: 380
  767.           styles: top_layer_buttons
  768.           on_press:
  769.             then:
  770.               - lvgl.page.show: livingroom_page
  771.               - lambda: |-
  772.                   id(active_page) = 3;
  773.               - logger.log: "Active page: 3"
  774.               - script.execute: refresh_buttons
  775.           widgets:
  776.             - label:
  777.                 id: button_livingroom_label
  778.                 text: "\U000F04B9"
  779.                 styles: top_layer_icons
  780.                 text_color: 0xffffff
  781.       - button:
  782.           id: button_house
  783.           x: 0
  784.           y: 430
  785.           styles: top_layer_buttons
  786.           on_press:
  787.             then:
  788.               - lvgl.page.show: house_page
  789.               - lambda: |-
  790.                   id(active_page) = 4;
  791.               - logger.log: "Active page: 4"
  792.               - script.execute: refresh_buttons
  793.           widgets:
  794.             - label:
  795.                 id: button_house_label
  796.                 text: "\U000F02DC"
  797.                 styles: top_layer_icons
  798.                 text_color: 0xffffff
  799. # make sure it's the last one in this list:
  800.       - obj:
  801.           id: boot_screen
  802.           x: 0
  803.           y: 0
  804.           width: 100%
  805.           height: 100%
  806.           bg_color: 0xffffff
  807.           bg_opa: COVER
  808.           radius: 0
  809.           pad_all: 0
  810.           border_width: 0
  811.           widgets:
  812.             - image:
  813.                 align: CENTER
  814.                 src: boot_logo
  815.                 y: -40
  816.             - spinner:
  817.                 align: CENTER
  818.                 y: 95
  819.                 height: 50
  820.                 width: 50
  821.                 spin_time: 1s
  822.                 arc_length: 60deg
  823.                 arc_width: 8
  824.                 indicator:
  825.                   arc_color: 0x18bcf2
  826.                   arc_width: 8
  827.           on_press:
  828.             - lvgl.widget.hide: boot_screen
  829.  
  830.   pages:
  831. ###########################################################################    Workshop page    ##########
  832.  
  833.     - id: workshop_page
  834.       widgets:
  835.         - image:
  836.             x: 0
  837.             y: 0
  838.             width: 480
  839.             height: 480
  840.             src: workshop
  841.         - label:
  842.             text: "Dolgozó"
  843.             styles: title
  844.  
  845.         - button:
  846.             x: 150
  847.             y: 83
  848.             styles: status_row_button
  849.             widgets:
  850.               - label:
  851.                   id: temp_workshop
  852.                   text: "23°C"
  853.                   text_color: 0xFFFFFF
  854.                   text_font: amiko24
  855.                   align: CENTER
  856.         - label:
  857.             x: 148
  858.             y: 178
  859.             width: 102
  860.             height: 20
  861.             text: "Hőmérséklet"
  862.             text_color: 0xFFFFFF
  863.             text_font: amiko16
  864.             text_align: CENTER
  865.  
  866.         - button:
  867.             id: presence_workshop
  868.             x: 260
  869.             y: 83
  870.             styles: status_row_button
  871.             widgets:
  872.               - label:
  873.                   id: presence_workshop_label
  874.                   text: "\U000F0013"
  875.                   styles: status_row_label
  876.         - label:
  877.             x: 260
  878.             y: 178
  879.             width: 98
  880.             height: 20
  881.             text: "Jelenlét"
  882.             text_color: 0xFFFFFF
  883.             text_font: amiko16
  884.             text_align: CENTER
  885.  
  886.         - button:
  887.             id: window_workshop_button
  888.             x: 370
  889.             y: 83
  890.             styles: status_row_button
  891.             widgets:
  892.               - label:
  893.                   id: window_workshop_label
  894.                   text: "\U000F11DB"
  895.                   styles: status_row_label
  896.         - label:
  897.             x: 370
  898.             y: 178
  899.             width: 98
  900.             height: 20
  901.             text: "Ablak"
  902.             text_color: 0xFFFFFF
  903.             text_font: amiko16
  904.             text_align: CENTER
  905.  
  906.         - button:
  907.             id: ceiling_lamp_workshop_button
  908.             x: 135
  909.             y: 220
  910.             styles: actual_button
  911.             checkable: true
  912.             checked:
  913.               styles: actual_button_active
  914.             on_click:
  915.               - light.toggle: light_switch_1
  916.             widgets:
  917.               - label:
  918.                   id: ceiling_lamp_workshop_label_icon
  919.                   x: -10
  920.                   y: -10
  921.                   text: "\U000F0769"
  922.                   styles: actual_button_label_icon
  923.               - label:
  924.                   id: ceiling_lamp_workshop_label_name
  925.                   x: -5
  926.                   y: 50
  927.                   text: "Mennyezeti lámpa"
  928.                   long_mode: SCROLL_CIRCULAR
  929.                   styles: actual_button_label_name
  930.               - label:
  931.                   id: ceiling_lamp_workshop_label_status
  932.                   x: 10
  933.                   y: 70
  934.                   text: "KI"
  935.                   styles: actual_button_label_status
  936.  
  937.         - button:
  938.             id: standing_lamp_workshop_button
  939.             x: 250
  940.             y: 220
  941.             styles: actual_button
  942.             on_click:
  943.               - homeassistant.action:
  944.                   action: light.toggle
  945.                   data:
  946.                     entity_id: light.allolampa_dolgozo
  947.             widgets:
  948.               - label:
  949.                   id: standing_lamp_workshop_label_icon
  950.                   x: -10
  951.                   y: -10
  952.                   text: "\U000F08DD"
  953.                   styles: actual_button_label_icon
  954.               - label:
  955.                   id: standing_lamp_workshop_label_name
  956.                   x: -5
  957.                   y: 50
  958.                   text: "Állólámpa"
  959.                   styles: actual_button_label_name
  960.               - label:
  961.                   id: standing_lamp_workshop_label_status
  962.                   x: 10
  963.                   y: 70
  964.                   text: "KI"
  965.                   styles: actual_button_label_status
  966.  
  967.         - button:
  968.             id: desk_lamp_button
  969.             x: 135
  970.             y: 350
  971.             styles: actual_button
  972.             on_click:
  973.               - homeassistant.action:
  974.                   action: light.toggle
  975.                   data:
  976.                     entity_id: light.iroasztal_vilagitas
  977.             widgets:
  978.               - label:
  979.                   id: desk_lamp_label_icon
  980.                   x: -10
  981.                   y: -10
  982.                   text: "\U000F095F"
  983.                   styles: actual_button_label_icon
  984.               - label:
  985.                   id: desk_lamp_label_name
  986.                   x: -5
  987.                   y: 50
  988.                   text: "Íróasztal"
  989.                   styles: actual_button_label_name
  990.               - label:
  991.                   id: desk_lamp_label_status
  992.                   x: 10
  993.                   y: 70
  994.                   text: "KI"
  995.                   styles: actual_button_label_status
  996.  
  997. ############################################################################    Bedroom page    ##########
  998.  
  999.     - id: bedroom_page
  1000.       widgets:
  1001.         - image:
  1002.             x: 0
  1003.             y: 0
  1004.             width: 480
  1005.             height: 480
  1006.             src: bedroom
  1007.         - label:
  1008.             text: "Hálószoba"
  1009.             styles: title
  1010.  
  1011.         - button:
  1012.             x: 150
  1013.             y: 83
  1014.             styles: status_row_button
  1015.             widgets:
  1016.               - label:
  1017.                   id: temp_bedroom
  1018.                   text: "23°C"
  1019.                   text_color: 0xFFFFFF
  1020.                   text_font: amiko24
  1021.                   align: CENTER
  1022.         - label:
  1023.             x: 148
  1024.             y: 178
  1025.             width: 102
  1026.             height: 20
  1027.             text: "Hőmérséklet"
  1028.             text_color: 0xFFFFFF
  1029.             text_font: amiko16
  1030.         - button:
  1031.             id: presence_bedroom
  1032.             x: 260
  1033.             y: 83
  1034.             styles: status_row_button
  1035.             widgets:
  1036.               - label:
  1037.                   id: presence_bedroom_label
  1038.                   text: "\U000F0013"
  1039.                   styles: status_row_label
  1040.         - label:
  1041.             x: 280
  1042.             y: 178
  1043.             width: 78
  1044.             height: 20
  1045.             text: "Jelenlét"
  1046.             text_color: 0xFFFFFF
  1047.             text_font: amiko16
  1048.  
  1049.         - button:
  1050.             id: window_bedroom_button
  1051.             x: 370
  1052.             y: 83
  1053.             styles: status_row_button
  1054.             widgets:
  1055.               - label:
  1056.                   id: window_bedroom_label
  1057.                   text: "\U000F11DB"
  1058.                   styles: status_row_label
  1059.         - label:
  1060.             x: 395
  1061.             y: 178
  1062.             width: 83
  1063.             height: 20
  1064.             text: "Ablak"
  1065.             text_color: 0xFFFFFF
  1066.             text_font: amiko16
  1067.  
  1068.         - button:
  1069.             id: ceiling_lamp_bedroom_button
  1070.             x: 135
  1071.             y: 220
  1072.             styles: actual_button
  1073.             on_click:
  1074.               - homeassistant.action:
  1075.                   action: switch.toggle
  1076.                   data:
  1077.                     entity_id: switch.fali_kapcsolo_haloszoba_l1
  1078.             widgets:
  1079.               - label:
  1080.                   id: ceiling_lamp_bedroom_label_icon
  1081.                   x: -10
  1082.                   y: -10
  1083.                   text: "\U000F0769"
  1084.                   styles: actual_button_label_icon
  1085.               - label:
  1086.                   id: ceiling_lamp_bedroom_label_name
  1087.                   x: -5
  1088.                   y: 50
  1089.                   text: "Mennyezeti lámpa"
  1090.                   long_mode: SCROLL_CIRCULAR
  1091.                   styles: actual_button_label_name
  1092.               - label:
  1093.                   id: ceiling_lamp_bedroom_label_status
  1094.                   x: 10
  1095.                   y: 70
  1096.                   text: "KI"
  1097.                   styles: actual_button_label_status
  1098.  
  1099.         - button:
  1100.             id: standing_lamp_bedroom_button
  1101.             x: 250
  1102.             y: 220
  1103.             styles: actual_button
  1104.             on_click:
  1105.               - homeassistant.action:
  1106.                   action: light.toggle
  1107.                   data:
  1108.                     entity_id: light.allolampa_haloszoba
  1109.             widgets:
  1110.               - label:
  1111.                   id: standing_lamp_bedroom_label_icon
  1112.                   x: -10
  1113.                   y: -10
  1114.                   text: "\U000F08DD"
  1115.                   styles: actual_button_label_icon
  1116.               - label:
  1117.                   id: standing_lamp_bedroom_label_name
  1118.                   x: -5
  1119.                   y: 50
  1120.                   text: "Állólámpa"
  1121.                   styles: actual_button_label_name
  1122.               - label:
  1123.                   id: standing_lamp_bedroom_label_status
  1124.                   x: 10
  1125.                   y: 70
  1126.                   text: "KI"
  1127.                   styles: actual_button_label_status
  1128.  
  1129.         - obj:
  1130.             id: blind_bedroom_button
  1131.             x: 365
  1132.             y: 220
  1133.             styles: blind_obj
  1134.             widgets:
  1135.               - button:
  1136.                   id: blind_up_button
  1137.                   x: 0
  1138.                   y: 0
  1139.                   styles: blind_control_button
  1140.                   on_click:
  1141.                     - homeassistant.action:
  1142.                         action: cover.open
  1143.                         data:
  1144.                           entity_id: cover.haloszoba_sotetito
  1145.                   widgets:
  1146.                     - label:
  1147.                         text: "\U000F0060"
  1148.                         styles: blind_control_button_label
  1149.               - label:
  1150.                   id: blind_label_name
  1151.                   x: 0
  1152.                   y: 60
  1153.                   text: "Sötétítő"
  1154.                   text_align: CENTER
  1155.                   styles: actual_button_label_name_active
  1156.               - button:
  1157.                   id: blind_stop_button
  1158.                   x: 0
  1159.                   y: 85
  1160.                   styles: blind_control_button
  1161.                   on_click:
  1162.                     - homeassistant.action:
  1163.                         action: cover.stop
  1164.                         data:
  1165.                           entity_id: cover.haloszoba_sotetito
  1166.                   widgets:
  1167.                     - label:
  1168.                         text: "\U000F04DB"
  1169.                         styles: blind_control_button_label
  1170.               - label:
  1171.                   id: blind_label_state
  1172.                   x: 0
  1173.                   y: 150
  1174.                   text: "Nyitva"
  1175.                   text_align: CENTER
  1176.                   styles: actual_button_label_name_active
  1177.               - button:
  1178.                   id: blind_down_button
  1179.                   x: 0
  1180.                   y: 155
  1181.                   styles: blind_control_button
  1182.                   on_click:
  1183.                     - homeassistant.action:
  1184.                         action: cover.close
  1185.                         data:
  1186.                           entity_id: cover.haloszoba_sotetito
  1187.                   widgets:
  1188.                     - label:
  1189.                         text: "\U000F0048"
  1190.                         styles: blind_control_button_label
  1191.  
  1192.         - button:
  1193.             id: headboard_bedroom_button
  1194.             x: 135
  1195.             y: 340
  1196.             styles: actual_button
  1197.             on_click:
  1198.               - homeassistant.action:
  1199.                   action: light.toggle
  1200.                   data:
  1201.                     entity_id: light.headboard
  1202.             widgets:
  1203.               - label:
  1204.                   id: headboard_bedroom_label_icon
  1205.                   x: -10
  1206.                   y: -10
  1207.                   text: "\U000F1051"
  1208.                   styles: actual_button_label_icon
  1209.               - label:
  1210.                   id: headboard_bedroom_label_name
  1211.                   x: -5
  1212.                   y: 50
  1213.                   text: "Headboard"
  1214.                   styles: actual_button_label_name
  1215.               - label:
  1216.                   id: headboard_bedroom_label_status
  1217.                   x: 10
  1218.                   y: 70
  1219.                   text: "KI"
  1220.                   styles: actual_button_label_status
  1221.  
  1222. #########################################################################    Livingroom page    ##########
  1223.  
  1224.     - id: livingroom_page
  1225.       widgets:
  1226.         - image:
  1227.             x: 0
  1228.             y: 0
  1229.             width: 480
  1230.             height: 480
  1231.             src: livingroom
  1232.         - label:
  1233.             text: "Nappali"
  1234.             styles: title
  1235.         - button:
  1236.             x: 150
  1237.             y: 83
  1238.             styles: status_row_button
  1239.             widgets:
  1240.               - label:
  1241.                   id: temp_livingroom
  1242.                   text: "23°C"
  1243.                   text_color: 0xFFFFFF
  1244.                   text_font: amiko24
  1245.                   align: CENTER
  1246.         - label:
  1247.             x: 148
  1248.             y: 178
  1249.             width: 102
  1250.             height: 20
  1251.             text: "Hőmérséklet"
  1252.             text_color: 0xFFFFFF
  1253.             text_font: amiko16
  1254.         - button:
  1255.             id: presence_livingroom
  1256.             x: 260
  1257.             y: 83
  1258.             styles: status_row_button
  1259.             widgets:
  1260.               - label:
  1261.                   id: presence_livingroom_label
  1262.                   text: "\U000F1435"
  1263.                   styles: status_row_label
  1264.         - label:
  1265.             x: 280
  1266.             y: 178
  1267.             width: 78
  1268.             height: 20
  1269.             text: "Mozgás"
  1270.             text_color: 0xFFFFFF
  1271.             text_font: amiko16
  1272.  
  1273.         - button:
  1274.             id: window_livingroom_button
  1275.             x: 370
  1276.             y: 83
  1277.             styles: status_row_button
  1278.             widgets:
  1279.               - label:
  1280.                   id: window_livingroom_label
  1281.                   text: "\U000F11DB"
  1282.                   styles: status_row_label
  1283.         - label:
  1284.             x: 395
  1285.             y: 178
  1286.             width: 83
  1287.             height: 20
  1288.             text: "Ablak"
  1289.             text_color: 0xFFFFFF
  1290.             text_font: amiko16
  1291.  
  1292.         - button:
  1293.             id: ceiling_lamp_livingroom_button
  1294.             x: 250
  1295.             y: 220
  1296.             styles: actual_button
  1297.             on_click:
  1298.               - homeassistant.action:
  1299.                   action: light.toggle
  1300.                   data:
  1301.                     entity_id: light.fali_kapcsolo_nappali_left
  1302.             widgets:
  1303.               - label:
  1304.                   id: ceiling_lamp_livingroom_label_icon
  1305.                   x: -10
  1306.                   y: -10
  1307.                   text: "\U000F0769"
  1308.                   styles: actual_button_label_icon
  1309.               - label:
  1310.                   id: ceiling_lamp_livingroom_label_name
  1311.                   x: -5
  1312.                   y: 50
  1313.                   text: "Mennyezeti lámpa"
  1314.                   long_mode: SCROLL_CIRCULAR
  1315.                   styles: actual_button_label_name
  1316.               - label:
  1317.                   id: ceiling_lamp_livingroom_label_status
  1318.                   x: 10
  1319.                   y: 70
  1320.                   text: "KI"
  1321.                   styles: actual_button_label_status
  1322.  
  1323.         - button:
  1324.             id: ambient_livingroom_button
  1325.             x: 250
  1326.             y: 340
  1327.             styles: actual_button
  1328.             on_click:
  1329.               - homeassistant.action:
  1330.                   action: light.toggle
  1331.                   data:
  1332.                     entity_id: light.nappali_ambient
  1333.             widgets:
  1334.               - label:
  1335.                   id: ambient_livingroom_label_icon
  1336.                   x: -10
  1337.                   y: -10
  1338.                   text: "\U000F1051"
  1339.                   styles: actual_button_label_icon
  1340.               - label:
  1341.                   id: ambient_livingroom_label_name
  1342.                   x: -5
  1343.                   y: 50
  1344.                   text: "Ambient"
  1345.                   styles: actual_button_label_name
  1346.               - label:
  1347.                   id: ambient_livingroom_label_status
  1348.                   x: 10
  1349.                   y: 70
  1350.                   text: "KI"
  1351.                   styles: actual_button_label_status
  1352.  
  1353. ##############################################################################    House page    ##########
  1354.  
  1355.     - id: house_page
  1356.       widgets:
  1357.         - image:
  1358.             x: 0
  1359.             y: 0
  1360.             width: 480
  1361.             height: 480
  1362.             src: house
  1363.         - label:
  1364.             text: "Zita & Imilak"
  1365.             styles: title
  1366.         - button:
  1367.             id: presence_entrance_button
  1368.             x: 150
  1369.             y: 83
  1370.             styles: status_row_button
  1371.             widgets:
  1372.               - label:
  1373.                   id: presence_entrance_label
  1374.                   text: "\U000F1435"
  1375.                   styles: status_row_label
  1376.         - label:
  1377.             x: 148
  1378.             y: 178
  1379.             width: 98
  1380.             height: 20
  1381.             text: "Mozgás"
  1382.             text_color: 0xFFFFFF
  1383.             text_font: amiko16
  1384.             text_align: CENTER
  1385.  
  1386.         - button:
  1387.             id: alarm_button
  1388.             x: 260
  1389.             y: 83
  1390.             styles: status_row_button
  1391.             on_press:
  1392.               - lvgl.page.show:
  1393.                   id: alarm_page
  1394.               - lambda: |-
  1395.                   id(active_page) = 5;
  1396.               - logger.log: "Active page: 5"
  1397.             widgets:
  1398.               - label:
  1399.                   id: alarm_label
  1400.                   text: "\U000F11A3"
  1401.                   styles: status_row_label
  1402.         - label:
  1403.             x: 260
  1404.             y: 178
  1405.             width: 98
  1406.             height: 20
  1407.             text: "Riasztó"
  1408.             text_color: 0xFFFFFF
  1409.             text_font: amiko16
  1410.             text_align: CENTER
  1411.  
  1412.         - button:
  1413.             id: door_entrance_button
  1414.             x: 370
  1415.             y: 83
  1416.             styles: status_row_button
  1417.             widgets:
  1418.               - label:
  1419.                   id: door_entrance_label
  1420.                   text: "\U000F081B"
  1421.                   styles: status_row_label
  1422.         - label:
  1423.             x: 370
  1424.             y: 178
  1425.             width: 98
  1426.             height: 20
  1427.             text: "Ajtó"
  1428.             text_color: 0xFFFFFF
  1429.             text_font: amiko16
  1430.             text_align: CENTER
  1431.  
  1432.         - label:
  1433.             id: info_label_1
  1434.             x: 130
  1435.             y: 200
  1436.             width: 350
  1437.             height: SIZE_CONTENT
  1438.             text: "Betöltés..."
  1439.             text_font: amiko24
  1440.             text_color: 0xffffff
  1441.             text_align: CENTER
  1442.             long_mode: WRAP
  1443.  
  1444. ##############################################################################    Clock page    ##########
  1445.  
  1446.     - id: clock_page
  1447.       widgets:
  1448.         - obj: # clock container
  1449.             width: 480
  1450.             height: 480
  1451.             align: CENTER
  1452.             radius: 0
  1453.             pad_all: 0
  1454.             border_width: 0
  1455.             bg_color: 0x000000
  1456.             widgets:
  1457.               - meter: # clock face
  1458.                   height: 350
  1459.                   width: 350
  1460.                   align: TOP_RIGHT
  1461.                   bg_opa: TRANSP
  1462.                   border_width: 0
  1463.                   text_color: 0xFFFFFF
  1464.                   scales:
  1465.                     - range_from: 0 # minutes scale
  1466.                       range_to: 60
  1467.                       angle_range: 360
  1468.                       rotation: 270
  1469.                       ticks:
  1470.                         width: 1
  1471.                         count: 61
  1472.                         length: 10
  1473.                         color: 0xFFFFFF
  1474.                       indicators:
  1475.                         - line:
  1476.                             id: minute_hand
  1477.                             width: 3
  1478.                             color: 0xa6a6a6
  1479.                             r_mod: -4
  1480.                             value: 0
  1481.                     - range_from: 1 # hours scale for labels
  1482.                       range_to: 12
  1483.                       angle_range: 330
  1484.                       rotation: 300
  1485.                       ticks:
  1486.                         width: 1
  1487.                         count: 12
  1488.                         length: 1
  1489.                         major:
  1490.                           stride: 1
  1491.                           width: 4
  1492.                           length: 10
  1493.                           color: 0xC0C0C0
  1494.                           label_gap: 12
  1495.                     - range_from: 0 # hi-res hours scale for hand
  1496.                       range_to: 720
  1497.                       angle_range: 360
  1498.                       rotation: 270
  1499.                       ticks:
  1500.                         count: 0
  1501.                       indicators:
  1502.                         - line:
  1503.                             id: hour_hand
  1504.                             width: 5
  1505.                             color: 0xa6a6a6
  1506.                             r_mod: -30
  1507.                             value: 0
  1508.               - label:
  1509.                   id: day_label
  1510.                   text_color: 0xffffff
  1511.                   text_font: amiko16
  1512.                   y: 100
  1513.                   x: 275
  1514.               - label:
  1515.                   id: date_label
  1516.                   text_color: 0xffffff
  1517.                   text_font: amiko16
  1518.                   y: 240
  1519.                   x: 280
  1520.               - label:
  1521.                   id: info_label_2
  1522.                   x: 130
  1523.                   y: 380
  1524.                   width: 350
  1525.                   height: 50
  1526.                   text: "Betöltés..."
  1527.                   text_font: amiko32
  1528.                   text_color: 0x808080
  1529.                   long_mode: SCROLL_CIRCULAR
  1530.  
  1531. ##############################################################################    Alarm page    ##########
  1532.  
  1533.     - id: alarm_page
  1534.       widgets:
  1535.         - image:
  1536.             x: 0
  1537.             y: 0
  1538.             width: 480
  1539.             height: 480
  1540.             src: alarm_bg
  1541.         - label:
  1542.             text: "Riasztó"
  1543.             styles: title
  1544.         - led:
  1545.             id: alarm_page_led
  1546.             x: 150
  1547.             y: 70
  1548.             color: 0xFF0000
  1549.             brightness: 70%
  1550.         - obj:
  1551.             width: 240
  1552.             height: 30
  1553.             align_to:
  1554.               id: alarm_page_led
  1555.               align: OUT_RIGHT_MID
  1556.               x: 50
  1557.             border_width: 1
  1558.             border_color: 0
  1559.             border_opa: 50%
  1560.             pad_all: 0
  1561.             bg_opa: 50%
  1562.             bg_color: 0xFFFFFF
  1563.             shadow_color: 0
  1564.             shadow_opa: 50%
  1565.             shadow_width: 10
  1566.             shadow_spread: 3
  1567.             radius: 5
  1568.             widgets:
  1569.               - label:
  1570.                   id: alarm_page_label
  1571.                   align: CENTER
  1572.                   text: "Kérem a kódot"
  1573.                   text_align: CENTER
  1574.                   text_font: amiko20
  1575.         - buttonmatrix:
  1576.             id: alarm_page_keypad
  1577.             x: 130
  1578.             y: 130
  1579.             width: 350
  1580.             height: 350
  1581.             opa: 40%
  1582.             items:
  1583.               pressed:
  1584.                 bg_color: 0xFFFF00
  1585.                 opa: 80%
  1586.             rows:
  1587.               - buttons:
  1588.                   - text: 1
  1589.                     control:
  1590.                       no_repeat: true
  1591.                   - text: 2
  1592.                     control:
  1593.                       no_repeat: true
  1594.                   - text: 3
  1595.                     control:
  1596.                       no_repeat: true
  1597.               - buttons:
  1598.                   - text: 4
  1599.                     control:
  1600.                       no_repeat: true
  1601.                   - text: 5
  1602.                     control:
  1603.                       no_repeat: true
  1604.                   - text: 6
  1605.                     control:
  1606.                       no_repeat: true
  1607.               - buttons:
  1608.                   - text: 7
  1609.                     control:
  1610.                       no_repeat: true
  1611.                   - text: 8
  1612.                     control:
  1613.                       no_repeat: true
  1614.                   - text: 9
  1615.                     control:
  1616.                       no_repeat: true
  1617.               - buttons:
  1618.                   - text: "\uF55A"
  1619.                     key_code: "*"
  1620.                     control:
  1621.                       no_repeat: true
  1622.                   - text: 0
  1623.                     control:
  1624.                       no_repeat: true
  1625.                   - text: "\uF00C"
  1626.                     key_code: "#"
  1627.                     control:
  1628.                       no_repeat: true
  1629.  
  1630. ##########################################################################    Pop-up windows    ##########
  1631.  
  1632.   msgboxes:
  1633.     - id: alarm_panel_popup
  1634.       close_button: true
  1635.       title: Riasztó
  1636.       opa: 80%
  1637.       body:
  1638.         text: "Riasztó deaktiválva"
  1639.         text_font: amiko16
  1640.       buttons:
  1641.         - id: msgbox_close
  1642.           text: "OK"
  1643.           on_click:
  1644.             then:
  1645.               - lvgl.widget.hide: alarm_panel_popup
  1646.  
  1647. ###########################################################################    Key collector    ##########
  1648.  
  1649. key_collector:
  1650.   - source_id: alarm_page_keypad
  1651.     min_length: 4
  1652.     max_length: 4
  1653.     end_keys: "#"
  1654.     end_key_required: true
  1655.     back_keys: "*"
  1656.     allowed_keys: "0123456789*#"
  1657.     timeout: 5s
  1658.     on_progress:
  1659.       - if:
  1660.           condition:
  1661.             lambda: return (0 != x.compare(std::string{""}));
  1662.           then:
  1663.             - lvgl.label.update:
  1664.                 id: alarm_page_label
  1665.                 text: !lambda 'return x.c_str();'
  1666.           else:
  1667.             - lvgl.label.update:
  1668.                 id: alarm_page_label
  1669.                 text: "Kérem a kódot"
  1670.                 text_font: amiko20
  1671.     on_result:
  1672.       - if:
  1673.           condition:
  1674.             lambda: return (0 == x.compare(std::string{"7809"}));
  1675.           then:
  1676.             - lvgl.led.update:
  1677.                 id: alarm_page_led
  1678.                 color: 0x00FF00
  1679.             - lvgl.label.update:
  1680.                 id: alarm_page_label
  1681.                 text: "Kód elfogadva"
  1682.                 text_font: amiko20
  1683.             - delay: 2s
  1684.             - lvgl.page.show:
  1685.                 id: house_page
  1686.             - lambda: |-
  1687.                 (id(active_page) = 4);
  1688.             - lvgl.widget.show:
  1689.                 id: alarm_panel_popup
  1690.           else:
  1691.             - lvgl.led.update:
  1692.                 id: alarm_page_led
  1693.                 color: 0xFF0000
  1694.             - lvgl.label.update:
  1695.                 id: alarm_page_label
  1696.                 text: "Hibás kód"
  1697.                 text_font: amiko20
  1698.  
  1699. #################################################################################    Scripts    ##########
  1700.  
  1701. script:
  1702.   - id: update_weather_icon
  1703.     then:
  1704.       - if:
  1705.           condition:
  1706.             or:
  1707.               - lambda: 'return id(weather_icon_ha).state == "sunny";'
  1708.               - lambda: 'return id(weather_icon_ha).state == "clear";'
  1709.           then:
  1710.             - lvgl.image.update:
  1711.                 id: weather_icon
  1712.                 src: sunny
  1713.       - if:
  1714.           condition:
  1715.             or:
  1716.               - lambda: 'return id(weather_icon_ha).state == "clear-night";'
  1717.               - lambda: 'return id(weather_icon_ha).state == "night";'
  1718.           then:
  1719.             - lvgl.image.update:
  1720.                 id: weather_icon
  1721.                 src: clearnight
  1722.       - if:
  1723.           condition:
  1724.             - lambda: 'return id(weather_icon_ha).state == "partlycloudy";'
  1725.           then:
  1726.             - lvgl.image.update:
  1727.                 id: weather_icon
  1728.                 src: partlycloudy
  1729.       - if:
  1730.           condition:
  1731.             and:            
  1732.               - lambda: 'return id(weather_icon_ha).state == "partlycloudy";'
  1733.               - sun.is_below_horizon:
  1734.           then:
  1735.             - lvgl.image.update:
  1736.                 id: weather_icon
  1737.                 src: partlycloudy
  1738.       - if:
  1739.           condition:          
  1740.             - lambda: 'return id(weather_icon_ha).state == "cloudy";'
  1741.             - sun.is_below_horizon:
  1742.           then:
  1743.             - lvgl.image.update:
  1744.                 id: weather_icon
  1745.                 src: scloud
  1746.       - if:
  1747.           condition:          
  1748.             and:            
  1749.               - lambda: 'return id(weather_icon_ha).state == "cloudy";'
  1750.           then:
  1751.             - lvgl.image.update:
  1752.                 id: weather_icon
  1753.                 src: cloudy
  1754.       - if:
  1755.           condition:
  1756.             - lambda: 'return id(weather_icon_ha).state == "rainy";'
  1757.           then:
  1758.             - lvgl.image.update:
  1759.                 id: weather_icon
  1760.                 src: rainy
  1761.       - if:
  1762.           condition:
  1763.             - lambda: 'return id(weather_icon_ha).state == "pouring";'
  1764.           then:
  1765.             - lvgl.image.update:
  1766.                 id: weather_icon
  1767.                 src: pouring
  1768.       - if:
  1769.           condition:
  1770.             - lambda: 'return id(weather_icon_ha).state == "hail";'
  1771.           then:
  1772.             - lvgl.image.update:
  1773.                 id: weather_icon
  1774.                 src: hail  
  1775.       - if:
  1776.           condition:
  1777.             - lambda: 'return id(weather_icon_ha).state == "snowy";'
  1778.           then:
  1779.             - lvgl.image.update:
  1780.                 id: weather_icon
  1781.                 src: snowy
  1782.       - if:
  1783.           condition:
  1784.             - lambda: 'return id(weather_icon_ha).state == "windy";'
  1785.           then:
  1786.             - lvgl.image.update:
  1787.                 id: weather_icon
  1788.                 src: windy
  1789.       - if:
  1790.           condition:
  1791.             or:
  1792.               - lambda: 'return id(weather_icon_ha).state == "lightning";'
  1793.               - lambda: 'return id(weather_icon_ha).state == "lightning-rainy";'
  1794.               - lambda: 'return id(weather_icon_ha).state == "thender";'
  1795.           then:
  1796.             - lvgl.image.update:
  1797.                 id: weather_icon
  1798.                 src: lightning
  1799.  
  1800.   - id: update_weather_text
  1801.     then:
  1802.       - if:
  1803.           condition:
  1804.             or:
  1805.               - lambda: 'return id(weather_icon_ha).state == "sunny";'
  1806.           then:
  1807.             - lvgl.label.update:
  1808.                 id: weather_text
  1809.                 text: Napos
  1810.       - if:
  1811.           condition:
  1812.             or:
  1813.               - lambda: 'return id(weather_icon_ha).state == "clear-night";'
  1814.               - lambda: 'return id(weather_icon_ha).state == "night";'
  1815.           then:
  1816.             - lvgl.label.update:
  1817.                 id: weather_text
  1818.                 text: Tiszta éjszaka
  1819.       - if:
  1820.           condition:
  1821.             - lambda: 'return id(weather_icon_ha).state == "partlycloudy";'
  1822.           then:
  1823.             - lvgl.label.update:
  1824.                 id: weather_text
  1825.                 text: Részben felhős
  1826.       - if:
  1827.           condition:          
  1828.             and:            
  1829.               - lambda: 'return id(weather_icon_ha).state == "cloudy";'
  1830.           then:
  1831.             - lvgl.label.update:
  1832.                 id: weather_text
  1833.                 text: Felhős
  1834.       - if:
  1835.           condition:
  1836.             - lambda: 'return id(weather_icon_ha).state == "rainy";'
  1837.           then:
  1838.             - lvgl.label.update:
  1839.                 id: weather_text
  1840.                 text: Esős
  1841.       - if:
  1842.           condition:
  1843.             - lambda: 'return id(weather_icon_ha).state == "pouring";'
  1844.           then:
  1845.             - lvgl.label.update:
  1846.                 id: weather_text
  1847.                 text: Szakadó eső
  1848.       - if:
  1849.           condition:
  1850.             - lambda: 'return id(weather_icon_ha).state == "hail";'
  1851.           then:
  1852.             - lvgl.label.update:
  1853.                 id: weather_text
  1854.                 text: Jégeső
  1855.       - if:
  1856.           condition:
  1857.             - lambda: 'return id(weather_icon_ha).state == "snowy";'
  1858.           then:
  1859.             - lvgl.label.update:
  1860.                 id: weather_text
  1861.                 text: Havazás
  1862.       - if:
  1863.           condition:
  1864.             - lambda: 'return id(weather_icon_ha).state == "windy";'
  1865.           then:
  1866.             - lvgl.label.update:
  1867.                 id: weather_text
  1868.                 text: Szeles
  1869.       - if:
  1870.           condition:
  1871.             or:
  1872.               - lambda: 'return id(weather_icon_ha).state == "lightning";'
  1873.               - lambda: 'return id(weather_icon_ha).state == "lightning-rainy";'
  1874.               - lambda: 'return id(weather_icon_ha).state == "thender";'
  1875.           then:
  1876.             - lvgl.label.update:
  1877.                 id: weather_text
  1878.                 text: Viharos
  1879.  
  1880. #############################################################################    Time update    ##########
  1881.  
  1882.   - id: time_update
  1883.     then:
  1884.       - lvgl.indicator.update:
  1885.           id: minute_hand
  1886.           value: !lambda |-
  1887.             return id(time1).now().minute;
  1888.       - lvgl.indicator.update:
  1889.           id: hour_hand
  1890.           value: !lambda |-
  1891.             auto now = id(time1).now();
  1892.             return std::fmod(now.hour, 12) * 60 + now.minute;
  1893.       - lvgl.label.update:
  1894.           id: date_label
  1895.           text: !lambda |-
  1896.             static const char * const mon_names[] = {"Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Szep", "Okt", "Nov", "Dec"};
  1897.             static char date_buf[8];
  1898.             auto now = id(time1).now();
  1899.             snprintf(date_buf, sizeof(date_buf), "%s %2d", mon_names[now.month-1], now.day_of_month);
  1900.             return date_buf;
  1901.       - lvgl.label.update:
  1902.           id: day_label
  1903.           text: !lambda |-
  1904.             static const char * const day_names[] = {"Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat"};
  1905.             return day_names[id(time1).now().day_of_week - 1];
  1906.  
  1907. ################################################################    Top layer buttons update    ##########
  1908.  
  1909.   - id: refresh_buttons
  1910.     then:
  1911.       - if:
  1912.           condition:
  1913.             lambda: 'return id(active_page) == 1;'
  1914.           then:
  1915.             - lvgl.label.update:
  1916.                 id: button_workshop_label
  1917.                 text_color: 0xff9e00
  1918.           else:
  1919.             - lvgl.label.update:
  1920.                 id: button_workshop_label
  1921.                 text_color: 0xffffff
  1922.  
  1923.       - if:
  1924.           condition:
  1925.             lambda: 'return id(active_page) == 2;'
  1926.           then:
  1927.             - lvgl.label.update:
  1928.                 id: button_bedroom_label
  1929.                 text_color: 0xff9e00
  1930.           else:
  1931.             - lvgl.label.update:
  1932.                 id: button_bedroom_label
  1933.                 text_color: 0xffffff
  1934.       - if:
  1935.           condition:
  1936.             lambda: 'return id(active_page) == 3;'
  1937.           then:
  1938.             - lvgl.label.update:
  1939.                 id: button_livingroom_label
  1940.                 text_color: 0xff9e00
  1941.           else:
  1942.             - lvgl.label.update:
  1943.                 id: button_livingroom_label
  1944.                 text_color: 0xffffff
  1945.       - if:
  1946.           condition:
  1947.             lambda: 'return id(active_page) == 4;'
  1948.           then:
  1949.             - lvgl.label.update:
  1950.                 id: button_house_label
  1951.                 text_color: 0xff9e00
  1952.           else:
  1953.             - lvgl.label.update:
  1954.                 id: button_house_label
  1955.                 text_color: 0xffffff
  1956.       - if:
  1957.           condition:
  1958.             lambda: 'return id(active_page) == 5;'
  1959.           then:
  1960.             - lvgl.widget.hide:
  1961.                 id: button_workshop
  1962.             - lvgl.widget.hide:
  1963.                 id: button_bedroom
  1964.             - lvgl.widget.hide:
  1965.                 id: button_livingroom
  1966.             - lvgl.widget.hide:
  1967.                 id: button_house
  1968.       - if:
  1969.           condition:
  1970.             lambda: 'return id(active_page) == 0;'
  1971.           then:
  1972.             - lvgl.label.update:
  1973.                 id: button_workshop_label
  1974.                 text_color: 0x808080
  1975.             - lvgl.label.update:
  1976.                 id: button_bedroom_label
  1977.                 text_color: 0x808080
  1978.             - lvgl.label.update:
  1979.                 id: button_livingroom_label
  1980.                 text_color: 0x808080
  1981.             - lvgl.label.update:
  1982.                 id: button_house_label
  1983.                 text_color: 0x808080
  1984.  
  1985. ##############################################################    Workshop status row update    ##########
  1986.  
  1987.   - id: update_workshop_presence_button
  1988.     then:
  1989.       - if:
  1990.           condition:
  1991.             lambda: 'return id(workshop_presence).state == "on";'
  1992.           then:
  1993.             - lvgl.button.update:
  1994.                 id: presence_workshop
  1995.                 styles: status_row_active_button
  1996.             - lvgl.label.update:
  1997.                 id: presence_workshop_label
  1998.                 text: "\U000F0004"
  1999.                 styles: status_row_active_label
  2000.           else:
  2001.             - lvgl.button.update:
  2002.                 id: presence_workshop
  2003.                 styles: status_row_button
  2004.             - lvgl.label.update:
  2005.                 id: presence_workshop_label
  2006.                 text: "\U000F0013"
  2007.                 styles: status_row_label
  2008.  
  2009.   - id: update_workshop_window_button
  2010.     then:
  2011.       - if:
  2012.           condition:
  2013.             lambda: 'return id(workshop_window).state == "on";'
  2014.           then:
  2015.             - lvgl.button.update:
  2016.                 id: window_workshop_button
  2017.                 styles: status_row_active_button
  2018.             - lvgl.label.update:
  2019.                 id: window_workshop_label
  2020.                 text: "\U000F11DC"
  2021.                 styles: status_row_active_label
  2022.           else:
  2023.             - lvgl.button.update:
  2024.                 id: window_workshop_button
  2025.                 styles: status_row_button
  2026.             - lvgl.label.update:
  2027.                 id: window_workshop_label
  2028.                 text: "\U000F11DB"
  2029.                 styles: status_row_label
  2030.  
  2031. ###############################################################    Bedroom status row update    ##########
  2032.  
  2033.   - id: update_bedroom_presence_button
  2034.     then:
  2035.       - if:
  2036.           condition:
  2037.             lambda: 'return id(bedroom_presence).state == "on";'
  2038.           then:
  2039.             - lvgl.button.update:
  2040.                 id: presence_bedroom
  2041.                 styles: status_row_active_button
  2042.             - lvgl.label.update:
  2043.                 id: presence_bedroom_label
  2044.                 text: "\U000F0004"
  2045.                 styles: status_row_active_label
  2046.           else:
  2047.             - lvgl.button.update:
  2048.                 id: presence_bedroom
  2049.                 styles: status_row_button
  2050.             - lvgl.label.update:
  2051.                 id: presence_bedroom_label
  2052.                 text: "\U000F0013"
  2053.                 styles: status_row_label
  2054.  
  2055.   - id: update_bedroom_window_button
  2056.     then:
  2057.       - if:
  2058.           condition:
  2059.             lambda: 'return id(bedroom_window).state == "on";'
  2060.           then:
  2061.             - lvgl.button.update:
  2062.                 id: window_bedroom_button
  2063.                 styles: status_row_active_button
  2064.             - lvgl.label.update:
  2065.                 id: window_bedroom_label
  2066.                 text: "\U000F11DC"
  2067.                 styles: status_row_active_label
  2068.           else:
  2069.             - lvgl.button.update:
  2070.                 id: window_bedroom_button
  2071.                 styles: status_row_button
  2072.             - lvgl.label.update:
  2073.                 id: window_bedroom_label
  2074.                 text: "\U000F11DB"
  2075.                 styles: status_row_label
  2076.  
  2077. ############################################################    Livingroom status row update    ##########
  2078.  
  2079.   - id: update_livingroom_presence_button
  2080.     then:
  2081.       - if:
  2082.           condition:
  2083.             lambda: 'return id(livingroom_presence).state == "on";'
  2084.           then:
  2085.             - lvgl.button.update:
  2086.                 id: presence_livingroom
  2087.                 styles: status_row_active_button
  2088.             - lvgl.label.update:
  2089.                 id: presence_livingroom_label
  2090.                 text: "\U000F0D91"
  2091.                 styles: status_row_active_label
  2092.           else:
  2093.             - lvgl.button.update:
  2094.                 id: presence_livingroom
  2095.                 styles: status_row_button
  2096.             - lvgl.label.update:
  2097.                 id: presence_livingroom_label
  2098.                 text: "\U000F1435"
  2099.                 styles: status_row_label
  2100.  
  2101.   - id: update_livingroom_window_button
  2102.     then:
  2103.       - if:
  2104.           condition:
  2105.             lambda: 'return id(livingroom_window).state == "on";'
  2106.           then:
  2107.             - lvgl.button.update:
  2108.                 id: window_livingroom_button
  2109.                 styles: status_row_active_button
  2110.             - lvgl.label.update:
  2111.                 id: window_livingroom_label
  2112.                 text: "\U000F11DC"
  2113.                 styles: status_row_active_label
  2114.           else:
  2115.             - lvgl.button.update:
  2116.                 id: window_livingroom_button
  2117.                 styles: status_row_button
  2118.             - lvgl.label.update:
  2119.                 id: window_livingroom_label
  2120.                 text: "\U000F11DB"
  2121.                 styles: status_row_label
  2122.  
  2123. ##############################################################    Entrance status row update    ##########
  2124.  
  2125.   - id: update_presence_entrance_button
  2126.     then:
  2127.       - if:
  2128.           condition:
  2129.             lambda: 'return id(presence_entrance).state == "on";'
  2130.           then:
  2131.             - lvgl.button.update:
  2132.                 id: presence_entrance_button
  2133.                 styles: status_row_active_button
  2134.             - lvgl.label.update:
  2135.                 id: presence_entrance_label
  2136.                 text: "\U000F0D91"
  2137.                 styles: status_row_active_label
  2138.           else:
  2139.             - lvgl.button.update:
  2140.                 id: presence_entrance_button
  2141.                 styles: status_row_button
  2142.             - lvgl.label.update:
  2143.                 id: presence_entrance_label
  2144.                 text: "\U000F1435"
  2145.                 styles: status_row_label
  2146.  
  2147.   - id: update_door_entrance_button
  2148.     then:
  2149.       - if:
  2150.           condition:
  2151.             lambda: 'return id(door_entrance).state == "on";'
  2152.           then:
  2153.             - lvgl.button.update:
  2154.                 id: door_entrance_button
  2155.                 styles: status_row_active_button
  2156.             - lvgl.label.update:
  2157.                 id: door_entrance_label
  2158.                 text: "\U000F081C"
  2159.                 styles: status_row_active_label
  2160.           else:
  2161.             - lvgl.button.update:
  2162.                 id: door_entrance_button
  2163.                 styles: status_row_button
  2164.             - lvgl.label.update:
  2165.                 id: door_entrance_label
  2166.                 text: "\U000F081B"
  2167.                 styles: status_row_label
  2168. #########################################################################    Switch updates    ###########
  2169.   - id: update_ceiling_lamp_workshop_button
  2170.     then:
  2171.       - if:
  2172.           condition:
  2173.             lambda: 'return id(ceiling_lamp_workshop).state == "on";'
  2174.           then:
  2175.             - lvgl.button.update:
  2176.                 id: ceiling_lamp_workshop_button
  2177.                 styles: actual_button_active
  2178.             - lvgl.label.update:
  2179.                 id: ceiling_lamp_workshop_label_icon
  2180.                 styles: actual_button_label_icon_active
  2181.             - lvgl.label.update:
  2182.                 id: ceiling_lamp_workshop_label_name
  2183.                 styles: actual_button_label_name_active
  2184.             - lvgl.label.update:
  2185.                 id: ceiling_lamp_workshop_label_status
  2186.                 styles: actual_button_label_status_active
  2187.                 text: "BE"
  2188.           else:
  2189.             - lvgl.button.update:
  2190.                 id: ceiling_lamp_workshop_button
  2191.                 styles: actual_button
  2192.             - lvgl.label.update:
  2193.                 id: ceiling_lamp_workshop_label_icon
  2194.                 styles: actual_button_label_icon
  2195.             - lvgl.label.update:
  2196.                 id: ceiling_lamp_workshop_label_name
  2197.                 styles: actual_button_label_name
  2198.             - lvgl.label.update:
  2199.                 id: ceiling_lamp_workshop_label_status
  2200.                 styles: actual_button_label_status
  2201.                 text: "KI"
  2202.  
  2203.   - id: update_standing_lamp_workshop_button
  2204.     then:
  2205.       - if:
  2206.           condition:
  2207.             lambda: 'return id(standing_lamp_workshop).state == "on";'
  2208.           then:
  2209.             - lvgl.button.update:
  2210.                 id: standing_lamp_workshop_button
  2211.                 styles: actual_button_active
  2212.             - lvgl.label.update:
  2213.                 id: standing_lamp_workshop_label_icon
  2214.                 styles: actual_button_label_icon_active
  2215.             - lvgl.label.update:
  2216.                 id: standing_lamp_workshop_label_name
  2217.                 styles: actual_button_label_name_active
  2218.             - lvgl.label.update:
  2219.                 id: standing_lamp_workshop_label_status
  2220.                 styles: actual_button_label_status_active
  2221.                 text: "BE"
  2222.           else:
  2223.             - lvgl.button.update:
  2224.                 id: standing_lamp_workshop_button
  2225.                 styles: actual_button
  2226.             - lvgl.label.update:
  2227.                 id: standing_lamp_workshop_label_icon
  2228.                 styles: actual_button_label_icon
  2229.             - lvgl.label.update:
  2230.                 id: standing_lamp_workshop_label_name
  2231.                 styles: actual_button_label_name
  2232.             - lvgl.label.update:
  2233.                 id: standing_lamp_workshop_label_status
  2234.                 styles: actual_button_label_status
  2235.                 text: "KI"
  2236.  
  2237.   - id: update_desk_lamp_workshop_button
  2238.     then:
  2239.       - if:
  2240.           condition:
  2241.             lambda: 'return id(desk_lamp_workshop).state == "on";'
  2242.           then:
  2243.             - lvgl.button.update:
  2244.                 id: desk_lamp_button
  2245.                 styles: actual_button_active
  2246.             - lvgl.label.update:
  2247.                 id: desk_lamp_label_icon
  2248.                 styles: actual_button_label_icon_active
  2249.             - lvgl.label.update:
  2250.                 id: desk_lamp_label_name
  2251.                 styles: actual_button_label_name_active
  2252.             - lvgl.label.update:
  2253.                 id: desk_lamp_label_status
  2254.                 styles: actual_button_label_status_active
  2255.                 text: "BE"
  2256.           else:
  2257.             - lvgl.button.update:
  2258.                 id: desk_lamp_button
  2259.                 styles: actual_button
  2260.             - lvgl.label.update:
  2261.                 id: desk_lamp_label_icon
  2262.                 styles: actual_button_label_icon
  2263.             - lvgl.label.update:
  2264.                 id: desk_lamp_label_name
  2265.                 styles: actual_button_label_name
  2266.             - lvgl.label.update:
  2267.                 id: desk_lamp_label_status
  2268.                 styles: actual_button_label_status
  2269.                 text: "KI"
  2270.  
  2271.   - id: update_ceiling_lamp_bedroom_button
  2272.     then:
  2273.       - if:
  2274.           condition:
  2275.             lambda: 'return id(ceiling_lamp_bedroom).state == "on";'
  2276.           then:
  2277.             - lvgl.button.update:
  2278.                 id: ceiling_lamp_bedroom_button
  2279.                 styles: actual_button_active
  2280.             - lvgl.label.update:
  2281.                 id: ceiling_lamp_bedroom_label_icon
  2282.                 styles: actual_button_label_icon_active
  2283.             - lvgl.label.update:
  2284.                 id: ceiling_lamp_bedroom_label_name
  2285.                 styles: actual_button_label_name_active
  2286.             - lvgl.label.update:
  2287.                 id: ceiling_lamp_bedroom_label_status
  2288.                 styles: actual_button_label_status_active
  2289.                 text: "BE"
  2290.           else:
  2291.             - lvgl.button.update:
  2292.                 id: ceiling_lamp_bedroom_button
  2293.                 styles: actual_button
  2294.             - lvgl.label.update:
  2295.                 id: ceiling_lamp_bedroom_label_icon
  2296.                 styles: actual_button_label_icon
  2297.             - lvgl.label.update:
  2298.                 id: ceiling_lamp_bedroom_label_name
  2299.                 styles: actual_button_label_name
  2300.             - lvgl.label.update:
  2301.                 id: ceiling_lamp_bedroom_label_status
  2302.                 styles: actual_button_label_status
  2303.                 text: "KI"
  2304.  
  2305.   - id: update_headboard_bedroom_button
  2306.     then:
  2307.       - if:
  2308.           condition:
  2309.             lambda: 'return id(headboard_bedroom).state == "on";'
  2310.           then:
  2311.             - lvgl.button.update:
  2312.                 id: headboard_bedroom_button
  2313.                 styles: actual_button_active
  2314.             - lvgl.label.update:
  2315.                 id: headboard_bedroom_label_icon
  2316.                 styles: actual_button_label_icon_active
  2317.             - lvgl.label.update:
  2318.                 id: headboard_bedroom_label_name
  2319.                 styles: actual_button_label_name_active
  2320.             - lvgl.label.update:
  2321.                 id: headboard_bedroom_label_status
  2322.                 styles: actual_button_label_status_active
  2323.                 text: "BE"
  2324.           else:
  2325.             - lvgl.button.update:
  2326.                 id: headboard_bedroom_button
  2327.                 styles: actual_button
  2328.             - lvgl.label.update:
  2329.                 id: headboard_bedroom_label_icon
  2330.                 styles: actual_button_label_icon
  2331.             - lvgl.label.update:
  2332.                 id: headboard_bedroom_label_name
  2333.                 styles: actual_button_label_name
  2334.             - lvgl.label.update:
  2335.                 id: headboard_bedroom_label_status
  2336.                 styles: actual_button_label_status
  2337.                 text: "KI"
  2338.  
  2339.   - id: update_standing_lamp_bedroom_button
  2340.     then:
  2341.       - if:
  2342.           condition:
  2343.             lambda: 'return id(standing_lamp_bedroom).state == "on";'
  2344.           then:
  2345.             - lvgl.button.update:
  2346.                 id: standing_lamp_bedroom_button
  2347.                 styles: actual_button_active
  2348.             - lvgl.label.update:
  2349.                 id: standing_lamp_bedroom_label_icon
  2350.                 styles: actual_button_label_icon_active
  2351.             - lvgl.label.update:
  2352.                 id: standing_lamp_bedroom_label_name
  2353.                 styles: actual_button_label_name_active
  2354.             - lvgl.label.update:
  2355.                 id: standing_lamp_bedroom_label_status
  2356.                 styles: actual_button_label_status_active
  2357.                 text: "BE"
  2358.           else:
  2359.             - lvgl.button.update:
  2360.                 id: standing_lamp_bedroom_button
  2361.                 styles: actual_button
  2362.             - lvgl.label.update:
  2363.                 id: standing_lamp_bedroom_label_icon
  2364.                 styles: actual_button_label_icon
  2365.             - lvgl.label.update:
  2366.                 id: standing_lamp_bedroom_label_name
  2367.                 styles: actual_button_label_name
  2368.             - lvgl.label.update:
  2369.                 id: standing_lamp_bedroom_label_status
  2370.                 styles: actual_button_label_status
  2371.                 text: "KI"
  2372.  
  2373.   - id: update_ceiling_lamp_livingroom_button
  2374.     then:
  2375.       - if:
  2376.           condition:
  2377.             lambda: 'return id(ceiling_lamp_livingroom).state == "on";'
  2378.           then:
  2379.             - lvgl.button.update:
  2380.                 id: ceiling_lamp_livingroom_button
  2381.                 styles: actual_button_active
  2382.             - lvgl.label.update:
  2383.                 id: ceiling_lamp_livingroom_label_icon
  2384.                 styles: actual_button_label_icon_active
  2385.             - lvgl.label.update:
  2386.                 id: ceiling_lamp_livingroom_label_name
  2387.                 styles: actual_button_label_name_active
  2388.             - lvgl.label.update:
  2389.                 id: ceiling_lamp_livingroom_label_status
  2390.                 styles: actual_button_label_status_active
  2391.                 text: "BE"
  2392.           else:
  2393.             - lvgl.button.update:
  2394.                 id: ceiling_lamp_livingroom_button
  2395.                 styles: actual_button
  2396.             - lvgl.label.update:
  2397.                 id: ceiling_lamp_livingroom_label_icon
  2398.                 styles: actual_button_label_icon
  2399.             - lvgl.label.update:
  2400.                 id: ceiling_lamp_livingroom_label_name
  2401.                 styles: actual_button_label_name
  2402.             - lvgl.label.update:
  2403.                 id: ceiling_lamp_livingroom_label_status
  2404.                 styles: actual_button_label_status
  2405.                 text: "KI"
  2406.  
  2407.   - id: update_ambient_livingroom_button
  2408.     then:
  2409.       - if:
  2410.           condition:
  2411.             lambda: 'return id(ambient_livingroom).state == "on";'
  2412.           then:
  2413.             - lvgl.button.update:
  2414.                 id: ambient_livingroom_button
  2415.                 styles: actual_button_active
  2416.             - lvgl.label.update:
  2417.                 id: ambient_livingroom_label_icon
  2418.                 styles: actual_button_label_icon_active
  2419.             - lvgl.label.update:
  2420.                 id: ambient_livingroom_label_name
  2421.                 styles: actual_button_label_name_active
  2422.             - lvgl.label.update:
  2423.                 id: ambient_livingroom_label_status
  2424.                 styles: actual_button_label_status_active
  2425.                 text: "BE"
  2426.           else:
  2427.             - lvgl.button.update:
  2428.                 id: ambient_livingroom_button
  2429.                 styles: actual_button
  2430.             - lvgl.label.update:
  2431.                 id: ambient_livingroom_label_icon
  2432.                 styles: actual_button_label_icon
  2433.             - lvgl.label.update:
  2434.                 id: ambient_livingroom_label_name
  2435.                 styles: actual_button_label_name
  2436.             - lvgl.label.update:
  2437.                 id: ambient_livingroom_label_status
  2438.                 styles: actual_button_label_status
  2439.                 text: "KI"
  2440.  
  2441.   - id: update_alarm_button
  2442.     then:
  2443.       - if:
  2444.           condition:
  2445.             lambda: 'return id(alarm_state).state == "disarmed";'
  2446.           then:
  2447.             - lvgl.button.update:
  2448.                 id: alarm_button
  2449.                 styles: status_row_button
  2450.                 border_color: green
  2451.             - lvgl.label.update:
  2452.                 id: alarm_label
  2453.                 text: "\U000F0CC8" # Ikon disarmed
  2454.                 styles: status_row_label
  2455.                 text_color: green
  2456.             - lvgl.widget.hide:
  2457.                 id: alarm_panel_popup
  2458.       - if:
  2459.           condition:
  2460.             lambda: 'return id(alarm_state).state == "arming";'
  2461.           then:
  2462.             - lvgl.button.update:
  2463.                 id: alarm_button
  2464.                 styles: status_row_button
  2465.                 border_color: yellow # Egyedi stílus az arming állapotra
  2466.             - lvgl.label.update:
  2467.                 id: alarm_label
  2468.                 text: "\U000F11A3" # Ikon arming
  2469.                 styles: status_row_label
  2470.                 text_color: yellow
  2471.       - if:
  2472.           condition:
  2473.             lambda: 'return id(alarm_state).state == "armed_away";'
  2474.           then:
  2475.             - lvgl.button.update:
  2476.                 id: alarm_button
  2477.                 styles: status_row_button
  2478.                 border_color: red
  2479.             - lvgl.label.update:
  2480.                 id: alarm_label
  2481.                 text: "\U000F0CCB" # Ikon armed_away
  2482.                 styles: status_row_label
  2483.                 text_color: red
  2484.       - if:
  2485.           condition:
  2486.             lambda: 'return id(alarm_state).state == "triggered";'
  2487.           then:
  2488.             - lvgl.button.update:
  2489.                 id: alarm_button
  2490.                 styles: status_row_button
  2491.                 border_color: orange # Egyedi stílus triggered állapotra
  2492.             - lvgl.label.update:
  2493.                 id: alarm_label
  2494.                 text: "\U000F0ECD" # Ikon triggered
  2495.                 styles: status_row_label
  2496.                 text_color: orange
  2497.             - lvgl.page.show:
  2498.                 id: alarm_page
  2499.  
  2500.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement