Thank you for the quick solution suggestion!
It’s something different that I need. I simply want additional attributes to be added for the newly created “sensor.deepl_translation_####”, which should be extracted, for example, from “states.sensor.seventeentrack_packages_delivered.attributes.packages[0].location” and added as an attribute to the newly created “sensor.deepl_translation_####”.
Your solution suggestion creates additional new sensors, which is not needed in my case. Unfortunately, your solution suggestion is not working, and errors are displayed after restarting.
Logger: homeassistant.setup
Source: setup.py:363
First occurred: 10:33:09 (7 occurrences)
Last logged: 10:33:09
Unable to prepare setup for platform rest.sensor: Unable to set up component.
Logger: homeassistant.setup
Source: helpers/template.py:460
First occurred: 10:33:09 (1 occurrences)
Last logged: 10:33:09
Error during setup of component rest
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 458, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2007, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/local/lib/python3.10/site-packages/jinja2/sandbox.py", line 326, in getattr
value = getattr(obj, attribute)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2033, in _fail_with_undefined_error
raise ex
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2024, in _fail_with_undefined_error
return super()._fail_with_undefined_error(*args, **kwargs)
jinja2.exceptions.UndefinedError: 'None' has no attribute 'attributes'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 256, in _async_setup_component
result = await task
File "/usr/src/homeassistant/homeassistant/components/rest/__init__.py", line 79, in async_setup
return await _async_process_config(hass, config)
File "/usr/src/homeassistant/homeassistant/components/rest/__init__.py", line 99, in _async_process_config
rest = create_rest_data_from_config(hass, conf)
File "/usr/src/homeassistant/homeassistant/components/rest/__init__.py", line 188, in create_rest_data_from_config
resource = resource_template.async_render(parse_result=False)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 460, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: 'None' has no attribute 'attributes'