Hi!
I am trying to build an automation blueprint to map functions on LEDs on a self built device. The LEDs have numbered entity IDs in the form of light.led_xx
I now want to generate a template that takes just the number as an input and generates the entity id from that and I can’t figure out, how I would do that.
My input looks like this:
blueprint:
[...]
input:
led:
name: LED
description: LED on Statusdisplay
selector:
number:
min: 0
max: 15
[...]
How do I use that in the template so I get the following:
Nope… that also didnt do it unfortunately. I tried several versions I could think of but got the weirdest error messages up to having to restart HA because I couldnt add automations anymore. I gave up and just use an entity selector with filters now…
What error’s did you get?
What code editor are you using? (I Recommend “Studio Code Server” integration, it helps finding the errors).
Quote people, or Tag them in your responses, otherwise they don’t know you have replied to them.
I notice another error in that code I submitted, that would cause it not to work, I have edited my OP.
People often use the Logs to test there variable output results like
input:
led:
name: LED
description: LED on Statusdisplay
selector:
number:
min: 0
max: 15
variables:
led: !input led
led_light: "{{ 'light.led_' + led }}"
action:
service: logbook.log
data:
name: "{{led}}"
message: "{{led_light}}"