Newbie in automation needs some help

Hi guys,
I am trying to to build a home automation system using a pi3, broadlink mini and iffft.
I managed to implement on/off functions for the TV but now i trying to build a sequence of commands in order to action multiple devices.
For this i wrote the following lines in the configuration.yaml:

automated switches

script:
cinema:
alias: “Start cinema”
sequence:
- service: switch.turn_on
data:
entity_id: switch.bedroom_lights
- service: switch.turn_on
data:
entity_id: switch.bedroom_tv

In order to test i am using the following curl command:
curl -X POST -H “Content-Type: application/json” -d ‘{“entity_id”: “script.cinema”}’ http://myip:8123/api/services/script/cinema

Nothing is happening and in the logs I have the following line:
2017-11-11 18:06:22 WARNING (MainThread) [homeassistant.core] Unable to find service script/cinema

Any ideas on what I am missing?

Best regards,
Florin

Try http://myip:8123/api/services/script/turn_on

@danichispa
I already tried this…the same result…
2017-11-11 18:43:53 WARNING (MainThread) [homeassistant.core] Unable to find service script/turn_on

Do your have a password on your config? Try adding another header in your curl with your HA-pass.
As seen here: https://home-assistant.io/developers/rest_api/#post-apiservicesltdomainltservice

@danichispa
I have no password…the service is not protected…i’m just in the testing phase

Ok. Do you have the script listed on your dev-page? The left one of the bottom icons (seems like a remote button). On the dropdown menu, select “Script” and there has to appear on the second dropdown menu.

@danichispa
Nope it’s not listed there…and also, I have no “Script” option to select from the dropdown :frowning:

Silly question. Have you rebooted HA after adding the script part to your configuratiom.yaml?
Also, can you post your script part of the config? Don’t you see any error when loading HA?

@danichispa
Yes…I rebooted using “hassio homeassistant restart”
This is what I have added in the configuration.yaml

Broadlink device

switch:

  • platform: broadlink
    host: 192.168.1.2
    mac: ‘mac:mac:mac’
    switches:

    Bedroom lights

    bedroom_lights:
    friendly_name: “Bedroom lights”
    command_on: ‘JgBQAAABK5EVERQRFBETEhMRFRETEhMRFTUUNRU1FTUUERU1FDUVNRU1FDUUEhMSFBETEhMRFRETEhMRFDYUNRQ1FTYUNRQ1FQAFOwABKkkUAA0FAAAAAAAAAAA=’
    command_off: ‘JgBQAAABKpISExQRFBEUEhMRFRAUEhMQFjUTNhQ1FTYTERQ2EjgUNRUREzYUERQSExEUERQSExAVNhQQFjQUNhQ1EzcSOBQ1FgAFOgABK0gUAA0FAAAAAAAAAAA=’

    Bedroom TV

    bedroom_tv:
    friendly_name: “bedroom tv”
    command_on: ‘JgBYAAABKpEVERQ2FBEUERQ2FDYVEBUQFTUVEBU1FTYUERQRFDYUNhUQFTUVEBURFBEUERQRFBEUNhQRFDYVNRU1FTUVNhQ2FAAFBAABKUgVAAxBAAEqRxUADQU=’

automated switches

script:
cinema:
alias: “Start cinema”
sequence:
- service: switch.turn_on
data:
entity_id: switch.bedroom_lights
- service: switch.turn_on
data:
entity_id: switch.bedroom_tv

PS The switches are working perfectly…only the script is not working properly :frowning:
Also…the spacing is properly…no errors are thrown when restarting the HA

@danichispa
Hey dude…i finally solved it after reading more carefuly the configuration.yaml I noticed that there is a inclusion of the script.yaml.
So i edited the script.yaml file and I added

automated switches

cinema:
alias: “Start cinema”
sequence:
- service: switch.turn_on
data:
entity_id: switch.bedroom_lights
- service: switch.turn_on
data:
entity_id: switch.bedroom_tv

Now everything seems to be fine.

Best regards,
Florin