Hello, is there any way to set a friendly_name from a template value?
i.e. somewhat like this:
rest:
- resource: http://localurl
scan_interval: 30
sensor:
- name: rest_sensor
unique_id: rest_sensor
value_template: "{{ (value.translate({39:34})|from_json)[0][8] }}"
friendly_name: "Rest Sensor: {{ (value.translate({39:34})|from_json)[0][2] }}"
tom_l
March 24, 2023, 12:19pm
2
Yes but it is “name” not “friendly_name”.
rest:
- resource: http://localurl
scan_interval: 30
sensor:
- name: "Rest Sensor: {{ (value.translate({39:34})|from_json)[0][2] }}"
unique_id: rest_sensor
value_template: "{{ (value.translate({39:34})|from_json)[0][8] }}"
https://www.home-assistant.io/integrations/sensor.rest#name
Cant get it to work, when i try to use the from_json value it defaults to “sensor.rest_sensor_xx”, both name and ID, even though i have set a unique_id. What am i doing wrong?