Invalid config for [script]: At my wits end!

I’m trying to convert a scene (Good Night) to a script, but am at my wits end. I’m sure I’m doing something simple wrong, but I can’t figure it out despite reviewing it many times and tweaking things to test blocks. The reason for the script is because now I want my good night routine to include a check if my door is locked. (I’ll probably use a wait_template instead of a delay once I get this working, but first thing’s first.) Here’s the script:

  Gnight:
	alias: "G Night"
	sequence:
	  - service: homeassistant.turn_off
		entities:
		  - group.exterior
		  - group.living_room
	  #stops executing if next condition is not met
	  - condition:
		  condition: state
		  entity_id: lock.side_door_schlage_locked
		  state: 'unlocked'
	  - service: lock.lock
		entity_id: lock.side_door_schlage_locked
	  - delay:
		  seconds: 30
	  - service: notify.html5
		data_template:
		  message: "{% if is_state('lock.side_door_schlage_locked', 'locked') %}The door was not locked! It is locked now.{% else %}The door is unlocked!{% endif %}"
		  title: "Door Lock"

My scripts are separated out into a scripts.yaml file, as they have been for quite a while.

The error I’m getting is:
2017-09-23 16:17:11 ERROR (MainThread) [homeassistant.config] Invalid config for [script]: [Gnight] is an invalid option for [script]. Check: script->script->Gnight. (See /home/homeassistant/.homeassistant/configuration.yaml, line 166). Please check the docs at https://home-assistant.io/components/script/

The thing is, I get this error even if I comment-out everything but the first step in the sequence! I also tried calling light.turn_off for each group individually as its own step in the sequence, but had no luck. All of this first part of the script seems like it’s formatted just like all of my pre-existing scripts that work fine. Help please!

Use lower case for script name gnight

2 Likes

Geeze louise, that was it! I had no idea that was a requirement. Thank you!