johannwilken

CYD ESPHOME

Mar 21st, 2026 (edited)
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 21.11 KB | Source Code | 0 0
  1. esphome:
  2.   name: esp32-cyd-server-rack
  3.   friendly_name: esp32-cyd-server-rack
  4.   on_boot:
  5.     priority: 800
  6.     then:
  7.       - delay: 3s
  8.       - lambda: |-
  9.           ESP_LOGI("boot", "Marking boot successful");      
  10. #      - wait_until:
  11. #          condition:
  12. #            lambda: 'return api_is_connected() && id(light_dining_room_counter_light).has_state();'
  13. #          timeout: 10s
  14.       - lvgl.resume
  15.       - script.execute: manage_run_and_sleep      
  16. esp32:
  17.   board: esp32dev
  18.   framework:
  19.     type: esp-idf
  20.  
  21. # Enable logging
  22. logger:
  23. # Enable Home Assistant API
  24. api:
  25.   encryption:
  26.     key: "oVIEa0xxsoCfE4LkZFewon/qtXRlcTeWRF1XkUrdTSU="
  27.   on_client_connected:
  28.     then:
  29.       - delay: 500ms
  30.       - if:
  31.           condition:
  32.             lambda: 'return id(light_dining_room_counter_light).has_state();'
  33.           then:
  34.             - lvgl.widget.update:
  35.                 id: w_mn01dnrvu1c6v
  36.                 state:
  37.                   checked: !lambda return id(light_dining_room_counter_light).state;
  38.       - if:                
  39.           condition:
  40.             lambda: 'return id(switch_multiplug).has_state();'
  41.           then:
  42.             - lvgl.widget.update:
  43.                 id: w_mn0b6u39ywr7b
  44.                 state:
  45.                   checked: !lambda return id(switch_multiplug).state;    
  46.       - if:                
  47.           condition:
  48.             lambda: 'return id(switch_jw_hp).has_state();'
  49.           then:
  50.             - lvgl.widget.update:
  51.                 id: w_mn0cb70a1o0zd
  52.                 state:
  53.                   checked: !lambda return id(switch_jw_hp).state;    
  54.       - if:                
  55.           condition:
  56.             lambda: 'return id(switch_ew_hp).has_state();'
  57.           then:
  58.             - lvgl.widget.update:
  59.                 id: w_mn0f1jw1d3hxa
  60.                 state:
  61.                   checked: !lambda return id(switch_ew_hp).state;                      
  62.  
  63. ota:
  64.   - platform: esphome
  65.     password: "dc6183133995a2cd0358e51bfd6e3922"
  66.  
  67. wifi:
  68.   ssid: !secret wifi_ssid
  69.   password: !secret wifi_password
  70.  
  71.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  72.   ap:
  73.     ssid: "Esp32-Cyd-Server-Rack"
  74.     password: "KBGU81QY2x6y"
  75.  
  76. web_server:
  77.   port: 80    
  78.  
  79. captive_portal:
  80. spi:
  81.   - id: lcd
  82.     clk_pin: GPIO14
  83.     mosi_pin: GPIO13
  84.     miso_pin: GPIO12
  85.   - id: touch
  86.     clk_pin: GPIO25
  87.     mosi_pin: GPIO32
  88.     miso_pin: GPIO39
  89.  
  90. i2c:
  91.   sda: GPIO27
  92.   scl: GPIO22
  93.   scan: true
  94.   id: i2c_bus_a
  95.  
  96. display:
  97.   - platform: ili9xxx
  98.     model: ili9341
  99.     spi_id: lcd
  100.     dc_pin: GPIO2
  101.     cs_pin: GPIO15
  102.     id: display_1
  103.     invert_colors: false    
  104.     update_interval: 16ms   # ~60 FPS (smooth)
  105.     auto_clear_enabled: false
  106.     show_test_card: false
  107.     dimensions:
  108.       width: 320
  109.       height: 240
  110.     transform:
  111.       swap_xy: true
  112.       mirror_x: false
  113.       mirror_y: false
  114.  
  115. touchscreen:
  116.   platform: xpt2046
  117.   spi_id: touch
  118.   cs_pin: GPIO33
  119.   interrupt_pin: GPIO36
  120.   update_interval: 50ms
  121.   id: touchscreen_1
  122.   # report_interval: 1s
  123.   threshold: 400
  124.   calibration:
  125.     x_min: 294
  126.     x_max: 3796
  127.     y_min: 200
  128.     y_max: 3700
  129.   transform:
  130.     swap_xy: true
  131.     mirror_x: false
  132.     mirror_y: false  
  133.   on_touch:
  134.     then:
  135.       - script.execute: wake_screen      
  136. #  on_touch:
  137. #    - lambda: |-
  138. #          ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
  139. #              touch.x,
  140. #              touch.y,
  141. #              touch.x_raw,
  142. #              touch.y_raw
  143. #              );
  144.   on_release:
  145.     - if:
  146.         condition: lvgl.is_paused
  147.         then:
  148.           - lvgl.resume:
  149.           - light.turn_on: display_backlight
  150.  
  151. # Define pins for backlight display and rear LED
  152. output:
  153.   - platform: ledc
  154.     pin: 21
  155.     id: gpio_backlight_pwm
  156.   - id: output_red
  157.     platform: ledc
  158.     pin: 4
  159.     inverted: true
  160.   - id: output_green
  161.     platform: ledc
  162.     pin: 16
  163.     inverted: true
  164.   - id: output_blue
  165.     platform: ledc
  166.     pin: 17
  167.     inverted: true
  168.  
  169. light:
  170.   - platform: monochromatic
  171.     output: gpio_backlight_pwm
  172.     name: Display Backlight
  173.     icon: mdi:lightbulb-on
  174.     id: display_backlight
  175.     restore_mode: ALWAYS_ON
  176.     on_turn_on:
  177.       - delay: 3s   # give LVGL time to be ready
  178.   - platform: rgb
  179.     id: rgb_led
  180.     name: RGB LED
  181.     red: output_red
  182.     green: output_green
  183.     blue: output_blue
  184.     restore_mode: ALWAYS_OFF
  185.  
  186. globals:
  187.   - id: display_page
  188.     type: int
  189.     restore_value: true
  190.     initial_value: '0'
  191.   - id: page_refresh_default_s
  192.     type: int
  193.     restore_value: true
  194.     initial_value: '600'
  195.   - id: page_refresh_current_s
  196.     type: int
  197.     restore_value: false
  198.     initial_value: '60'
  199.   - id: last_page_switch_time
  200.     type: uint32_t
  201.     restore_value: false
  202.     initial_value: '0'
  203.  
  204. time:
  205.   - platform: homeassistant
  206.     id: ha_time
  207.     on_time:
  208.       - seconds: 0
  209.         then:
  210.           - lvgl.label.update:
  211.               id: w_mmyk1aw5azz82
  212.               text: !lambda |-
  213.                 auto now = id(ha_time).now();
  214.                 return now.strftime("%H:%M\n%a, %b %d").c_str();
  215.  
  216. sensor:
  217.   - platform: homeassistant
  218.     id: sensor_server_rack_temperature
  219.     entity_id: sensor.server_rack_temperature
  220.     on_value:
  221.       then:
  222.         - lvgl.widget.refresh: temp_icon
  223.         - lvgl.widget.refresh: temp_text        
  224.     internal: true
  225.  
  226. binary_sensor:
  227.   - platform: homeassistant
  228.     id: light_dining_room_counter_light
  229.     entity_id: light.dining_room_counter_light
  230.     on_state:
  231.       then:
  232.         - lvgl.widget.update:
  233.             id: w_mn01dnrvu1c6v
  234.             state:
  235.               checked: !lambda return id(light_dining_room_counter_light).state;
  236.     internal: true
  237.   - platform: homeassistant
  238.     id: switch_multiplug
  239.     entity_id: switch.multiplug
  240.     on_state:
  241.       then:
  242.         - lvgl.widget.update:
  243.             id: w_mn0b6u39ywr7b
  244.             state:
  245.               checked: !lambda return id(switch_multiplug).state;
  246.     internal: true
  247.   - platform: homeassistant
  248.     id: switch_jw_hp
  249.     entity_id: switch.jw_hp
  250.     on_state:
  251.       then:
  252.         - lvgl.widget.update:
  253.             id: w_mn0cb70a1o0zd
  254.             state:
  255.               checked: !lambda return id(switch_jw_hp).state;
  256.     internal: true    
  257.   - platform: homeassistant
  258.     id: switch_ew_hp
  259.     entity_id: switch.ew_hp
  260.     on_state:
  261.       then:
  262.         - lvgl.widget.update:
  263.             id: w_mn0f1jw1d3hxa
  264.             state:
  265.               checked: !lambda return id(switch_ew_hp).state;
  266.     internal: true    
  267.  
  268.   - platform: homeassistant
  269.     id: switch_wilkencloud01
  270.     entity_id: switch.wilkencloud01
  271.     on_state:
  272.       then:
  273.         - lvgl.widget.update:
  274.             id: w_mn1ibftg5zi7r
  275.             state:
  276.               checked: !lambda return id(switch_wilkencloud01).state;
  277.     internal: true
  278.  
  279.   - platform: homeassistant
  280.     id: switch_wilkencloud02
  281.     entity_id: switch.wilkencloud02
  282.     on_state:
  283.       then:
  284.         - lvgl.widget.update:
  285.             id: w_mn1ibftg206a7
  286.             state:
  287.               checked: !lambda return id(switch_wilkencloud02).state;
  288.     internal: true
  289.  
  290.   - platform: gpio
  291.     pin: GPIO35
  292.     name: "Server Rack Motion"
  293.     device_class: motion  
  294.    
  295. font:
  296.   - file:
  297.       type: gfonts
  298.       family: "Roboto"
  299.       weight: 700
  300.       italic: false
  301.     id: font_roboto_700_12
  302.     size: 12
  303.     glyphsets: [GF_Latin_Kernel]
  304.     ignore_missing_glyphs: true
  305.   - file:
  306.       type: gfonts
  307.       family: "Roboto"
  308.       weight: 400
  309.       italic: false
  310.     id: font_roboto_400_8
  311.     size: 8
  312.     glyphsets: [GF_Latin_Kernel]
  313.     ignore_missing_glyphs: true
  314.   - file:
  315.       type: gfonts
  316.       family: "Roboto"
  317.       weight: 400
  318.       italic: false
  319.     id: font_roboto_400_20
  320.     size: 20
  321.     glyphsets: [GF_Latin_Kernel]
  322.     ignore_missing_glyphs: true
  323.   - file: "fonts/materialdesignicons-webfont.ttf"
  324.     id: font_material_design_icons_400_10
  325.     size: 10
  326.     glyphs: ["\U000F050F", "\U000F0E4C", "\U000F10C2"]
  327.   - file:
  328.       type: gfonts
  329.       family: "Roboto"
  330.       weight: 400
  331.       italic: false
  332.     id: font_roboto_400_15
  333.     size: 15
  334.     glyphsets: [GF_Latin_Kernel]
  335.     ignore_missing_glyphs: true
  336.   - file:
  337.       type: gfonts
  338.       family: "Roboto"
  339.       weight: 400
  340.       italic: false
  341.     id: font_roboto_400_10
  342.     size: 10
  343.     glyphsets: [GF_Latin_Kernel]
  344.     ignore_missing_glyphs: true
  345.  
  346. lvgl:
  347.   id: my_lvgl
  348.   log_level: WARN
  349.   bg_color: "0x000000"
  350.   displays:
  351.    - display_1
  352.   pages:
  353.     - id: page_0
  354.       on_load:
  355.         then:
  356.           - delay: 2s  # give LVGL time to render
  357. #          - script.execute: sync_ui  
  358.       widgets:
  359.        # Background container (decorative, non-blocking)
  360.         - obj:
  361.             id: w_mmxla1ug3vlfe
  362.             x: 0
  363.             y: 2
  364.             width: 319
  365.             height: 237
  366.             bg_color: "0x000000"   # keep black background
  367.             bg_opa: 0           # fully opaque so LVGL renders it
  368.             border_color: "0xFFFFFF"
  369.             border_width: 3
  370.             radius: 20
  371.             clickable: false
  372.             scrollable: false      # ensure it doesn’t try to catch touches
  373.         # WORKING SWITCH — direct child of page
  374.         - switch:
  375.             id: w_mn01dnrvu1c6v
  376.             bg_color: "gray"
  377.             height: 27
  378.             ignore_layout: true
  379.             indicator:
  380.               bg_color: "blue"
  381.             knob:
  382.               bg_color: "white"
  383.             on_value:
  384.              -
  385.                 homeassistant.service:
  386.                   data:
  387.                     entity_id: light.dining_room_counter_light
  388.                   service: homeassistant.toggle
  389.             opa: cover
  390.             scrollable: false
  391.             state:
  392.               checked: !lambda return id(light_dining_room_counter_light).state;
  393.             width: 51
  394.             x: 40
  395.             y: 94
  396.         # Temperature display (icon + text)
  397.         - obj:
  398.             id: temp_container
  399.             x: 245
  400.             y: 8
  401.             width: 64
  402.             height: 69
  403.             bg_opa: transp
  404.             border_width: 0
  405.             clickable: false
  406.             widgets:
  407.               - label:
  408.                   id: temp_icon
  409.                   height: 14
  410.                   width: 20
  411.                   align: top_mid
  412.                   clickable: false
  413.                   text_color: "0xFFFFFF"
  414.                   text_font: font_material_design_icons_400_10
  415.                   text: !lambda |-
  416.                     if (id(sensor_server_rack_temperature).has_state()) {
  417.                       float t = id(sensor_server_rack_temperature).state;
  418.                       if (t <= 10) return "\U000F0E4C";
  419.                       if (t <= 25) return "\U000F050F";
  420.                       return "\U000F10C2";
  421.                     }
  422.                     return "\U000F050F";
  423.               - label:
  424.                   id: temp_text
  425.                   height: 16
  426.                   width: 100%
  427.                   y: 12
  428.                   text_align: center
  429.                   clickable: false
  430.                   text_color: "0xFFFFFF"
  431.                   text_font: font_roboto_400_10
  432.                   text: !lambda |-
  433.                     if (id(sensor_server_rack_temperature).has_state()) {
  434.                       return str_sprintf("%.1f°C", id(sensor_server_rack_temperature).state).c_str();
  435.                     }
  436.                     return "--°C";
  437.  
  438.         # Clock label
  439.         - label:
  440.             id: w_mmyk1aw5azz82
  441.             x: 23
  442.             y: 15
  443.             width: 61
  444.             height: 37
  445.             text_align: center
  446.             text_color: "0xFFFFFF"
  447.             text_font: font_roboto_700_12
  448.             clickable: false
  449.             text: !lambda |-
  450.               auto now = id(ha_time).now();
  451.               return now.strftime("%H:%M\n%a, %b %d").c_str();
  452.  
  453.         # Server Rack label
  454.         - label:
  455.             id: w_mmyjzi4xmr8z9
  456.             x: 107
  457.             y: 28
  458.             width: 120
  459.             height: 40
  460.             text_align: left
  461.             text_color: "0xFFFFFF"
  462.             text_font: font_roboto_400_20
  463.             clickable: false
  464.             text: "Server Rack"
  465.  
  466.         # Decorative line under header
  467.         - line:
  468.             id: w_mmyjx2wpcpl8r
  469.             x: 41
  470.             y: 59
  471.             width: 240
  472.             height: 3
  473.             line_color: "0xFFFFFF"
  474.             line_width: 3
  475.             line_rounded: true
  476.             opa: cover
  477.             clickable: false
  478.             points:
  479.               - x: 0
  480.                 y: 0
  481.               - x: 240
  482.                 y: 0
  483.  
  484.         # DR Light Switch Label
  485.         - label:
  486.             id: w_mn0b0hyvltn7m
  487.             border_color: "black"
  488.             border_side: none
  489.             border_width: 0
  490.             height: 22
  491.             opa: cover
  492.             radius: 0
  493.             text: "Light"
  494.             text_align: left
  495.             text_color: "0xFFFFFF"
  496.             text_font: font_roboto_400_15
  497.             width: 39
  498.             x: 40
  499.             y: 72
  500.         - label:
  501.             id: w_mn0b6u392gaj8
  502.             border_color: "black"
  503.             border_side: none
  504.             border_width: 0
  505.             height: 22
  506.             opa: cover
  507.             radius: 0
  508.             text: "Fans"
  509.             text_align: left
  510.             text_color: "0xFFFFFF"
  511.             text_font: font_roboto_400_15
  512.             width: 65
  513.             x: 40
  514.             y: 129
  515.         - switch:
  516.             id: w_mn0b6u39ywr7b
  517.             bg_color: "gray"
  518.             height: 27
  519.             ignore_layout: true
  520.             indicator:
  521.               bg_color: "blue"
  522.             knob:
  523.               bg_color: "white"
  524.             on_value:
  525.              -
  526.                 homeassistant.service:
  527.                   data:
  528.                     entity_id: switch.multiplug
  529.                   service: homeassistant.toggle
  530.             opa: cover
  531.             scrollable: false
  532.             state:
  533.               checked: !lambda return id(switch_multiplug).state;
  534.             width: 51
  535.             x: 40
  536.             y: 150
  537.         - label:
  538.             id: w_mn0cb70axj09e
  539.             border_color: "black"
  540.             border_side: none
  541.             border_width: 0
  542.             height: 22
  543.             opa: cover
  544.             radius: 0
  545.             text: "JW-HP"
  546.             text_align: left
  547.             text_color: "0xFFFFFF"
  548.             text_font: font_roboto_400_15
  549.             width: 50
  550.             x: 137
  551.             y: 72
  552.         - switch:
  553.             id: w_mn0cb70a1o0zd
  554.             bg_color: "gray"
  555.             height: 27
  556.             ignore_layout: true
  557.             indicator:
  558.               bg_color: "blue"
  559.             knob:
  560.               bg_color: "white"
  561.             on_value:
  562.              -
  563.                 homeassistant.service:
  564.                   data:
  565.                     entity_id: switch.jw_hp
  566.                   service: homeassistant.toggle
  567.             opa: cover
  568.             scrollable: false
  569.             state:
  570.               checked: !lambda return id(switch_jw_hp).state;
  571.             width: 51
  572.             x: 136
  573.             y: 94
  574.         - switch:
  575.             id: w_mn0f1jw1d3hxa
  576.             bg_color: "gray"
  577.             height: 27
  578.             ignore_layout: true
  579.             indicator:
  580.               bg_color: "blue"
  581.             knob:
  582.               bg_color: "white"
  583.             on_value:
  584.              -
  585.                 homeassistant.service:
  586.                   data:
  587.                     entity_id: switch.ew_hp
  588.                   service: homeassistant.toggle
  589.             opa: cover
  590.             scrollable: false
  591.             state:
  592.               checked: !lambda return id(switch_ew_hp).state;
  593.             width: 51
  594.             x: 137
  595.             y: 150
  596.         - label:
  597.             id: w_mn0f1jw1xfgy0
  598.             border_color: "black"
  599.             border_side: none
  600.             border_width: 0
  601.             height: 22
  602.             opa: cover
  603.             radius: 0
  604.             text: "EW-HP"
  605.             text_align: left
  606.             text_color: "0xFFFFFF"
  607.             text_font: font_roboto_400_15
  608.             width: 50
  609.             x: 137
  610.             y: 128
  611.         - label:
  612.             id: w_mn1ibftgoer2x
  613.             border_color: "black"
  614.             border_side: none
  615.             border_width: 0
  616.             height: 22
  617.             opa: cover
  618.             radius: 0
  619.             text: "Cloud01"
  620.             text_align: left
  621.             text_color: "0xFFFFFF"
  622.             text_font: font_roboto_400_15
  623.             width: 70
  624.             x: 230
  625.             y: 72
  626.         - switch:
  627.             id: w_mn1ibftg5zi7r
  628.             bg_color: "gray"
  629.             height: 27
  630.             ignore_layout: true
  631.             indicator:
  632.               bg_color: "blue"
  633.             knob:
  634.               bg_color: "white"
  635.             on_value:
  636.              -
  637.                 homeassistant.service:
  638.                   data:
  639.                     entity_id: switch.wilkencloud01
  640.                   service: homeassistant.toggle
  641.             opa: cover
  642.             scrollable: false
  643.             state:
  644.               checked: !lambda return id(switch_wilkencloud01).state;
  645.             width: 51
  646.             x: 229
  647.             y: 94
  648.  
  649.         - label:
  650.             id: w_mn1ibftgb47cy
  651.             border_color: "black"
  652.             border_side: none
  653.             border_width: 0
  654.             height: 22
  655.             opa: cover
  656.             radius: 0
  657.             text: "Cloud02"
  658.             text_align: left
  659.             text_color: "0xFFFFFF"
  660.             text_font: font_roboto_400_15
  661.             width: 70
  662.             x: 230
  663.             y: 128
  664.         - switch:
  665.             id: w_mn1ibftg206a7
  666.             bg_color: "gray"
  667.             height: 27
  668.             ignore_layout: true
  669.             indicator:
  670.               bg_color: "blue"
  671.             knob:
  672.               bg_color: "white"
  673.             on_value:
  674.              -
  675.                 homeassistant.service:
  676.                   data:
  677.                     entity_id: switch.wilkencloud02
  678.                   service: homeassistant.toggle
  679.             opa: cover
  680.             scrollable: false
  681.             state:
  682.               checked: !lambda return id(switch_wilkencloud02).state;
  683.             width: 51
  684.             x: 230
  685.             y: 150
  686.            
  687. script:
  688.   - id: manage_run_and_sleep
  689.     mode: restart
  690.     then:
  691.       - logger.log: "Waiting for sync..."
  692.       - delay: 5s
  693.       - lambda: |-
  694.           int interval = id(page_refresh_default_s);
  695.           id(page_refresh_current_s) = interval;
  696.       - component.update: display_1
  697.       - delay: 300ms
  698.       - script.execute: sync_ui_dr_counter_light
  699.       - script.execute: sync_ui_sr_fans  
  700.       - script.execute: sync_ui_switch_jw_hp  
  701.       - script.execute: sync_ui_switch_ew_hp
  702.       - script.execute: sync_ui_switch_wilkencloud01
  703.       - script.execute: sync_ui_switch_wilkencloud02
  704.       - script.execute: dim_screen  
  705.       - delay: !lambda 'return id(page_refresh_current_s) * 1000;'
  706.       - script.execute: manage_run_and_sleep
  707.  
  708.   - id: sync_ui_dr_counter_light
  709.     then:
  710.       - lvgl.widget.update:
  711.           id: w_mn01dnrvu1c6v
  712.           state:
  713.             checked: !lambda return id(light_dining_room_counter_light).state;
  714.  
  715.       # force visual refresh (important!)
  716.       - lvgl.widget.redraw: w_mn01dnrvu1c6v
  717.  
  718.   - id: sync_ui_sr_fans
  719.     then:
  720.       - lvgl.widget.update:
  721.           id: w_mn0b6u39ywr7b
  722.           state:
  723.             checked: !lambda return id(switch_multiplug).state;
  724.  
  725.       # force visual refresh (important!)
  726.       - lvgl.widget.redraw: w_mn0b6u39ywr7b
  727.  
  728.   - id: sync_ui_switch_jw_hp
  729.     then:
  730.       - lvgl.widget.update:
  731.           id: w_mn0cb70a1o0zd
  732.           state:
  733.             checked: !lambda return id(switch_jw_hp).state;
  734.  
  735.       # force visual refresh (important!)
  736.       - lvgl.widget.redraw: w_mn0cb70a1o0zd
  737.  
  738.   - id: sync_ui_switch_ew_hp
  739.     then:
  740.       - lvgl.widget.update:
  741.           id: w_mn0f1jw1d3hxa
  742.           state:
  743.             checked: !lambda return id(switch_ew_hp).state;
  744.  
  745.       # force visual refresh (important!)
  746.       - lvgl.widget.redraw: w_mn0f1jw1d3hxa
  747.  
  748.   - id: sync_ui_switch_wilkencloud01
  749.     then:
  750.       - lvgl.widget.update:
  751.           id: w_mn1ibftg5zi7r
  752.           state:
  753.             checked: !lambda return id(switch_wilkencloud01).state;
  754.  
  755.       # force visual refresh (important!)
  756.       - lvgl.widget.redraw: w_mn1ibftg5zi7r
  757.  
  758.   - id: sync_ui_switch_wilkencloud02
  759.     then:
  760.       - lvgl.widget.update:
  761.           id: w_mn1ibftg206a7
  762.           state:
  763.             checked: !lambda return id(switch_wilkencloud02).state;
  764.  
  765.       # force visual refresh (important!)
  766.       - lvgl.widget.redraw: w_mn1ibftg206a7      
  767.  
  768.   - id: wake_screen
  769.     mode: restart
  770.     then:
  771.       - light.turn_on:
  772.           id: display_backlight
  773.           brightness: 100%
  774.           transition_length: 0s
  775.       - script.execute: dim_screen
  776.  
  777.   - id: dim_screen
  778.     mode: restart
  779.     then:
  780.       - delay: 15s
  781.       - light.turn_on:
  782.           id: display_backlight
  783.           brightness: 40% # Dimmed level
  784.           transition_length: 5s
  785. switch:
  786.   - platform: restart
  787.     name: "ESP32-2432S028 Display Restart"      
Tags: CYD
Advertisement
Add Comment
Please, Sign In to add comment