Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Automation template: Invalid data for call_service expected int for dictionary value @ data['position']

$
0
0

@metaloide wrote:

Hi all,

Thanks all in advance for you help, this is my first post in the community.

I’m facing an automation error that I’m unable to resolve. I’ve tried many combinations and differnt approaches but I keep getting following error:

2020-01-29 21:56:00 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.programa_persiana. Invalid data for call_service at pos 2: expected int for dictionary value @ data['position']

I’m trying to setup an automation to set blinds at specific position at specific times.

  • 6:20 set cover.persiana_cocina at position 90
  • 19:30 set cover.persiana_dormitorio at 35
  • 21:30 set cover.persiana_cocina at 35.
  • In all cases, a notification should also be sent informing of the hour it was executed at.

And here my failing automation:

- id: '1579878523506'
  alias: Programa-persiana
  description: ''
  trigger:
  - at: '19:30'
    platform: time
  - at: '21:56'
    platform: time
  - at: '6:20'
    platform: time
  action:
  - service: cover.set_cover_position
    data_template:
      entity_id: cover.persiana_cocina
      position: '{% if trigger.now.hour == 21 %} 35 {% endif %}'
  - service: cover.set_cover_position
    data_template:
      entity_id: cover.persiana_cocina
      position: '{% if trigger.now.hour == 6 %} 90 {% endif %}'
  - service: cover.set_cover_position
    data_template:
      entity_id: cover.persiana_dormitorio
      position: '{% if trigger.now.hour == 19 %} 35 {% endif %}'
  - data_template:
      message: "Programa-persiana triggered at {{ trigger.now.hour }}"
    service: notify.ha_besalu

The thing is that the first cover cover.persiana_cocina is correctly set to the position but then the error is thrown and no notification is sent. I’ve tried many things without any luck.

Thanks for your help!

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles