ESPHome lambda IP Address

Hi

I’m trying to dispaly EspHome node IP Address using lambda

IP it’s comming from DHCP server

text_sensor:
  - platform: template
    name: "${name}_MAC_Address"
    lambda: 'return {WiFi.macAddress().c_str()};'
    icon: mdi:fingerprint
    update_interval: 1d 
    
  - platform: template
    name: "IP Address"
    lambda: 'return {WiFi.localIP().toString().c_str()};'
    icon: mdi:fingerprint
    update_interval: 1d

Result:

MAC address is displayed correctly
Why I cannot read IP with this lambda configuration?

PS.
I always can use below code , which is working

text_sensor:
  - platform: wifi_info
    ip_address:
      name: Adress_IP

Do you want to mark it solved then please?

I would like to know why i cannot read IP address with this sensor lambda configuration. Please do not close if this not a problem for you.

What makes you think it should work, I haven’t seen that in the docs, so please point me to it. I am curious too :slight_smile:

I have asked after read this post -> https://community.home-assistant.io/t/solved-esphomeyaml-wifi-info-publish/88852

Interesting, thank you, I cannot see why your code is not working.

However there have been releases of esphome (and changes in the underlying libraries) since that thread. Perhaps something in an underlying library has changed?

Perhaps post an issue on gitgub, it’ll get the developer’s attention quicker than here. Post back your issue link back here so others can find it.