Shelly 2 as roller shutter with percentage

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!!!

1 Like

Hi woody4165!

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

No, I have 1.4.4

1 Like

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?

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?

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

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.

2 Likes

That’s excellent. Thank you.

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

2 Likes

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

1 Like

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.

got you, thanks )

Is the following possible? if I only want the minimum of the cover to go to 10% and maximum to 90%, how would I configure this? Eg. if the slider is completely to the left, cover goes to 10% (not 0%) and if the slider is completely to the right the cover goes to 90% (not 100%).

Probably, you need to create a new slider and set the range from 10 to 90 connected to the shelly entity

Hi @woody4165
I also installed the shelly 2, I put the configuration code in the config.yaml file and everything works.
But I was looking at the next piece of code you wrote and I do not understand what it’s for. Also and where do you have to write it? in the File config.yaml?

What is this code for?

and what does this automatism?

thank you in advance.

Hi @destroyer76

since I was having an issue (a false one solved easily) I created a slider, that is not needed because already showed in the entity.

Same thing for automation, so please do not consider both piece of code.

hi @woody4165
thank’s a lot !

hi @ashscott and hi @woody4165
I wanted to do the same thing:

I have this code

  • alias: ‘Imposta Posizione Tapparella’
    trigger:
    • platform: state
      entity_id: input_number.slider_tapparella
      action:
    • delay: ‘00:00:3’
    • service: mqtt.publish
      data_template:
      topic: ‘shellies/shellyswitch-xxxxxx/roller/0/command/pos’
      retain: true
      payload: “{{ states(‘input_number.slider_tapparella’) | int }}”

input_number:
slider_tapparella:
name: Posizione Tapparella
min: 0
max: 100
step: 1

and so I see the slider correctly in the group but if I open the shutter from the button or from within the entity, the slider remains with the old value. How can I update the value of the slider in the group when I open or close the shutter with other functions?

I understand what you want to do but I haven’t implemented that yet.

You need to get the position that the Shelly thinks it’s at from:

position_topic: “shellies/shellyswitch-xxxxxx/roller/0/pos”

And then set your input_number to that value.

Should be fairly straightforward, I’d have thought, but I’ve not looked into it myself, yet.

in fact, I also think it should not be complicated. The function is the one that told you, only I do not know how to implement it :slight_smile:
Do I have to do an automatism?
If so what trigger should I do?