#announce

1 messages ยท Page 1 of 1 (latest)

halcyon sand
#

Wondering if I can get a bit of blueprint help! ๐Ÿ™‚

I have the below code I put into my github, but it will not import, I get the following error, but I can't deterine what is wrong with the code.

while scanning for the next token found character '%' that cannot start any token in "<unicode string>", line 84, column 8: {% if brightness_level %} ^

https://github.com/wesmannmsu/Home-Assistant/blob/main/BluePrints/multi_motion_sensor_with_Brightness_and_Time_options.yaml

GitHub

Home Assistant Files. Contribute to wesmannmsu/Home-Assistant development by creating an account on GitHub.

quiet plank
#

Think you're missing the multi-line string operator.

-    data_template:
+    data_template: >
      {% if brightness_level %}
      brightness_pct: "{{ brightness_level }}"
      {% endif %}
#

actually I'm not even sure if that will work

#

If you want a conditional key I think you need to build a dict in jinja.

halcyon sand
#

sadly, I don't know what that means, ill have to figure that out.

verbal tangle
#

Type > after "data_template:" it tells the code the template covers multiple lines

quiet plank
#

That's still the wrong answer though.

#

The answer is much more complex ๐Ÿ˜ฌ

verbal tangle
#

Yeah. T'aint right

halcyon sand
#

I decided to remove templating and just go the old fasion way,, but still will not load
https://github.com/wesmannmsu/Home-Assistant/blob/main/BluePrints/multi_sensor_motion_Multi_light_with_brightness.yaml

the error now is not making sense to me
Invalid blueprint: required key not provided @ data['blueprint']['domain']. Got None

GitHub

Home Assistant Files. Contribute to wesmannmsu/Home-Assistant development by creating an account on GitHub.

quiet plank
#

It says you're required to have a domain key under blueprint, and you don't. Please review the documentation.