############################################################ # CYD Base – Hardware layer # ESP32-2432S028 (Cheap Yellow Display) # Include via: packages: !include cyd-base-hw.yaml ############################################################ time: - platform: homeassistant id: homeassistant_time on_time: - seconds: 0 minutes: /1 then: - script.execute: ui_refresh globals: - id: active_entity type: std::string restore_value: no - id: active_control_kind type: std::string restore_value: no - id: active_value_suffix type: std::string restore_value: no - id: overlay_slider_bg_color type: uint32_t restore_value: no initial_value: '0x939391' - id: overlay_slider_fill_color type: uint32_t restore_value: no initial_value: '0xFEC600' font: - file: "gfonts://Roboto@500" id: time_label size: 18 bpp: 4 glyphs: ['0','1','2','3','4','5','6','7','8','9',':',' ','A','M','P'] - file: "gfonts://Roboto@500" id: headline size: 18 bpp: 4 glyphs: ['&','@','!',',','.','?','"','%','(',')','+','-','_',':','°', '0','1','2','3','4','5','6','7','8','9', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', ' ','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'ä','ö','ü','Ä','Ö','Ü','ß','/'] - file: "gfonts://Roboto@700" id: label size: 11 bpp: 4 glyphs: ['&','@','!',',','.','?','"','%','(',')','+','-','_',':','°', '0','1','2','3','4','5','6','7','8','9', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', ' ','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'ä','ö','ü','Ä','Ö','Ü','ß','/'] - file: "gfonts://Roboto@400" id: sublabel size: 11 bpp: 4 glyphs: ['&','@','!',',','.','?','"','%','(',')','+','-','_',':','°', '0','1','2','3','4','5','6','7','8','9', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', ' ','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'ä','ö','ü','Ä','Ö','Ü','ß','/','…'] - file: "gfonts://Roboto@400" id: sublabel_big size: 14 bpp: 4 glyphs: ['&','@','!',',','.','?','"','%','(',')','+','-','_',':','°', '0','1','2','3','4','5','6','7','8','9', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', ' ','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'ä','ö','ü','Ä','Ö','Ü','ß','/','…'] - file: 'fonts/materialdesignicons-webfont.ttf' id: materialdesign_icons size: 28 glyphs: - "${TILE1_ICON}" - "${TILE2_ICON}" - "${TILE3_ICON}" - "${TILE4_ICON}" - "${TILE5_ICON}" - "${TILE6_ICON}" image: - file: "images/home-background.png" id: bg_home type: RGB24 sensor: - platform: wifi_signal name: "Wifi Signal" update_interval: 600s - platform: uptime name: "Uptime" id: uptime_s update_interval: 15s - platform: homeassistant id: tile1_brightness entity_id: ${TILE1_ENTITY} attribute: brightness on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile1_percentage entity_id: ${TILE1_ENTITY} attribute: percentage on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile2_brightness entity_id: ${TILE2_ENTITY} attribute: brightness on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile2_percentage entity_id: ${TILE2_ENTITY} attribute: percentage on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile3_brightness entity_id: ${TILE3_ENTITY} attribute: brightness on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile3_percentage entity_id: ${TILE3_ENTITY} attribute: percentage on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile4_brightness entity_id: ${TILE4_ENTITY} attribute: brightness on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile4_percentage entity_id: ${TILE4_ENTITY} attribute: percentage on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile5_brightness entity_id: ${TILE5_ENTITY} attribute: brightness on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile5_percentage entity_id: ${TILE5_ENTITY} attribute: percentage on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile6_brightness entity_id: ${TILE6_ENTITY} attribute: brightness on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile6_percentage entity_id: ${TILE6_ENTITY} attribute: percentage on_value: { then: [ script.execute: ui_refresh ] } binary_sensor: - platform: status name: "Node Status" id: system_status - platform: homeassistant id: ha_state_tile1 entity_id: ${TILE1_STATE_ENTITY} on_state: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: ha_state_tile2 entity_id: ${TILE2_STATE_ENTITY} on_state: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: ha_state_tile3 entity_id: ${TILE3_STATE_ENTITY} on_state: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: ha_state_tile4 entity_id: ${TILE4_STATE_ENTITY} on_state: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: ha_state_tile5 entity_id: ${TILE5_STATE_ENTITY} on_state: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: ha_state_tile6 entity_id: ${TILE6_STATE_ENTITY} on_state: { then: [ script.execute: ui_refresh ] } text_sensor: - platform: template id: smartdisplay_action name: "${ROOM_NAME} Action" icon: mdi:gesture-tap-button - platform: homeassistant id: tile1_preset entity_id: ${TILE1_ENTITY} attribute: preset_mode on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile2_preset entity_id: ${TILE2_ENTITY} attribute: preset_mode on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile3_preset entity_id: ${TILE3_ENTITY} attribute: preset_mode on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile4_preset entity_id: ${TILE4_ENTITY} attribute: preset_mode on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile5_preset entity_id: ${TILE5_ENTITY} attribute: preset_mode on_value: { then: [ script.execute: ui_refresh ] } - platform: homeassistant id: tile6_preset entity_id: ${TILE6_ENTITY} attribute: preset_mode on_value: { then: [ script.execute: ui_refresh ] } switch: - platform: restart name: "Restart" spi: - id: lcd clk_pin: GPIO14 mosi_pin: GPIO13 miso_pin: GPIO12 - id: my_touchscreen clk_pin: GPIO25 mosi_pin: GPIO32 miso_pin: GPIO39 output: - platform: ledc pin: GPIO21 id: gpio_backlight_pwm - platform: ledc id: output_red pin: GPIO4 inverted: true - platform: ledc id: output_green pin: GPIO16 inverted: true - platform: ledc id: output_blue pin: GPIO17 inverted: true light: - platform: monochromatic output: gpio_backlight_pwm name: "Power Display Backlight" id: back_light restore_mode: ALWAYS_ON - platform: rgb name: LED red: output_red id: led green: output_green blue: output_blue restore_mode: ALWAYS_OFF touchscreen: platform: xpt2046 id: ts_touch spi_id: my_touchscreen cs_pin: 33 interrupt_pin: 36 update_interval: 20ms threshold: 300 calibration: x_min: 280 x_max: 3860 y_min: 340 y_max: 3860 transform: swap_xy: true mirror_x: true mirror_y: true display: - platform: ili9xxx id: my_display spi_id: lcd model: ILI9341 cs_pin: 15 dc_pin: 2 invert_colors: false update_interval: never auto_clear_enabled: false transform: swap_xy: false mirror_x: true mirror_y: false dimensions: width: 320 height: 240