Problem with !extend on Package Sensors

I Tried to Extend the Wifi-info component loaded from a Package & I get Compile Errors.
Searches say there “can” be issues extending the wifi_info Text Sensor due to it being a Multi-component Sensor.

But it’s all a bit Vague as AI seems to load the search with info that’s not very precise.

Is it Possible to actually extend thes Text Sensors, & if so can someone point me to a solution.

For Now I’ve done a Workaround with the Copy Component.

I’ve got this is the Package diag_wifi.yaml

sensor:
  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 30s
    entity_category: "diagnostic"
  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "WiFi Signal Percent"
    id: wifi_signal_pct
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "%"
    entity_category: "diagnostic"
    device_class: ""  

text_sensor:
  - platform: wifi_info
    ip_address:
      id: ip_add
    bssid:
      name: Mac Address
      id: con_ap
      filters:
        substitute:
          - "84:D8:1B:DD:4E:F4 -> Front_Office"
          - "00:5F:67:A0:71:F0 -> Centre_Office"
          - "C0:06:C3:35:A7:FE -> Lounge_Room"
          - "00:31:92:1B:38:22 -> Bbq_Area"
          - "50:C7:BF:D3:38:5A -> Back_Room"
          - "B0:4E:26:E4:41:FE -> Outdoor"
          - "50:C7:BF:D3:3C:61 -> Shed"
  - platform: copy
    id: ip_address
    source_id: ip_add
    name: "IP Address"
  - platform: copy
    id: ap_connected
    source_id: con_ap
    name: "AP Connected"

Then in the Main Code,

text_sensor:
  - id: !extend ip_address
    on_value:
      then:
        - lvgl.label.update:
            id: R1C3
            text: !lambda |-
              return x.c_str();
  - id: !extend ap_connected
    on_value:
      then:
        - lvgl.label.update:
            id: R0C3
            text: !lambda |-
              return x.c_str();

Should add,
This is the Error I get if I try and extend the Sensor ip_add

INFO ESPHome 2026.1.5
INFO Reading configuration /config/esphome/testesp-1.yaml...
Failed config

Source for extension of ID 'ip_add' was not found.

Just Saw another Search result that Stated:-

To “extend” the wifi_info text sensor from a package in ESPHome,
you can use the !extend functionality.
This allows you to add automations (like on_value )
or other properties to a sensor that was defined in an imported package.

  • Known limitations: In the past, there were issues with extending
    wifi_info and ethernet_info sensors,
    but these have largely been resolved in recent
    ESPHome versions using the callback infrastructure.
text_sensor:
  - platform: wifi_info
    ip_address:
      id: ip_add

has multiple “children”, ip_addr being one of them.
Extend doesn’t work on children.

Use

text_sensor:
  - platform: wifi_info
    id: wifi_info_id
    ip_address:

text_sensor:
  - id: !extend wifi_info_id
    ip_address:
       on_value:
         then:
           - lvgl.label.update:
               id: R1C3
               text: !lambda |-
                 return x.c_str();

Thanks @JeeCee

Think I’m Getting it???

So Do you mean Define the Sensor Like this,
Instead of Child Sensors of Wifi_info?

text_sensor:
  - platform: wifi_info
    id: wifi_ip
    ip_address:

  - platform: wifi_info
    id: wifi_ssid
    ssid:

  - platform: wifi_info
    id: wifi_bssid
    bssid:

  - platform: wifi_info
    id: wifi_mac
    mac_address:

Unfortunately that Portion of the Code Doesn’t Seem to Work.
It fails the Syntax Checking due to the missing indent.

Currently I’m doing a Work Around like this,

text_sensor:
  - platform: wifi_info
    ip_address:
#      name: "IP Add"
      id: ip_add

    bssid:
      name: Mac Address
      id: con_ap
      filters:
        substitute:
          - "84:D8:1B:DD:4E:F4 -> Front_Office"
          - "00:5F:67:A0:71:F0 -> Centre_Office"
          - "C0:06:C3:35:A7:FE -> Lounge_Room"
          - "00:31:92:1B:38:22 -> Bbq_Area"
          - "50:C7:BF:D3:38:5A -> Back_Room"
          - "B0:4E:26:E4:41:FE -> Outdoor"
          - "50:C7:BF:D3:3C:61 -> Shed"

  - platform: copy
    id: ip_address
    source_id: ip_add
    name: "IP Address"
  - platform: copy
    id: ap_connected
    source_id: con_ap
    name: "AP Connected"

But that Does give Me Duplicates on the Web Page for IP Address & Connected AP.

Are there any other Suggestions?