How to add *.h File for proper build or alternative solution

Hello,

I am trying to add OSC capabilities to one of my ESPHome devices.

I keep receiving this error:

Dependency Graph
|-- lvgl @ 8.4.0
|-- noise-c @ 0.1.10
Compiling .pioenvs/esp-screen-system/src/main.cpp.o
Compiling .pioenvs/esp-screen-system/lib69a/lvgl/core/lv_disp.o
Compiling .pioenvs/esp-screen-system/lib69a/lvgl/core/lv_event.o
Compiling .pioenvs/esp-screen-system/lib69a/lvgl/core/lv_group.o
Compiling .pioenvs/esp-screen-system/lib69a/lvgl/core/lv_indev.o
Compiling .pioenvs/esp-screen-system/lib69a/lvgl/core/lv_indev_scroll.o
Compiling .pioenvs/esp-screen-system/lib69a/lvgl/core/lv_obj.o
src/main.cpp:4:10: fatal error: ArduinoOSC.h: No such file or directory

**************************************************************************
* Looking for ArduinoOSC.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ArduinoOSC.h"
* Web  > https://registry.platformio.org/search?q=header:%1B%5Bm%1B%5BKArduinoOSC.h
*
**************************************************************************

    4 | #include <ArduinoOSC.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/esp-screen-system/src/main.cpp.o] Error 1
========================= [FAILED] Took 21.12 seconds =========================

I have the ArduinoOSC Library being installed.
Code:

esphome:
  name: esp-screen-system
  friendly_name: ESP Screen System
  
  libraries:
    - "hideakitai/ArduinoOSC@^0.6.0"

  includes:
    - <ArduinoOSC.h>

I have also placed the ArduinoOSC.h file in all the possible places I could think for it to need access. The main spot being the /config/esphome root folder.
Useage:

  - platform: template
    name: "redchase"
    icon: "mdi:lightbulb-on"
    id: redchase_toggle
    on_press:
      - lambda: |-
          #include <ArduinoOSC.h>
          const char* host = "10.1.1.3";
          const int port = 7700;
          OscWiFi.send(host, port, "/3/toggle8", 1);

What is it i’m missing?

I am not a major programmer, but I know my way around. I have a number of esphome nodes doing various sensors around the house. I have also made osc work on a rpi fairly easily. Any help would be appreciated!!!

Tried this?

esphome:
  includes:
    - ArduinoOSC.h

I did. I feel like I tried every combination of including the file. I had some luck switching over to the OSC library and adding wifinina library, but now I’ve run into a whole other issue.

I am very much at a loss and would gladly start over if anyone has any clue how to get OSC running on ESPHome

OSC communications · Issue #942 · esphome/feature-requests · GitHub is the request for what you want, but it appears no one has done it yet.

Using external libraries can be tricky as can creating external components that use them.

Look here:

Pay close attention to this section:

You can always look at the generated PlatformIO project (.esphome/build/ ) to see what is happening - and if you want you can even copy the include files directly into the src/ folder. The includes option is only a helper option that does that for you.

The compile error indicates things are not where they should be, so you don’t have the right magic yet. Look at the generated project code to see what it is doing and what is missing.

Sorry, let me elaborate. Your includes syntax is wrong (it should be a list of files, not C syntax), and you also don’t need the #include <ArduinoOSC.h> (because ESPHome automatically adds that once you do include).

With an ESPHome directory that looks like this (I just copypasted these files from the repo):

$ ls | grep -E 'esp32.yaml|OSC.+'
ArduinoOSC.h
ArduinoOSCWiFi.h
esp32.yaml
esphome:
  includes:
    - ArduinoOSC.h
    - ArduinoOSCWiFi.h

button:
  - platform: template
    id: my_test
    on_press:
      - lambda: !lambda |-
          const char* host = "10.1.1.3";
          const int port = 7700;
          OscWiFi.send(host, port, "/3/toggle8", 1);

I only got this far though:

Reading CMake configuration...
Dependency Graph
|-- noise-c @ 0.1.10
Compiling .pioenvs/esp32/src/main.cpp.o
In file included from src/ArduinoOSC.h:4,
                 from src/main.cpp:441:
src/ArduinoOSCWiFi.h:14:10: fatal error: WiFi.h: No such file or directory

********************************************************************
* Looking for WiFi.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WiFi.h"
* Web  > https://registry.platformio.org/search?q=header:%1B%5Bm%1B%5BKWiFi.h
*
********************************************************************

   14 | #include <WiFi.h>
      |          ^~~~~~~~
compilation terminated.
*** [.pioenvs/esp32/src/main.cpp.o] Error 1
========================= [FAILED] Took 47.63 seconds =========================

I think there’s instructions for adding the Arduino core libraries in the ESPHome documentation. Not sure how this works with ESPHome also using Wi-Fi though :thinking:

1 Like

Omg you just blew my mind, and I feel this will be exactly the solution I need. I will mess around with it after work tomorrow and report back. Thank you!!

Sorry I briefly glanced. Where should this code be placed?

$ ls | grep -E 'esp32.yaml|OSC.+'
ArduinoOSC.h
ArduinoOSCWiFi.h
esp32.yaml

This is not code, I was just trying to demonstrate where I had placed the files (all in the esphome directory where your device YAMLs are).

Oh, I kind of follow that. As if I were using terminal to navigate files. So if you don’t mind, I am using a home assistant file explorer app, where should I place those files if browsing through a smb:// connection?

I don’t know, it depends on how your ESPHome server is set up. Where ever you find your device YAML files.

I really truly appreciate your patience. I think I’m on to something here. I’m going to flash now and mess around, and I’ll post the results tomorrow. This is a really awesome community, and I look forward to growing with it!

Edit* I should mention, I’m on a RPI 4 HA build. Not that I think that matters, but maybe?

Here is the latest results :frowning:

Build Error

Compiling .pioenvs/esp-screen-system/src/main.cpp.o
In file included from src/WiFiNINA.h:23,
                 from src/BetterWiFiNINA.h:23,
                 from src/main.cpp:219:
src/WiFi.h:30:18: fatal error: utility/wl_definitions.h: No such file or directory
   30 |         #include "utility/wl_definitions.h"
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/esp-screen-system/src/main.cpp.o] Error 1
========================= [FAILED] Took 207.72 seconds =========================

YAML

esphome:
  name: esp-screen-system
  friendly_name: ESP Screen System
  #libraries:
    #- OSC
    #- gershnik/BetterWiFiNINA@^1.3.0
    #- file:///config/ArduinoOSC-main/library.json
    #- cnmat/OSC@^1.0.0
    #- "hideakitai/ArduinoOSC@^0.6.0"
    #- file:///ArduinoOSC-main/ArduinoOSC
  includes:
    - src/BetterWiFiNINA.h
    #- src/WiFiNINA.h
    #- src/WiFi.h
    #- src/utility/wl_definitions.h
    #- <WiFiUdp.h>
    #- <OSCMessage.h>
    - osc/ArduinoOSC.h
    - osc/ArduinoOSCWiFi.h
    #- <WiFi.h>
    #- "<ArduinoOSC.h>"
    #- <ArduinoOSCWiFi.h>
    #- test.h
esp32:
  board: esp32dev
  framework:
    type: esp-idf

YAML

  - platform: template
    name: "redchase"
    icon: "mdi:lightbulb-on"
    id: redchase_toggle
    on_press:
      - lambda: !lambda |-
          const char* host = "10.1.1.3";
          const int port = 7700;
          OscWiFi.send(host, port, "/3/toggle8", 1);

YAML

              - button:
                  id: redchase_btn
                  width: 70
                  height: 68
                  checkable: false
                    #state:
                    #  checked: true # here you activate the state to be used at boot
                 # checked:
                 #   bg_color: 0x00FF00
                  widgets:
                    - label:
                        align: CENTER
                        width: 70
                        text: "redchase\nToggle"
                        text_align: CENTER
                        long_mode: wrap
                        id: redchase_icon
                  on_click:
                    - button.press: redchase_toggle

can you direct me as to how to find the path?

“You can always look at the generated PlatformIO project (.esphome/build/ )”

is that somrething I need to ssh into my rpi ha system for? Or something I can access through a file manager app? I can’t seem to find that hidden folder with the access I currently have. Nor can I find the answer as to where I modify those files.

This is one of the more fun puzzles I have yet to solve :slight_smile:

Your includes syntax is wrong (it should be a list of files, not C syntax)

Forgive me, this was not true - not sure why I assumed this off the top of my head. This compiles:

esphome:
  libraries:
    - "arduino-libraries/[email protected]"
    - "SPI"
    - "hideakitai/ArduinoOSC@^0.6.0"
  includes:
    - <ArduinoOSCWiFi.h>

button:
  - platform: template
    id: my_test
    on_press:
      - lambda: !lambda |-
          const char* host = "10.1.1.3";
          const int port = 7700;
          OscWiFi.send(host, port, "/3/toggle8", 1);

I don’t actually know what it does though, so you’ll have to test if it works in runtime.

So I gave this a shot, but I am receving the same error:

In file included from src/ArduinoOSCWiFi.h:14,
                 from src/ArduinoOSC.h:4,
                 from src/main.cpp:4:
src/WiFi.h:30:18: fatal error: utility/wl_definitions.h: No such file or directory
   30 |         #include "utility/wl_definitions.h"
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/esp-screen-system/src/main.cpp.o] Error 1
========================= [FAILED] Took 21.77 seconds =========================

still in limbo… Here is the full yaml

esphome:
  name: esp-screen-system
  friendly_name: ESP Screen System
  libraries:
    #- "cnmat/OSC@^1.0.0"
    #- "jandrassy/WiFiEspAT@^2.0.0"
    #- "arduino-libraries/[email protected]"
    #- "vekjja/ESPWiFi@^0.0.1"
    #- "SPI"
    #- "hideakitai/ArduinoOSC@^0.6.0"
    
  includes:
#    - src/BetterWiFiNINA.h
    #- src/WiFiNINA.h
#    - src/WiFi.h
    #- src/utility/wl_definitions.h
    #- wifi/src/WiFiUdp.h
    #- <OSCMessage.h>
    #- arduino-osc/ArduinoOSC.h
    #- arduino-osc/ArduinoOSCWiFi.h
    #- osc/OSCBoards.h
    #- espwifi/src/WiFiEspAT.h
    #- <WiFi.h>
    #- "<ArduinoOSC.h>"
    #- <ArduinoOSCWiFi.h>
    #- test.h
esp32:
  board: esp32dev
  framework:
    type: esp-idf

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "RPkjFZcCR1hdc8om2VR9jysCBiKHx1UjwJVVXgt/W/0="
  on_client_connected:
    - if:
        condition:
          lambda: 'return (0 == client_info.find("Home Assistant "));'
        then:
          - lvgl.widget.show: lbl_hastatus
  on_client_disconnected:
    - if:
        condition:
          lambda: 'return (0 == client_info.find("Home Assistant "));'
        then:
          - lvgl.widget.hide: lbl_hastatus


ota:
  - platform: esphome
    password: "f1f32c8baacd0a966872af47e40cc314"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp-Screen-System"
    password: "SLpgtLGyfy0H"

captive_portal:
    

light:
  - platform: monochromatic
    output: backlight_pwm
    name: Display Backlight
    id: backlight
    restore_mode: ALWAYS_ON


output:
  - platform: ledc
    pin: GPIO21
    id: backlight_pwm

spi:
  - id: tft
    clk_pin: GPIO14
    mosi_pin: GPIO13
    miso_pin: GPIO12
  - id: touch
    clk_pin: GPIO25
    mosi_pin: GPIO32
    miso_pin: GPIO39

font:
  - file: "fonts/Dosis-Bold.ttf" #"gfonts://Roboto"
    id: my_font
    size: 15
    bpp: 4
    extras:
      - file: "fonts/materialdesignicons-webfont.ttf"
        glyphs: [
          "\U000F02D1", # mdi-heart
          "\U000F05D4", # mdi-airplane-landing
          "\U000F0055", # arrow right
          "\U000F004E", # arrow left
          "\U000F0827", # house
          "\U000F0928", # wifi icon
          "\U000F02E3", # bed
          "\U000F04B9", # couch
          "\U000F0979", # moon-star
          "\U000F0A84", # H symbol hallway
          "\U000F0C2D", #W Symbol WLED
          "\U000F060A", #wifi symbol slanted
          "\U000F1A45", #AC Icon
          "\U000F005E", #Up Arrow
          "\U000F0046", #Down Arrow
          "\U000F003B", #mode button
          "\U000F0B12", #K=symbol Kitchen LED
          "\U000F1051", #strip symbol
          "\U000F1B2A", #kitchen Sink
          "\U000F0379", #tv icon
          "\U000F03CB" #hyperion icon
          ]

  - file: "fonts/materialdesignicons-webfont.ttf"
    id: icons_50
    size: 20
    bpp: 4

  - file: "https://github.com/IdreesInc/Monocraft/releases/download/v3.0/Monocraft.ttf"
    id: web_font
    size: 20
  - file:
      url: "https://github.com/IdreesInc/Monocraft/releases/download/v3.0/Monocraft.ttf"
      type: web
    id: web_font2
    size: 24
  
image:
  - file: "images/lightning.png"
    id: my_background
    type: RGB565 # Recommended for performance
    #resize: 240x380 # Match your display resolution
    
display:
  - platform: mipi_spi
    id: my_display
    spi_id: tft
    model: ESP32-2432S028
    dimensions:
      height: 320
      width: 240
    rotation: 270
    cs_pin: GPIO15
    dc_pin: GPIO2
    reset_pin: GPIO04
    color_depth: 16
    color_order: RGB
# the following are for LVGL
    auto_clear_enabled: false
    update_interval: never

touchscreen:
  - platform: xpt2046
    id: my_touch_screen
    spi_id: touch
    cs_pin: GPIO33
    interrupt_pin: GPIO36
    transform:
      mirror_x: True
      mirror_y: False
      swap_xy: False

    calibration:
      x_min: 330
      x_max: 3780
      y_min: 320
      y_max: 3750

button:
  - platform: template
    name: "BB Fan Light"
    icon: "mdi:lightbulb-on"
    id: light_off
    on_press:
      - homeassistant.service:
          service: light.toggle
          data:
            entity_id: light.bruce_br_fan
      - logger.log: "Soft Button pressed"

  - platform: template
    name: "BB AC"
    icon: "mdi:lightbulb-on"
    id: ac_toggle
    on_press:
      - homeassistant.service:
          service: button.press
          data:
            entity_id: button.esp_ac_unit_ir_bruce_bedroom_ac_power
      - logger.log: "Soft Button pressed"

  - platform: template
    name: "redchase"
    icon: "mdi:lightbulb-on"
    id: redchase_toggle
    #on_press:
      #- lambda: !lambda |-
          #const char* host = "10.1.1.3";
          #const int port = 7700;
          #OscWiFi.send(host, port, "/3/toggle8", 1);

        #include <WiFiUdp.h>
          #include <OSCMessage.h>

          #WiFiUDP udp;
          #OSCMessage msg("/3/toggle8"); // Your OSC Path
          #msg.add(1); // Optional argument

          #udp.beginPacket("10.1.1.3", 7700); // Target IP and Port
          #msg.send(udp);
          #udp.endPacket();
          #msg.empty();

binary_sensor:
  - platform: homeassistant
    id: bruce_light_state
    entity_id: light.bruce_br_fan
    publish_initial_state: true # Ensure the state is synced on boot
    internal: true


lvgl:
  #bg_color: 0x000000
  bg_image_src: my_background
  theme:
    label:
      text_font: my_font # set all your labels to use your custom defined font
    button:
      #bg_color: 0x8585e0
      #bg_grad_color: 0x005782
      #bg_grad_dir: VER
      #bg_opa: COVER
      bg_opa: TRANSP
      border_color: 0x3333ff
      border_width: 1
      text_color: 0xFFFFFF
      pressed: # set some button colors to be different in pressed state
        bg_color: 0x006699
        bg_grad_color: 0x00334d
      checked: # set some button colors to be different in checked state
        #bg_color: 0x1d5f96
        bg_opa: TRANSP
        bg_grad_color: 0x03324A
        text_color: 0x00e6e6
    buttonmatrix:
      bg_opa: TRANSP
      border_color: 0x0077b3
      border_width: 0
      text_color: 0xFFFFFF
      pad_all: 0
      items: # set all your buttonmatrix buttons to use your custom defined styles and font
        bg_color: 0x2F8CD8
        bg_grad_color: 0x005782
        bg_grad_dir: VER
        bg_opa: COVER
        border_color: 0x0077b3
        border_width: 1
        text_color: 0xFFFFFF
        text_font: my_font
        pressed:
          bg_color: 0x006699
          bg_grad_color: 0x00334d
        checked:
          bg_color: 0x1d5f96
          bg_grad_color: 0x03324A
          text_color: 0x005580
    switch:
      bg_color: 0xC0C0C0
      bg_grad_color: 0xb0b0b0
      bg_grad_dir: VER
      bg_opa: COVER
      checked:
        bg_color: 0x1d5f96
        bg_grad_color: 0x03324A
        bg_grad_dir: VER
        bg_opa: COVER
      knob:
        bg_color: 0xFFFFFF
        bg_grad_color: 0xC0C0C0
        bg_grad_dir: VER
        bg_opa: COVER
    slider:
      border_width: 1
      border_opa: 15%
      bg_color: 0xcccaca
      bg_opa: 15%
      indicator:
        bg_color: 0x1d5f96
        bg_grad_color: 0x03324A
        bg_grad_dir: VER
        bg_opa: COVER
      knob:
        bg_color: 0x2F8CD8
        bg_grad_color: 0x005782
        bg_grad_dir: VER
        bg_opa: COVER
        border_color: 0x0077b3
        border_width: 1
        text_color: 0xFFFFFF
  style_definitions:
    - id: header_footer
      #bg_color: 0x2F8CD8
      bg_grad_color: 0x005782
      bg_grad_dir: VER
      #bg_opa: COVER
      bg_opa: TRANSP
      #border_opa: TRANSP
      border_color: 0x4dffff
      border_opa: COVER
      radius: 0
      pad_all: 0
      pad_row: 0
      pad_column: 0
      text_color: 0xFFFFFF
      width: 100%
      height: 30
  
  top_layer:
    widgets:
      - buttonmatrix:
          align: bottom_mid
          styles: header_footer
          #text_font: icons_50
          pad_all: 0
          outline_width: 0
          id: top_layer
          items:
            styles: header_footer
          rows:
            - buttons:
              - id: page_prev
                text: "\U000F004E"
                on_press:
                  then:
                    lvgl.page.previous:
              - id: page_home
                text: "\U000F0827"
                on_press:
                  then:
                    lvgl.page.show: main_page
              - id: page_next
                text: "\U000F0055"
                on_press:
                  then:
                    lvgl.page.next:

      - label:
          text: "\U000F060A"
          id: lbl_hastatus
          hidden: true
          align: top_right
          x: -2
          y: 7
          text_align: right
          text_color: 0x80ffe5

      
  pages:
    
    - id: main_page

      widgets:
        - obj:
            align: TOP_MID
            styles: header_footer
            border_opa: TRANSP
            width: 100%
            widgets:
              - label:
                  text: "Lighting"
                  align: CENTER
                  text_align: CENTER
                  text_color: 0x4d4dff
        - obj:
            align: CENTER
            width: 228
            height: 224
            x: 3
            y: 3
            pad_all: 2
            #bg_color: 0x99e6ff
            bg_opa: TRANSP
            border_opa: TRANSP
            layout: # enable the FLEX layout for the children widgets
              type: FLEX
              flex_flow: COLUMN_WRAP # the order of the widgets starts top left
              flex_align_cross: CENTER # they sould be centered
              pad_row: 5
              pad_column: 5

            widgets:
              
              - button:
                  id: br_btn
                  width: 68
                  height: 68
                  checkable: true
                  #state:
                  #  checked: true # here you activate the state to be used at boot
                  checked:
                    #bg_color: 0x00FF00
                    border_color: 0x00ff00
                  widgets:
                    - label:
                        align: CENTER
                        text: "\U000F02E3\nBedroom"
                        text_align: CENTER
                        long_mode: wrap
                        id: br_btn_lbl
                  on_click:
                    - homeassistant.action:
                        action: light.toggle
                        data:
                          entity_id: light.bruce_br_fan
                    - logger.log: "BR Fan"

              - button:
                  id: hallway_wled_id
                  width: 68
                  height: 68
                  checkable: true
                  checked:
                    bg_color: 0x00FF00
                  widgets:
                    - label:
                        id: hallway_wled
                        align: CENTER
                        text: "\U000F0A84\nHallway\nWLED"
                        text_align: CENTER
                        long_mode: wrap
                  on_click:
                    #- button.press: light_off
                    - homeassistant.action:
                        action: light.toggle
                        data:
                          entity_id: light.hall_2
                    - logger.log: "Hall Press" 
              
              - button:
                  id: wall_palm_wled_id
                  width: 68
                  height: 68
                  checkable: true
                  checked:
                    bg_color: 0x00FF00
                  widgets:
                    - label:
                        id: wall_palm_lbl
                        align: CENTER
                        width: 100%
                        text: "\U000F0C2D\nWall Palm"
                        text_align: CENTER
                        long_mode: wrap
                  on_click:
                    #- button.press: light_off
                    - homeassistant.action:
                        action: light.toggle
                        data:
                          entity_id: light.wall_palm
                    - logger.log: "Wall Palm"
              
              - button:
                  id: livingroom_wled_id
                  width: 68
                  height: 68
                  checkable: true
                  checked:
                    bg_color: 0x00FF00
                  widgets:
                    - label:
                        id: livingroom_wled_lbl
                        align: CENTER
                        width: 100%
                        text: "\U000F0C2D\nLR WLED"
                        text_align: CENTER
                        long_mode: wrap
                  on_click:
                    #- button.press: light_off
                    - homeassistant.action:
                        action: light.toggle
                        data:
                          entity_id: light.livingroom
                    - logger.log: "LR WLED"
              
              - button:
                  id: livingroom_fan_btn
                  width: 68
                  height: 68
                  checkable: true
                  checked:
                    bg_color: 0x00FF00
                  widgets:
                    - label:
                        id: lr_fan_lbl
                        align: CENTER
                        width: 100%
                        text: "\U000F04B9\nLR Fan"
                        text_align: CENTER
                        long_mode: wrap
                  on_click:
                    #- button.press: light_off
                    - homeassistant.action:
                        action: light.toggle
                        data:
                          entity_id: light.fan_living_room
                    - logger.log: "LR Fan"
              
              - button:
                  id: bb_nightlight_btn
                  width: 68
                  height: 68
                  checkable: true
                  checked:
                    bg_color: 0x00FF00
                  widgets:
                    - label:
                        id: bb_nightlight_lbl
                        align: CENTER
                        width: 100%
                        text: "\U000F0979\nNight\nLight"
                        text_align: CENTER
                        long_mode: wrap
                  on_click:
                    #- button.press: light_off
                    - homeassistant.action:
                        action: light.toggle
                        data:
                          entity_id: light.night_light
                    - logger.log: "Nightlight"

              - button:
                  id: bb_kit_led_btn
                  width: 68
                  height: 68
                  checkable: true
                  checked:
                    bg_color: 0x00FF00
                  widgets:
                    - label:
                        id: bb_kit_led_lbl
                        align: CENTER
                        width: 100%
                        text: "\U000F0B12\nKit\nLED"
                        text_align: CENTER
                        long_mode: wrap
                  on_click:
                    #- button.press: light_off
                    - homeassistant.action:
                        action: light.toggle
                        data:
                          entity_id: light.kitchen_strip
                    - logger.log: "KitchenvLED"

              - button:
                  id: bb_kit_sink_btn
                  width: 68
                  height: 68
                  checkable: true
                  checked:
                    bg_color: 0x00FF00
                  widgets:
                    - label:
                        id: bb_kit_sink_lbl
                        align: CENTER
                        width: 100%
                        text: "\U000F1B2A\nKit\nSink"
                        text_align: CENTER
                        long_mode: wrap
                  on_click:
                    #- button.press: light_off
                    - homeassistant.action:
                        action: light.toggle
                        data:
                          entity_id: light.sink
                    - logger.log: "Kitchen Sink"

              - button:
                  id: bb_bath_strip_btn
                  width: 68
                  height: 68
                  checkable: true
                  checked:
                    bg_color: 0x00FF00
                  widgets:
                    - label:
                        id: bb_bath_strip_lbl
                        align: CENTER
                        width: 100%
                        text: "\U000F1051\nBath\nStrip"
                        text_align: CENTER
                        long_mode: wrap
                  on_click:
                    #- button.press: light_off
                    - homeassistant.action:
                        action: light.toggle
                        data:
                          entity_id: light.strip_bathroom
                    - logger.log: "Bath Strip"
        
    - id: ac_page
       
      widgets:
        - obj:
            align: TOP_MID
            styles: header_footer
            border_opa: TRANSP
            widgets:
              - label:
                  text: "AC Control"
                  align: CENTER
                  text_align: CENTER
                  text_color: 0x4d4dff

        - obj:
            align: CENTER
            width: 228
            height: 224
            x: 3
            y: 3
            pad_all: 2
            #bg_color: 0x00cccc
            bg_opa: TRANSP
            border_opa: TRANSP
            layout: # enable the FLEX layout for the children widgets
              type: FLEX
              flex_flow: COLUMN_WRAP # the order of the widgets starts top left
              flex_align_cross: CENTER # they sould be centered
              pad_row: 5
              pad_column: 5

            widgets:
                
              - button:
                  id: br_ac_btn
                  width: 70
                  height: 68
                  checkable: true
                  checked:
                    bg_color: 0x00FF00
                  widgets:
                    - label:
                        align: CENTER
                        text: "\U000F1A45\nAC Power"
                        text_align: CENTER
                        long_mode: wrap
                        id: ac_power_icon
                  on_click:
                    #- button.press: ac_toggle
                    - homeassistant.service:
                        service: button.press
                        data:
                          entity_id: button.esp_ac_unit_ir_bruce_bedroom_ac_power
                    - logger.log: "AC Power"

              - button:
                  id: br_ac_up_btn
                  width: 70
                  height: 68
                  checkable: false
                    #state:
                    #  checked: true # here you activate the state to be used at boot
                  #checked:
                  #  bg_color: 0x00FF00
                  widgets:
                    - label:
                        align: CENTER
                        width: 70
                        text: "\U000F005E\nUp"
                        text_align: CENTER
                        long_mode: wrap
                        id: ac_up_icon
                  on_click:
                    #- button.press: ac_toggle
                    - homeassistant.service:
                        service: button.press
                        data:
                          entity_id: button.esp_ac_unit_ir_bruce_bedroom_ac_temp_up
                    - logger.log: "AC Up"

              - button:
                  id: br_ac_down_btn
                  width: 70
                  height: 68
                  checkable: false
                    #state:
                    #  checked: true # here you activate the state to be used at boot
                 # checked:
                 #   bg_color: 0x00FF00
                  widgets:
                    - label:
                        align: CENTER
                        width: 70
                        text: "\U000F0046\nDown"
                        text_align: CENTER
                        long_mode: wrap
                        id: ac_down_icon
                  on_click:
                    #- button.press: ac_toggle
                    - homeassistant.service:
                        service: button.press
                        data:
                          entity_id: button.esp_ac_unit_ir_bruce_bedroom_ac_temp_down
                    - logger.log: "AC Down"

              - button:
                  id: br_ac_mode_btn
                  width: 70
                  height: 68
                  checkable: false
                    #state:
                    #  checked: true # here you activate the state to be used at boot
                 # checked:
                 #   bg_color: 0x00FF00
                  widgets:
                    - label:
                        align: CENTER
                        width: 70
                        text: "\U000F003B\nMode"
                        text_align: CENTER
                        long_mode: wrap
                        id: ac_mode_icon
                  on_click:
                    #- button.press: ac_toggle
                    - homeassistant.service:
                        service: button.press
                        data:
                          entity_id: button.esp_ac_unit_ir_bruce_bedroom_ac_mode
                    - logger.log: "AC mode"
    
    - id: l_var

      widgets:
        - obj:
            align: TOP_MID
            styles: header_footer
            border_opa: TRANSP
            widgets:
              - label:
                  text: "TV Controls"
                  align: CENTER
                  text_align: CENTER
                  text_color: 0x4d4dff

        - obj:
            align: CENTER
            width: 228
            height: 224
            x: 3
            y: 3
            pad_all: 2
            #bg_color: 0x751aff
            bg_opa: TRANSP
            border_opa: TRANSP
            layout: # enable the FLEX layout for the children widgets
              type: FLEX
              flex_flow: COLUMN_WRAP # the order of the widgets starts top left
              flex_align_cross: CENTER # they sould be centered
              pad_row: 5
              pad_column: 5

            widgets:
              
              - button:
                  id: tv_liv_btn
                  width: 70
                  height: 68
                  checkable: true
                  
                  #state:
                  #  checked: true # here you activate the state to be used at boot
                  checked:
                    bg_color: 0x00FF00
                  widgets:
                    - label:
                        align: CENTER
                        text: "\U000F0379\nTv On/off"
                        text_align: CENTER
                        #icon: "mdi:lightbulb-on"
                        id: tv_liv_btn_lbl
                  on_click:
                    #- button.press: light_off
                    - homeassistant.action:
                        action: media_player.toggle
                        data:
                          entity_id: media_player.qled
                    - logger.log: "TV Off"

              - button:
                  id: hype_off_btn
                  width: 70
                  height: 68
                  checkable: false
                    #state:
                    #  checked: true # here you activate the state to be used at boot
                 # checked:
                 #   bg_color: 0x00FF00
                  widgets:
                    - label:
                        align: CENTER
                        width: 70
                        text: "\U000F03CB\nHyperion\nLR Toggle"
                        text_align: CENTER
                        long_mode: wrap
                        id: hyperion_off_icon
                  on_click:
                    #- button.press: ac_toggle
                    - homeassistant.service:
                        service: switch.toggle
                        data:
                          entity_id: switch.livingroom_hyperion_component_all
                    - logger.log: "LR Hyperion Off/on"

              - button:
                  id: hype_br_toggle_btn
                  width: 70
                  height: 68
                  checkable: false
                    #state:
                    #  checked: true # here you activate the state to be used at boot
                 # checked:
                 #   bg_color: 0x00FF00
                  widgets:
                    - label:
                        align: CENTER
                        width: 70
                        text: "\U000F03CB\nHyperion\nBR Toggle"
                        text_align: CENTER
                        long_mode: wrap
                        id: hyperion_br_toggle_icon
                  on_click:
                    #- button.press: ac_toggle
                    - homeassistant.service:
                        service: switch.toggle
                        data:
                          entity_id: switch.first_led_hardware_instance_component_all
                    - logger.log: "BR Hyperion Off/on"

              - button:
                  id: redchase_btn
                  width: 70
                  height: 68
                  checkable: false
                    #state:
                    #  checked: true # here you activate the state to be used at boot
                 # checked:
                 #   bg_color: 0x00FF00
                  widgets:
                    - label:
                        align: CENTER
                        width: 70
                        text: "redchase\nToggle"
                        text_align: CENTER
                        long_mode: wrap
                        id: redchase_icon
                  on_click:
                    - button.press: redchase_toggle
                    #WiFiUDP udp;
                    #OSCMessage msg("/3/toggle8"); # Your OSC Path
                    #msg.add(1); # Optional argument

                    #udp.beginPacket("10.1.1.3", 7700); # Target IP and Port
                    #msg.send(udp);
                    #udp.endPacket();
                    #msg.empty();

Have you tried arduino framework?

esp32:
  framework:
    type: arduino

I thought in theory esp-idf should work since we’re providing all the libraries, but only arduino seemed to work.