Script include syntax error

Hi all,

I would like to setup a new configuration for my home assistant.

Into my configuration file i’ve put:

script: !include_dir_merge_named scripts/

into scripts there are single files and each one contains a script.
an example could be this: (file name called: scripts/test.yaml)
test:
sequence:
- service: light.turn_on
data:
entity_id: light.hue_white_lamp_2
brightness: 125

if i try to restart hass, logs give me nothing (empty). if i comment the script line in the configuration line it works fine.

Can you help me? i think is something regarding sintax/include but i cannot understand :frowning:

Thanks very much!

What exactly is the problem? Are you trying to execute the script but it’s not doing anything? Are any of your other scripts working?

The code above seems fine, although I can’t judge the formatting/spacing of your code. For that you would have to select your code and then click the < / > button in the toolbar above the text field.

Hi David,
i’ve removed all the scripts inside the scripts/ folder exept this one:
test: sequence: - service: light.turn_on data: entity_id: light.hue_white_lamp_2 brightness: 125

If i let the script inside the folder, hass doesn’t even restart. i cannot understand if it’s a sintax problem or not

Thanks in advance

Have you formatted the script above to look like this?

test:
  sequence:
    - service: light.turn_on
      data:
        entity_id: light.hue_white_lamp_2
        brightness: 125

Also, if Home Assistant won’t start, there really should be an error in your home-assistant.log file in your .homeassistant folder.

Have you tried hass --script check_config ?

Hi David,
it seems strange but even if i setup logger with the info parameter my log is still black. After i reboot hass it just remain black :(.

my sintax was right then. It’s exactly that you wrote. With that sintax i got the error

Hi Daniel,

If i run the command like this it says me “Command not found”.
I’ve found the path of the script but even if i run the script from the static path it says:

pi@raspberrypi:/srv/homeassistant/homeassistant_venv/bin $ ./hass --script check_config
INFO:homeassistant.util.package:Attempting install of colorlog>2.1,<3
Config does not exist: /home/pi/.homeassistant/configuration.yaml

My config is inside: :/home/homeassistant/.homeassistant
i’ve installed hass with the all in one script.

Any suggestions?

Thanks very much

hass -c PATH_TO_YOUR_CONFIG --script check_config

1 Like

Hi,

Here my output:

pi@raspberrypi:/srv/homeassistant/homeassistant_venv/bin $ sudo ./hass -c /home/homeassistant/.homeassistant/ --script check_config
Testing configuration at /home/homeassistant/.homeassistant/

It seems that everything is fine. I have no idea. Is there any other workaround? Like another config method i can use to store my scripts into a specific folder?

Thanks guys

I am also using script: !include_dir_merge_named scripts
Here is my config:

Thanks for sharing :slight_smile:

That’s the same as my configuration. i think i will come back with

script: !include scripts.yaml

and inside that file i put all my scripts

P.S. i’m using 0.36 too. The script part is the same as yours

Maybe it’s not connected but i’ve reinstalled hass using Hassbian. Everything is working fine now.
Maybe this feedback can help :slight_smile:

Thanks guys