Create Cover in HA and connect with Node-Red

Hi All,

First of all, I wish you a happy new year.

I am new to HA and I cannot figure out a few things. I just spent 3 days at 4/5 hours a day trying to create roller shutters and interfacing them with nodered.

first of all my configuration :

  • a home automation system Crestron
  • A Synology NAS with Docker. 1 container with HASSIO and 1 container with NODERED
    (I did not put the nodered add-on because I have been using nodered for 2 years now and I prefer to have the 2 systems in different containers which allows me to have a part always online when restarting HA)

my roller shutters are operated by a third party homemade system from nodered. I would like to create a fictitious roller shutter in HA and be able to send NODERED a command (up, down or on / off, it doesn’t matter, I then rework it in nodered)

I turn to you unable to get the desired result.

I have so far managed to display shutters rolling in lovelace, have buttons active, but unable to send commands to nodered. I added of course to nodered the library to discuss with HA, I can do this without problem with fictitious input_boolean type buttons.

But with covers impossible to have a return in nodered. Can you help me? A track?

Most of the time I get the error below when I click on one of the buttons to go up and down

echec call service "cover/open_cover". Unable to find service remote.send_command

or

echec call service "cover/open_cover". Unable to find service cover.open_cover

below my code with several attempts. Do I have to create a script? I tried but to no result.

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

http:
  ssl_certificate: /ssl/********************_ssl_certificate.cer
  ssl_key: /ssl/**********************.key

google_assistant:
  project_id: *******************
  service_account: !include /config/***********************.json
  report_state: true
  expose_by_default: true
#  entity_config:
#    cover.persienne_cuisine:
#      name: Persienne Cuisine
#    switch.persienne_cuisine:
#      name: Persienne Cuisine

#light:
#  - platform: group
#    name: Studio Lights Group 1
#    entities:
#      - light.bulb_1
#      - light.bulb_2
#  - platform: group
#    name: Studio Lights Group 2
#    entities:
#      - light.bulb_3
#      - light.bulb_4

cover:
  - platform: template
    covers:
      persienne_cuisine:
        friendly_name: "Persienne Cuisine"
        position_template: "50"
        open_cover:
          service: cover.open_persienne_cuisine
        close_cover:
          service: cover.close_persienne_cuisine
        stop_cover:
          service: cover.stop_persienne_cuisine

  - platform: template
    covers:
      persienne_sdb:
        friendly_name: "Persienne Salle de Bain"
        position_template: "50"
        open_cover:
          service: remote.send_command
        close_cover:
          service: cover.close_persienne_sdb
        stop_cover:
          service: cover.stop_persienne_sdb

#  - platform: template
#    covers:
#      persienne_jardin:
#        friendly_name: "Persienne Jardin"
#        position_template: "50"
#        open_cover:
#          service: ouverture_persienne_jardin
#          entity_id: cover.persienne_jardin
#        close_cover:
#          service: fermeture_persienne_jardin
#          entity_id: cover.persienne_jardin
#        stop_cover:
#          service: stop_persienne_jardin
#          entity_id: cover.persienne_jardin

  - platform: command_line
    covers:
      persienne_jardin:
        command_open: "move_command_up_garage"
        command_close: "move_command_down_garage"
        command_stop: "move_command_stop_garage"
        command_state: "state_command_garage"

homeassistant:
  customize_glob:
    "cover.*":
      assumed_state: true

I think there is something that I did not understand about how HA works.

I did not find a clear and affordable tutorial (for my level of English) on how to make a script and what it must contain to send information to NODERED if is that I must to do.

thanks for reading this far and any help you could give me.

Any help is appreciated, a direction, an idea. :smiley:

I just spent 2 more hours :exploding_head:. I think the help section should be more explicit about script because I’m really not doing it.

I don’t understand why we can create switch entry so easily and it’s so difficult for a cover.

Did you manage to get it to work?

Hi,

I did that and that work but I 'm not shure that is the best way to do it.

   - platform: template
    covers:
      persienne_entree:
        friendly_name: "Persienne Entree"
        open_cover:
          service: script.down_persienne
          data:
            customData: "up_cuisine"
        close_cover:
          service: script.up_persienne
          data:
            customData: "down_cuisine"
        stop_cover:
          service: script.stop_persienne
          data:
            customData: "stop_cuisine"

  - platform: template
    covers:
      persienne_jardin:
        friendly_name: "Persienne jardin"
        open_cover:
          service: script.down_persienne
          data:
            customData: "up_jardin"
        close_cover:
          service: script.up_persienne
          data:
            customData: "down_jardin"
        stop_cover:
          service: script.stop_persienne
          data:
            customData: "stop_jardin"

And I create a script :

up_persienne:
  alias: up_persienne
  sequence:
  - event: event_data
    event_data:
      customData: up
  mode: single
down_persienne:
  alias: down_persienne
  sequence:
  - event: event_data
    event_data:
      customData: down
  mode: single
stop_persienne:
  alias: stop_persienne
  sequence:
  - event: event_data
    event_data:
      customData: stop
  mode: single

In nodered I install the home assistant node and use the “event: all” node and a switch node after to separate the up down stop action.

What do you think about that? Good or bad?