I have several similar devices to deploy and substitutions are clearly going to make things simpler as there are 50 'names in each. However, I can’t determine from the docs just how substitutions can be used in name:.
It does show up with an Entity ID of button.esp17_restart with a name of “esp17 Restart”
I run everything in esphome and Home Assistant through a YAML validator - it tends to like single quotes. But I think double quotes are okay (it validates).
(I would like to use this when I click VISIT on my ESPHome Device, so this information gets presented on the webpage, together with other info such as uptime etc. etc.)
I have searched for a solution in the ESPHome documentation/community & Googled the net, tried Copilot etc. but with no luck…
The error I get is :
/config/esphome/ny-s2-x-26.yaml: In lambda function:
/config/esphome/ny-s2-x-26.yaml:35:16: error: 'controller_type' was not declared in this scope
As it says that “the controller_type was not declared in this scope”, its probably very easy to fix , but not for a newbie …(but i am learning every day .
I’m by no means an expert on the subject matter, but I don’t think you can use the substitutions inside a lambda function. At that point you are writing C code and no longer doing yaml.
What you could do (but it is probably overkill) is define a (internal) text sensor with the value and use that in the lambda. I do not know if there are easier ways to communicate information to the C code.
/config/esphome/ny-s2-x-26.yaml: In lambda function:
/config/esphome/ny-s2-x-26.yaml:39:14: error: 'ESP32S2MINI' was not declared in this scope
return ${controller_type};