Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95576

Customize: wildcard for identical friendly_names in similar devices?

$
0
0

@prankousky wrote:

Hi everybody,

I am currently switching from using mqtt for all my tasmota devices to discovery; this works fine, however, the friendly_names for some things are kinda ugly. For example, when I had to use the mqtt_sensor for this, I could always set a friendly_name (and icon) right away. Now with discovery, they look rather ugly (for example, sensor.<device>.energy_today for today’s total energy consumption).

I have my customize.yaml, which includes this

    sensor.dr_xmas_energy_power:
      friendly_name: Watt
    sensor.dr_xmas_energy_voltage:
      friendly_name: Volt
    sensor.dr_xmas_energy_today:
      friendly_name: Verbrauch HEUTE
    sensor.dr_xmas_energy_yesterday:
      friendly_name: Verbrauch GESTERN
    sensor.dr_xmas_energy_total:
      friendly_name: Verbrauch TOTAL

It works! However, I have a bunch of those energy consumption measuring devices, and would have to create this block for each and every one of them.

Is there a way to create friendly_names like this with a pattern? In my case, it’d be sensor.<device>_energy_power, sensor.<device>_energy_voltage, etc. etc. (as above). If not, one could always just use regex and search and replace, but that’d still not be ideal. I am not trying to fix things “for now”, but rather to have a working solution each time I add another device, so if this can be automated, I’d love to do that.

Same goes for door/window sensors, btw.; they don’t have friendly_names by default, so I have the same block for each room (binary_sensor names similar -only room name changes-, friendly_names identical).

Thank you for your ideas :slight_smile:

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95576

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>