N1c093
December 28, 2020, 3:24pm
1
Hello,
first of all I really like the new blueprint feature. It’s a great way to exchange new ideas/automation to each other.
Currently I try to create my first blueprint and share it with you.
I like to use this trigger in an blueprint. The user should be able to select multiple entities in the selector. In this example “media_player.badezimmer” and “media_player.wohnzimmer”
trigger:
- platform: numeric_state
entity_id:
- media_player.badezimmer
- media_player.wohnzimmer
attribute: volume_level
above: '0.37'
In general it seems to be impossible to add multiple entities via one entity-selector in a blueprint.
Is there currently an solution to add an selector which allow the user to add multiple entities? For the target this is possible via the target-selector.
Thanks in advance
Nico
I’m looking for the same thing. Found out you can’t use target in the trigger.
opened 07:34PM - 05 Jan 21 UTC
closed 07:45PM - 05 Jan 21 UTC
integration: light
<!-- READ THIS FIRST:
- If you need additional help with this template, pleas… e refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/core/releases
- Do not report issues for integrations if you are using custom components or integrations.
- Provide as many details as possible. Paste logs, configuration samples and code into the backticks.
DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment.
-->
## The problem
<!--
Describe the issue you are experiencing here to communicate to the
maintainers. Tell us what you were trying to do and what happened.
-->
Blueprint that uses a target and includes options in the trigger for that target did not produce a valid blueprint.
In the blueprint below the input 'target_lights' is a target and then in the 'trigger' section that input 'target_lights' includes "from" and "to" options. When those "from" and "to" options are removed the blueprint becomes valid. This works as an automation as written.
See some discussion and other examples in [forum discussion here](https://community.home-assistant.io/t/i-created-a-blueprint-from-working-automation-but-get-the-error-entity-id-entity-id-is-an-invalid-entity-id-for-dictionary-value/264481/4).
## Environment
<!--
Provide details about the versions you are using, which helps us to reproduce
and find the issue quicker. Version information is found in the
Home Assistant frontend: Configuration -> Info.
-->
- Home Assistant Core release with the issue: 2020.12.7
- Last working Home Assistant Core release (if known): n/a
- Operating environment (OS/Container/Supervised/Core): Home Assistant OS 5.9
- Integration causing this issue: Blueprint
- Link to integration documentation on our website: https://www.home-assistant.io/docs/automation/using_blueprints/
## Problem-relevant `configuration.yaml`
<!--
An example configuration that caused the problem for you. Fill this out even
if it seems unimportant to you. Please be sure to remove personal information
like passwords, private URLs and other credentials.
-->
**Full blueprint:**
```yaml
blueprint:
name: Reset light's brightness and color temperature to your default when it turns
on
description: Resets bulb(s)'s color and brightness when it turns on. Although Home
Assistant has a Default Turn-on Value (https://www.home-assistant.io/integrations/light/#default-turn-on-values)
for lights it does not support color temperature, and some bulbs do not quickly
check when they are first physically powered on versus turned on by automation,
UI, or smart switch.
domain: automation
input:
target_lights:
name: Lights
description: The lights you want to auto reset to default settings when they
turn on.
selector:
target:
entity:
domain: light
light_color_temperature:
name: Color Temperature
description: 'Choose the color temperature. Examples: Cool White: 154; Daylight
White: 181; White: 250; Soft White: 370; Warm White: 454'
default: 370
selector:
number:
min: 154.0
max: 500.0
unit_of_measurement: mireds
mode: slider
step: 1.0
light_brightness:
name: Brightness
description: Choose the brightness.
default: 255
selector:
number:
min: 1.0
max: 255.0
mode: slider
step: 1.0
source_url: https://gist.github.com/NobleWolf/ecd60fd4f3540ac1cc1083783d3ba28a
alias: Bulb toggle set to default (Soft White) (BP)
description: 'When a bulb goes from off to on (usually toggling the physical switch)
it sends a light.turn_on to force the light to go to its default state, because
physical toggle does not trigger the default state unless the light power is off
for ~30 sec. (It does go to default instantly if toggled via software.
This is useful when the bulb''s previous/current state is not what you want as default.
Example: Front porch light in holiday/color mode, but you want it to default on
to 100% white.
Don''t forget to add each bulb''s default in light_profiles.csv in the /config directory.'
trigger:
platform: state
target: !input 'target_lights'
from: "off"
to: "on"
condition: []
action:
service: light.turn_on
data:
color_temp: !input 'light_color_temperature'
brightness: !input 'light_brightness'
entity_id: '{{ trigger.entity_id }}'
mode: parallel
max: 100
```
**Focus areas:**
```yaml
...
blueprint:
input:
target_lights:
name: Lights
description: The lights you want to auto reset to default settings when they
turn on.
selector:
target:
entity:
domain: light
...
trigger:
platform: state
target: !input 'target_lights'
from: "off"
to: "on"
...
```
**This however works if the trigger is an entity_id and not a target:**
```yaml
...
blueprint:
input:
target_lights:
name: Lights
description: The lights you want to auto reset to default settings when they
turn on.
selector:
entity:
domain: light
...
trigger:
platform: state
entity_id: !input target_lights
from: "off"
to: "on"
...
```
## Traceback/Error logs
<!--
If you come across any trace or error logs, please provide them.
-->
```txt
2021-01-05 10:22:46 ERROR (MainThread) [homeassistant.components.automation] Blueprint BLUEPRINT NAME generated invalid automation with inputs OrderedDict([('light_brightness', '255'), ('target_lights', OrderedDict([('entity_id', 'light.living_room_lamp_left')]))]): Entity ID entity_id is an invalid entity id for dictionary value @ data['entity_id']. Got None
```
## Additional information
The error below shows in the HA File Editor.
```txt
unknown tag !<!input> at line 56, column 36:
entity_id: !input 'target_lights'
^
```
Just published my blueprint with this in the user instructions
N1c093
January 5, 2021, 8:12pm
3
Thank you for your reply.
I found a workaround for my problem. You can use a comma separated list for multiple entities as a trigger. As you can see here: Media Player - Volume limit
The only downside is, that you can’t use a selector for it.
Thank you! I’ll note the comma suggestion when I publish the blueprint.
1 Like
N1c093
January 5, 2021, 8:23pm
5
I hope this workaround will work for your blueprint as well, but it looks pretty simular.
Hopefully they will add an selector for multiple entities soon.
123
(Taras)
January 5, 2021, 8:31pm
6
I’ve seen this used elsewhere and it’s a very ‘user-unfriendly’ workaround.
The user must type the entities from memory. They can peek at the selector’s menu for reference but must type the entities without introducing spelling errors. If they make the mistake of selecting an entity from the menu, it overwrites everything they may have already typed. Everything about this workaround is opposite to the intended convenience of using a selector.
A multi-select Entity Selector is sorely needed.
1 Like
cloak
January 20, 2021, 12:00pm
7
See my reply here . May be of use or may be able to be modified.
r.t.s
(Richard T Schaefer)
March 10, 2023, 4:50pm
8
You can now use a entity selector with multiple set to true in your blueprint.
So you can select MULTIPE entities to trigger your blueprint without needing multiple selectors.
N1c093
March 14, 2023, 8:54pm
9
Thank you for your reply. I also noticed it some month ago and already modified my blueprint:
https://community.home-assistant.io/t/media-player-volume-limit