Hello.
Is it possible to create a new entity within a Lovelace card or is it only possible via Template in the configuration.yaml file? As an example I have a temperature sensor which displays to 1 decimal place (63.3) and I want to round it down (63). The Lovelace YAML is:
entities:
- entity: sensor.server_closet_environment_temperature
name: Temperature
I can use templates to create a new sensor in configuration.yaml:
No, you have to make template sensors and expose the template sensors. Lovelace doesnât allow templates unless youâre using the markdown card or a custom card.
Thank you for the prompt reply. Any thoughts for incorporating this feature? The current situation works but it would be awfully nice to have simple data transformations incorporated into the card.
@petro Iâd like to fu on this situation. Is there a âmacroâ or âfunction(x)â option in home assistant such that a variable is passed to the function and a value is returned?
This is all very helpful information but a bit frustrating because of all the coding repetition. Or perhaps I am missing something. All I want is a function to round a number to an arbitrary accuracy w/o the need to make a template each time. My current understanding is:
No coding in a Lovelace card
Templates only read sensor data (no passing data to a template).
Functions can be created within a template but are only usable within that template.
Has there been any movement on this?
I think it would be really helpful to allow templating in Lovelace. I do not necessarily want to create a sensor for every possible variation when i can just have it in the UI.