Hi,
It’s possible to call cover.set_position
service and set position from template or from number helper?
Thanks for your help.
Hi,
It’s possible to call cover.set_position
service and set position from template or from number helper?
Thanks for your help.
It depends on how you are calling the service.
You can do it in a script or automation, but most dashboard cards will not allow you to do it directly in a card action. If that is what you are trying to do, you need to set up the cover action in a script and call the script from the card’s action.
I want to call service from automation.
I have try to edit service call in automation and a write like this and didn’t work. Only seems to work with constant numbers
data:
position: {{45}}
I am able to directly set the position from a dashboard card and automations
action:
- service: cover.set_cover_position
target:
entity_id: cover.pc_curtains
data:
position: 75
Am I misunderstanding the question and you are trying to template the position based off another entity?
You need quotes for
data:
position: "{{45}}"
This is a automation that uses the state of a light and state of a device to set the cover position
alias: Curtain Test
description: ""
trigger:
- platform: device
type: changed_states
device_id: your light
entity_id: your light
domain: light
condition: []
action:
- service: cover.set_cover_position
target:
entity_id: cover.your_device
data:
position: "{{ states('input_number.test') }}"
mode: single
Thanks for your reply! Yes, my problem was quotes, it works perfect!