New user need help with scripts

Hi,

Just installed HA (0.73.2) on PI a few days ago and managed to get it to work with Broadlink and Alexa.
Now I’m starting to test scripts for the first time but I must be doing something wrong since i cant get this most basic script to work:

light_test:
sequence:
service: switch.turn_on
data:
entity_id: kitchen_lamp_1

The is valid and after restarting I don’t get any errors and the script appears on the HA GUI, and when I execute it I don’t get any errors on the GUI, but it doesn’t really work.

In the HA log file however, i do get this error every time i execute the script:
2018-07-24 11:21:25 ERROR (MainThread) [homeassistant.core] Invalid service data for switch.turn_on: Entity ID kitchen_lamp_1 is an invalid entity id for dictionary value @ data[‘entity_id’]. Got ‘kitchen_lamp_1’

What am i missing here??
Your help would be much appreciated!

I would hazard a guess that you entry should read something like

entity_id: switch.kitchen_lamp_1

to check what the entity ID is, click on the <> symbol on HA in the menu at the bottom on the left, and it will give you all the entites and what state they are in. Need to make sure that they match up.

Secondly, whenever you post you config here for people to look at it, make sure you highlight the code, and then click on the </> button in the text entry box, so it puts it in the code section, so people can check that you have the correct spacing too.

Hope this helps out.

1 Like

Thanks Cee, that was indeed the problem!

1 Like