# Trigger Node-RED from a cover template in Home Assistant with Arguments

**URL:** <https://discourse.nodered.org/t/trigger-node-red-from-a-cover-template-in-home-assistant-with-arguments/39106>\
**Category:** General\
**Created:** [14 January 2021 06:55 UTC](https://discourse.nodered.org/t/trigger-node-red-from-a-cover-template-in-home-assistant-with-arguments/39106 "2021-01-14T06:55:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinst](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@martinst](https://discourse.nodered.org/u/martinst)\
**Post date:** [14 January 2021 06:55 UTC](https://discourse.nodered.org/t/trigger-node-red-from-a-cover-template-in-home-assistant-with-arguments/39106/1 "2021-01-14T06:55:18Z")

</div>

I'm using 'hass-node-red' to trigger Node-RED from Home Assistant. That works well.

But I have also a cover templete in which I also want to call Node-RED. That is not working with the arguments. Do somebody know if this is possible?

```auto
cover:
  - platform: template
    covers:
      safe_test_cover:
        device_class: shutter
        friendly_name: "SAFE test cover"
        position_template: "{{ state_attr('cover.05_hal_1e_etage', 'current_position' ) | int }}"
        open_cover:
          service: cover.open_cover
          data:
            entity_id: cover.05_hal_1e_etage
        close_cover:
          service: nodered.trigger
          data:
            entity_id: switch.safe_close_cover_slowly
        stop_cover:
          service: cover.stop_cover
          data:
            entity_id: cover.05_hal_1e_etage
        set_cover_position:
          service: nodered.trigger
          data_template:
            entity_id: switch.safe_set_cover_position_slowly
            position: "{{position | int}}"
            currentposition: "{{ state_attr('cover.05_hal_1e_etage', 'current_position' ) | int }}"

```

So the close\_cover is working (there are no arguments required).

The set\_cover\_position doesn't works. Extra keys not allowed @data['position']

---

<div class="post-metadata">

**Author:** ![martinst](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@martinst](https://discourse.nodered.org/u/martinst)\
**Post date:** [17 January 2021 12:04 UTC](https://discourse.nodered.org/t/trigger-node-red-from-a-cover-template-in-home-assistant-with-arguments/39106/2 "2021-01-17T12:04:48Z")

</div>

The solution is:

```auto
set_cover_position:
  service: nodered.trigger
  data_template:
  entity_id: switch.safe_set_cover_position_slowly
  payload:
    position: "{{position | int}}"
    currentposition: "{{ state_attr('cover.05_hal_1e_etage', 'current_position' ) | int }}"

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 March 2021 12:04 UTC](https://discourse.nodered.org/t/trigger-node-red-from-a-cover-template-in-home-assistant-with-arguments/39106/3 "2021-03-18T12:04:52Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
