How to make a Shelly 2.5 Roller Schutter automation

Hi everybody,

Last week I installed a Shelly 2.5 to operate my roller shutter. The Shelly is behind a physical switch (up/down) so that I can also operate the roller shutter with the switch. Everything is up and running. I added the Shelly to HA via the standard Shelly integration.

image

HA found 1 device with 11 entities.

In develeopertool/states i found 3 entities.

I can operate my roller shutter (up/down) via the Lovelace dashboard, but I have not yet succeeded in having this done via an automation. Who can help me?

image

Try this:

alias: close cover at sunset
description: ''
trigger:
  - event: sunset
    platform: sun
condition: []
action:
    domain: cover
    entity_id: cover.rolluik_woonkamer
    type: set_position
    position: 0
mode: single

this example should close the cover at sunset.
Depending on how you Shelly is configured you might change position 0 with 100 to get the result you want (inverted cover)

or set up the automation via the UI and select device => your cover (entity starting with cover.) and then select the position via the slider.

The only problem I run into is that the Shelly cannot be calibrated. This probably has something to do with the type of motor in my roller shutter. So… I can’t use the Shelly’s positioning controls. It is only open or closed. I can operate this excellently with the buttons on my Lovelace dashboard. But I want to automate the shutter using HA. And for some reason that doesn’t work for me.

Did you try to use the services cover.close_cover and cover.open_cover?
You can try this in developer tools and also integrate it in automations.
With

service: cover.close_cover
data: {}
target:
  device_id: your_device_id
2 Likes

That works! Thanks!

Sorry to break in.
where exactly should this code be placed? In configuration.yaml file?

Because I have Shelly 2.5 switches. But when I create an automation via “configuration - automation & scenes”
I created an automation there that should make my shutters close at sunset but nothing happens at all.
So maybe this code can help.

No, this code is the code of the automation. So if you go to configuration - automation and select your automation and then click edit as YAML, you can paste this code. Please note that you need to change the entity_id to the name of your cover.

1 Like

Thanks for the reply. I figured it out via “automations & scenes” in the configuration panel.

I created this automation, but nothing happens and it gives me this error in the log

#################################################
#                                               #
#                Tapparelle.                    #
#                                               #
#################################################
- alias: "Apertura tapparella ingresso"
  id: "apertura_tapparella_ingresso"
  trigger:
    platform: time
    at:
      - "12:13:00"
  condition: []
  action:
    domain: cover
    entity_id: cover.shelly_shsw_25_68d694
    type: set_position
    position: 0
    mode: single


Logger: homeassistant.config
Source: config.py:508
First occurred: 12:41:24 (1 occurrences)
Last logged: 12:41:24

Invalid config for [automation]: Unable to determine action @ data[‘action’][0]. Got None. (See /config/configuration.yaml, line 12).

type or paste code here