Hi all,
since the 2021-12 december update there is no format in the yaml configuration of the automation. I mean when I configure an automation in the YAML mode, there are no linefeeds anymore. All the logic is printed in one very long line. So I cannot see e.g. the structure if the if-else commands.
Can anybody help me? Is this a bug?
Best regards,
Harald
Can not reproduce that here, all seems normal…
Strange, I write my software-versions:
core-2021.12.8
supervisor-2021.12.2
Home Assistant OS 7.1
|Python-Version|3.9.7|
|Betriebssystemfamilie|Linux|
|Betriebssystem-Version|5.10.63-v8|
|CPU-Architektur|aarch64|
Board rpi3-64
And that’s my problem:
Do anybody have an idea what’s wrong?
Thank’s a lot,
Harald
I have the same problem, i am writing multiline automations, even in the automations.yaml file, after reloading the wholse format gets one line and is not human readable.
Have You found a solution?
I’m getting a similar but very confusing issue - if you split using a newline ‘\n’ character, the formatting goes all to hell, but still works: something wrong with the code to display the automation?
E.g. look at this:
action:
- service: input_text.set_value
data:
value: |-
{{ states('sensor.esp32_wifi_scan_results').split('
')[0] }}
target:
entity_id: input_text.wifissid1
- service: input_text.set_value
data:
value: |-
{{ states('sensor.esp32_wifi_scan_results').split('
')[1] }}
target:
entity_id: input_text.wifissid2
- service: input_number.set_value
data:
value: >
{{ states('sensor.esp32_wifi_scan_results').split('\n')[0].split(':
')[1].split('dB')[0] | int }}
target:
entity_id: input_number.wifirssi1number
mode: single
p.s. the format is also messed up in the automations.yaml file
I think I found a workaround: use splitlines rather than split(’\n’). There’s definitely something going on here between Yaml, jinja, and the use of a python method (split).