Shelly 2 as roller shutter with percentage

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?

If you change to Lovelace, you can have it easily… :wink:

yes, I read that you used it. But now I am already learning to use Hasso, I would not complicate myself too much with another Interface.

So, do not upgrade to 0.86 because from this release Lovelace will become the standard UI.

Just saw, that it’s still possible to have previous UI at my-ip:8123/states

Lovelace just became the standard UI, so after upgrade you will be redirected to Lovelace

I think you need something like this:

automation:
  - alias: Set position slider
    trigger:
      platform: mqtt
      topic: 'shellies/shellyswitch-xxxxxx/roller/0/pos'
    action:
      service: input_number.set_value
      data_template:
        entity_id: input_number.position_slider
        value: "{{ trigger.payload }}"

I think that the slider should then follow the position the Shelly thinks it is at.

I’ve not tried it!