Helper within a Helper

I have several helpers that are dates, and I have one dropdown to determine a part of the helper name to gain the correct date. That probably sounds over-complicated.

Here is generally the syntax that I am looking for to figure out if the current time is greater than the value of one of my helpers. This works fine:

{{ now().timestamp() > state_attr('input_datetime.camera_wait_date_front','timestamp') }}

The problem is that instead of hard-coding the name of the camera 'front" as above, I have another dropdown helper that contains the correct camera name (in this case “front”). I tried many combinations of the statement below, and I just can’t figure out how to use the dropdown to determine the name of the correct date/time helper. Here’s what I tried:

{{ now().timestamp() > state_attr('input_datetime.camera_wait_date_(states('input_select.camera_current_cam_name_dropdown'))','timestamp') }}

Any help sincerely appreciated.

{{ now().timestamp() > state_attr('input_datetime.camera_wait_date_' ~ states('input_select.camera_current_cam_name_dropdown') | lower,'timestamp') }}

As a sidebar, you should really avoid timestamps because they don’t account for timezone properly.

If your input_datetime has a time and date…

{{ now() > states('input_datetime.camera_wait_date_' ~ states('input_select.camera_current_cam_name_dropdown') | lower) | as_datetime | as_local }}

and to make it easier to read…

{% set entity_id = 'input_datetime.camera_wait_date_' ~ states('input_select.camera_current_cam_name_dropdown') | lower %}
{{ now() > states(entity_id) | as_datetime | as_local }}