#Problem turning Script into Blueprint

1 messages · Page 1 of 1 (latest)

oak dragon
#

Hey guys,

I tried to turn a script into a Blueprint, but when creating an Automation from the Blueprint I get an error:

Message malformed: extra keys not allowed @ data['sequence']

I could share the whole BP.. Thanks for help!

warm ginkgo
#

Script blueprint or automation blueprint, 2 different things. I haven't looked at your code, will do that niow...

oak dragon
#

Script Blueprint, but I already tried to set blueprint domain to "script" but this doesn't work

#

It does work as as script

#

But my script has a variables sections.. I removed it and replaced the variables with the inputs

warm ginkgo
#

So you have automation as the blueprint type, that needs to say script. then try it.

#

(domain)

#

The next thing I see is !input statements inside templates, that doesn't work, have to make variables for those.

oak dragon
#

Invalid blueprint: Found incorrect blueprint type script, expected automation

#

blueprint:
name: Raumautomatisierung (Licht)
#description:
domain: script

warm ginkgo
#

You have to also move it to the right folder

oak dragon
#

ah, my bad

oak dragon
#

Corrected the blueprint domain and saved it to scripts folder..

warm ginkgo
#

Next fix these,, as per link above

#
"{{ !input timer == 'on' }}"
oak dragon
#

Okay, will try to fix them

#

I updated the script, now getting Error:

Message malformed: not a valid value for dictionary value @ data['sequence'][0]['choose'][0]['sequence'][0]['choose'][0]['sequence'][0]['target']['entity_id']

warm ginkgo
#

Missed one likely. that tells you where it is.

oak dragon
#

entity_id: !input light_on_entity

#

cannot see an error there

warm ginkgo
#

Is there a value in the input that is an entity?

oak dragon
#

Yes, a light entity

#

light_on_entity:
entity_id: light.erdgeschoss_bad_lichter

civic ginkgo
#

If you're using a target selector, I think you just want this:

-                   target:
-                      entity_id: !input light_on_entity
+                   target: !input light_on_entity
#

The input already has a dict with entity_id in it, so your code is erroneously doubling that up:

                    target:
                      entity_id: 
                        entity_id: light.erdgeschoss_bad_lichter
oak dragon
#

Great, could save it 🙂

warm ginkgo
#

That one I missed... But you are correct @civic ginkgo

#

These are in a bunch of places...

oak dragon
#

Is this a similar problem?

civic ginkgo
#

Also consider that target selectors can have multiple entities, devices, or area

#

How is your script going to handle if someone selects an area there instead of an entity?

#

You may prefer to just use a simple entity selector instead

oak dragon
#

Like this?

light_check_entity:
  entity:
    domain:
      - light
civic ginkgo
#

You can read the above documentation for examples.

oak dragon
#

I already read the section about entity selectors but I cannot get it to work:

oak dragon