Automation (what is wrong)

Hello,
I want to sent a message to a Slack channel if one switch is turned on.
This ist my config

This is the notify config block:

- name: slack-space
    platform: slack
    api_key: my key
    default_channel: 'space'

And this is the automation block:

automation:
  - alias: 'desk'
    trigger:
      platform: state
      entity_id: switch.steckdoseb
      from: 'off'
      to: 'on'
    action:
      service: notify.slack-space
      data:
        message: 'random message'

What I’m doing wrong?

Under Dev Tools -> states does the Automation show it as being last triggered when you moved the switch from off to on?

Also, if you go to terminal/command line on your HASS box; what happens if you run

hass --script check_config

Does everything check out?

It says “command not found”

Are you running in a Linux Virtual Environment or the AIO installer? If so you will need to become the homeassistant user first:

sudo su -s /bin/bash homeassistant
hass --script check_config

I’m running this on an Raspberry pi with the Hass Image.
Still “command not found”

use homeassistant instead of hass or use the dev-tools in the front end

as to your error can you use - you probably need to use _ also do you need a # in the def channel? (’#space’)

I resolved the problem. The notifyer was wrong configured.