Blog: Peđina beležnica, 07.Dec.2022, 13:53
ESPHome: Showing Project Name and Version as Text Sensors
Izvor: https://pedja.supurovic.net/esphome-showing-project-name-and-version-as-text-sensors
There is option to assign project name and version in ESPHome device config. Values are displayed in log when device is powered up. It is useful to have those information as sensors so it is easy to check them, if needed. Here is how.
How to set project name and version:
esphome:
name: "my_device"
project:
name: "Me.MyProject"
version: "0.1.0"
And now create Text Sensors:
text_sensor:
- platform: template
name: "Project"
lambda: |-
return to_string(ESPHOME_PROJECT_NAME);
- platform: template
name: "Version"
lambda: |-
return to_string(ESPHOME_PROJECT_VERSION);
I like to use substitutions as it let’s me put all configuration at the beginning of the yaml and reuse values where needed. […]
[ ... vidi ceo članak ... ]
Related posts:
Example: How to use ESPHome Select Component
Resolving problem flashing ESPHome into Amica NodeMCU with CP2102
Enabling two color LED on Sonoff Basic R2 Smart Home Switch
Nastavak na Peđina beležnica...