Automation call service not working

Hello everyone,

first of all I´m fairly new to Home Assistant and not that experienced with it so please forgive me if this question is dumb :slight_smile:

Im experementing with automations and the call service action.

What I´m trying to do is to use the service dyson.set_angle to set my Dyson fan to a defined position when calling it with a webhook.
The problem here is that I´m probably doing something wrong configuring the action.

Here is a screenshot of my test automation

This is how the automations.yaml looks like

- id: '1588759914087'
  alias: Test
  description: ''
  trigger:
  - platform: webhook
    webhook_id: test
  condition: []
  action:
  - data:
      angle_high: 185
      angle_low: 185
    entity_id: fan.schlafzimmer
    service: dyson.set_angle

I really don´t know what I´m doing wrong here. I can save my automation but the action doesn´t do anything. When I change the action to e.g. turn on/off one of my Hue lights it immediataly reacts.
The strange thing is that when I try to call the service through the developer tools the dyson fan is reacting and working as it should

What am I doing wrong here?

Once again sorry if thats a dumb question :slight_smile:
Thanks in advance for your help!

Regards
Stefan

Do you see anything in the log when you try to execute this automation?

I see this error message in the log after I try to execute the automation

(MainThread) [homeassistant.components.automation] Test: Error executing script. Invalid data for call_service at pos 1: value should be a string for dictionary value @ data['entity_id']

What about this:

- id: '1588759914087'
  alias: Test
  description: ''
  trigger:
  - platform: webhook
    webhook_id: test
  condition: []
  action:
  - data:
      angle_high: 185
      angle_low: 185
      entity_id: fan.schlafzimmer
    service: dyson.set_angle
1 Like

That worked :smile: thanks a lot for the fast reply and the help.

May I ask you what I did wrong? Did the GUI mess things up? As far as I see everything you changed is that you added two spaces before entity_id: is that correct.

Is there also any recommended articel to learn how to format my configuartion .yaml files? (I had simliar issues with formatting before and always solved it by trial and error.) This time though I couldn´t find out what the problem was.

Regards
Stefan

Well, I am not good in writing the yaml automation, but I spend a ton of hours to write mines, and now if I want to write something new a take a look on what I did before :slight_smile:

It is not a mistery that GUI sometimes has some bugs and the automation doesn’t work or it can break stuff, but in this situation I don’t it mess something.

For sure a good start is to take a look at some yaml tutorial. Like this one:

1 Like