Shelly 2 as roller shutter with percentage


#15

It can be very confusing if in the same topic (opened using english) people from all over the world replies in different languages.


#16

Ah ok !! It’s correct !


#17

@Florian Thanks a lot! This is really helpful. Could you please also share any resources on how to wire it to motor and actually what motors are known to be supported (or at least supposed to work)? I’m considering to replace rm-mini (ir) controlled Forest Shuttle M drapery motor (https://www.forestgroup.com/products/Shuttle.html) with shelly2 to have actual state. My research got nothing real so far.


#18

I’m not much of a help in regard to choosing the best motor. It was mentioned that the motor must turn itself of when reaching the open/close states to enable the shelly calibration. That might change in the future since the shelly devs are always optimizing the product.

Otherwise I think the “dumber” the motor, the easier the shelly integration. I the motor itself has some kind of “smartness” in it (and the linked motor sound like that, e.g. “Full automatic setting of the limits.”) it might be harder to integrate since both shelly and the motor itself try to calibrate from time to time…


#19

Were you able to connect the motor? Can you please share the connection?

Does the slider works?

Tks!


#20

Nope, I still haven’t tried.
I’m waiting for the others Shelly 2 to arrive, hope soon, and I will install them all.


#21

I’ve installed the first Shelly 2 as a roller shutter and it work flawlessy to open and close completely the blind.

I’ve done the calibration process from the app, but I don’t understand how to do it with HA.

My cover configuration is

  - platform: mqtt
    name: "Tenda sala"
    command_topic: "shellies/shellyswitch-xxxxxx/roller/0/command"
    position_topic: "shellies/shellyswitch-xxxxxx/roller/0/pos"
    set_position_topic: "shellies/shellyswitch-xxxxxx/roller/0/command/pos"
    qos: 1
    retain: false
    payload_open: "open"
    payload_close: "close"
    payload_stop: "stop"
    position_open: 100
    position_closed: 0
    optimistic: false

With MQTT and Shelly 2 I can use this status and this command for positioning:

* `shellies/shellyswitch-<deviceid>/roller/0/pos`  reports the current positionin percent
* `shellies/shellyswitch-<deviceid>/roller/0/command/pos`  accepts a number between 0 and 100, which is target position in percent.

Do I need to modify anything in the cover template according to this?

I have this as input_number

  slider_tenda_sala:
    name: Apertura Tenda sala
    icon: mdi:window-maximize
    min: 0
    max: 100
    step: 5

And this as automation

- id: tenda_sala
  alias: Tenda sala
  trigger:
    platform: template
    value_template: "{{ states.cover.tenda_sala }}"

  action:
    service: input_number.select_value
    data_template:
      entity_id: input_number.slider_tenda_sala
      value: '{{trigger.template}}'

- id: tenda_sala_movimento
  alias: Tenda sala movimento
  trigger:
    platform: state
    entity_id: input_number.slider_tenda_sala

  action:
    service: cover.set_cover_position
    data_template:
      entity_id: cover.tenda_sala
      value: '{{trigger.state}}'

Any help?

Thanks


#22

It is enough to get the cover work. If you like to know if the device is available or not you have to add three more properties to the definition (see my post above).

You will see the slider, after clicking on the device in the web interface. You do not need an additional input_number to do this.

This is an automation example I’m using:

- alias: 'Close most slats when the sun gets dim'
  id: 'cmswtsgd'
  trigger:
    platform: sun
    event: sunset
    offset: '-00:45:00'
  action:
    service: cover.set_cover_position
    entity_id: cover.bedroom_cover
    data:
      position: 14

#23

Thanks @Florian

The fact is that is not working also from the Services panel

I’ve tried the value with and without quotes, but nothings happens

And I don’t have the slider

42

EDIT:

What I get is this warning
32


#24

My BIG BIG fault!!!

I was modifying the file cover.yaml, while in configuration.yaml was not referenced, but there was an old definition of the cover without the percentage.

Now it works like a charm!!!


#26

Hi woody4165!

Did you update the shelly2 firmware with the beta version?
Thanks!


#27

No, I have 1.4.4


#28

I’ve been watching this thread for a while and finally got around to updating the firmware on my Shelly. All works fine from the Shelly web server with regard to positioning but I don’t see the slider in HA.

I copied your definition, overwriting my original, and just changed the name and Shelly number. Still no slider.

After HA restart, the Shelly was unavailable to HA. Rebooting the Shelly had the Up, Stop and Down icons appear, with the Down greyed out (which is new and useful). But still no slider.

I’m not sure where to go from here to get the slider to show up.

Screen2019-01-14_07-39-02_pm

  - platform: mqtt
    name: "Garage Door"
    command_topic: "shellies/shellyswitch-xxxxxx/roller/0/command"
    position_topic: "shellies/shellyswitch-xxxxxx/roller/0/pos"
    set_position_topic: "shellies/shellyswitch-xxxxxx/roller/0/command/pos"
    availability_topic: "shellies/shellyswitch-xxxxxx/online"
    payload_available: "true"
    payload_not_available: "false"
    qos: 1
    retain: false
    payload_open: "open"
    payload_close: "close"
    payload_stop: "stop"
    position_open: 100
    position_closed: 0
    optimistic: false

It all operates fine and I can open/close it to a position by publishing to the pos topic, but no slider!

Not that I need a slider for a garage door but I have an awning to control too.

Any ideas?


#29

As @Florian said some posts before, you will see the slider after clicking on the device in the web interface.
So click on the Garage door and you will see the slider.

I also suggest you to add this

value_template: '{{ value.x }}'

at the end of the configuration, so you won’t have the fact that one of the button (Up/Stop/Down) will be grayed out.

Why do you think is useful to have it grayed out?


#30

Thanks!

If the down arrow is greyed out it means the door is closed.

However, if I had the slider there that would be redundant.

The slider only shows up when clicking it, which is not much use for an overview. Is that how it shows up for you too?

Screen2019-01-14_08-05-48_pm


Shelly Cloud - new Component? How to implement it? API is available
#31

To avoid the “unavailable” state you should add an automation to get the current state of all your shellies at home assistant’s start:

- alias: 'Shelly Status Info at Start'
  id: ssias
  trigger:
    - platform: homeassistant
      event: start
  action:
    - service: mqtt.publish
      data:
        topic: 'shellies/command'
        payload: 'update'

Yes. You may be able to directly display it in the Lovelace UI but i did not try this.


#32

That’s excellent. Thank you.


#33

I’m trying to have the cover position slider show up in a group rather than having to click the entity.

It passes config check but instead of publishing the input_number position to the Shelly it publishes “{{ states(‘input_number.awning_position’) | int }}”, the value template itself.

Where am I going wrong here?

- alias: 'Set awning position'
  trigger:
    - platform: state
      entity_id: input_number.awning_position
  action:
    - delay: '00:00:3'
    - service: mqtt.publish
      data_template:
        topic: 'shellies/shellyswitch-xxxxxx/roller/0/command/pos'
        retain: true
        payload: "{{ states('input_number.awning_position') | int }}"

Found it!

I had data: instead of data_template:.

Now works fine, so I have:

Screen2019-01-16_09-52-29_pm


#34

If you are using Lovelace, you can do it easily like this using slider-entity plugin

          - entity: cover.tenda_sala
            name: Tenda sala
            icon: mdi:blinds
          - type: custom:slider-entity-row
            entity: cover.tenda_sala
            full_row: true

20


#35

Thank you.

I don’t have Lovelace. It’s a lot of faffing around for little gain for me. Although I accept that I’ll be forced to use it soon.