$hostmane does not seem to do what I was expecting

So my code has $hostname and I expected it to show the hostname in Lovelace not $hostname?

sensor:
  - platform: wifi_signal
    name: $hostname WiFi Signal
    update_interval: 60s
  - platform: uptime
    name: "$hostname Uptime"

tried with quotes and without. I can ping the hostname

image

Are my expectations wrong?
Thanks,
PapaLanc

Can you post your substitutions: section where you have defined hostname?

1 Like

Thanks, I was just copying and pasting code with no idea of course.
I thought $hostname would show the mDns value
I now see what I need,
Thanks,
Papa Lanc

substitutions:
  # Modify variables based on your settings
  hostname: 'My ESP Camera'

image

Yeah - maybe you should request a feature - may be handy sometimes. More often though it’s used to set the mDNS name:

substitutions:
  hostname: livingroom
  upper_hostname: LivingRoom

esphome:
  name: $hostname
  # ...

I always need to search for the doco for this stuff - It’s not under the “Table of Contents”, it’s under “Next steps, Configuration types” on the ESPHome main page.

1 Like