Shelly 2 as roller shutter with percentage

Finally i was able to made shelly works fine in roller mode with position in percent.

But i can’t find a way to get roller power consumption .

This is my code after searching in shelly’s API docs:

cover:
  - platform: mqtt
    name: persiana_estudio
    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"
    payload_open: "open"
    payload_close: "close"
    payload_stop: "stop"
    retain: false
    optimistic: false
    qos: 1
    position_open: 100
    position_closed: 0
sensor:
  - platform: mqtt
    name: "Potencia"
    state_topic: "shellies/shellyswitch-XXXX/roller/power"
    unit_of_measurement: "W"

Has anybody a clue of what i’m doing wrong?

I’m now experiencing this same issue with it randomly opening.

Could you please post the config your using that cured it?

This is my code and it’s working fine

  - platform: mqtt
    name: "Tapparella Finestra 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"
    availability_topic: 'shellies/shellyswitch-xxxxxx/online'
    unique_id: 'Shelly Tapparella finestra sala'
    qos: 0
    retain: false
    payload_open: "open"
    payload_close: "close"
    payload_stop: "stop"
    payload_available: 'true'
    payload_not_available: 'false'
    position_open: 100
    position_closed: 0
    optimistic: false
2 Likes

Thanks a lot. Apart from Unique ID, that’s what I have.

What settings do you have on the Shelly 2 with regard to Clean and Retain?

It’s driving me nuts that I get these random openings. If I remove the MQTT settings on the Shelly it’s fine so it’s being ‘told’ to open from somewhere.

Clean is flagged and Retain is not flagged and QOS is 0

If it’s random opening most probably is the retain

That’s the opposite of what I have but my garage door is set with Retain flagged and Clean not and I don’t have a problem with that.

I also have Power On Parameters set to STOP, though I don’t think it’s a power on issue.

The hunt continues!

If you have retain and you have a message sent when there is a connection failure, the message will be executed when the connection will come back.
And this can happen any time.

What is the QOS value you have?

Maybe the garage has a better wifi signal than the other shelly.

Thanks.

QOS is set to 0.

So, with Clean, it will alway wait for a new command, even on Power UP, is that correct?

Although, now that I think about it, I’ve now sent it any commands and it’s still randomly opened. I suspect that it’s something to do with the Position Slider as it doesn’t open fully.

I’ll set it to Clean and see what happens.

You can take a look at this article, at the end there is a table that describes all the possibilities between retain, QOS and clean session…

Thanks for that. A really informative article.

I’m monitoring publications to the two command topics. It seems ‘80’ is being published to the position topic but so far I’ve no idea where from.

Hi guys,

with the following configuration everything works fine.
But in my log i found the following statement
cover:

  • platform: mqtt
    name: “Jalousie Kueche”
    state_topic: “shellies/shellyswitch-x/roller/0”
    command_topic: “shellies/shellyswitch-x/roller/0/command”
    position_topic: “shellies/shellyswitch-x/roller/0/pos”
    set_position_topic: “shellies/shellyswitch-x/roller/0/command/pos”
    payload_open: “open”
    payload_close: “close”
    payload_stop: “stop”
    retain: false
    optimistic: false
    qos: 1
    position_open: 100
    position_closed: 0
    value_template: ‘{{ value.x }}’
    I got also the position and every time the status of the Shelly.
    But i found something strange in my log.
    Can anyone help me what is here the problem?

Payload is not integer within range: -1
13:43 components/mqtt/cover.py (WARNING)

Maybe it’s because it assumes a value outside the range 0-100.
Try to do again a calibration.

Before, you can try to comment the line value_template: and see if there is the warning and everything works fine.

Thanks, that was the issue.
I calibrate the stuff again and the error is now solved.
Thanks @woody4165

Home%20Assistant%202019-03-09%2019-51-58

Hi everybody,
I’m quite new with home-assistant. I was wondering if anybody could sum-up the configuration to get the shelly2 roller shutter with slider, I had a hard time following the conversation.
Thanks!

My working configuration is here, but you can find a lot in this thread.

I get again the following issue from my log files.
My shutter is successfully calibrated.
Can anyone help me what is here the problem?

Payload is not integer within range: ‘’
08:24 components/mqtt/cover.py (WARNING)

wrong post , see below

Fixed with the following config:

cover:
platform: mqtt
name: “xx”
command_topic: “shellies/shellyswitch-x/roller/0/command”
position_topic: “shellies/shellyswitch-x/roller/0/pos”
set_position_topic: “shellies/shellyswitch-x/roller/0/command/pos”
availability_topic: ‘shellies/shellyswitch-x/online’
qos: 0
retain: false
payload_open: “open”
payload_close: “close”
payload_stop: “stop”
payload_available: ‘true’
payload_not_available: ‘false’
position_open: 100
position_closed: 0
optimistic: false
1 Like

Hi

This is working I get the arrow for up and down right. When all up the up arrow gets grey. So far so good. But it seems like the position is backwards 100% = fully open. I would lika the oppistie.

When fully open I like it to be 0% and 100% when fully closes.

I tried o for close and 100 for open, but then the arrow up and down get mixed so i thinks its open when closed and vice verse.

And what about qos? I ve put 0 in the mqtt settings on the shelly device. I have no clue what is the right number,

  • platform: mqtt
    name: ‘Rullgardin dörr’
    command_topic: “shellies/shellyswitch-XXXXX/roller/0/command”
    position_topic: “shellies/shellyswitch-XXXXX/roller/0/pos”
    set_position_topic: “shellies/shellyswitch-XXXXX/roller/0/command/pos”
    availability_topic: “shellies/shellyswitch-XXXXX/online”
    payload_available: “true”
    payload_not_available: “false”
    qos: 2
    retain: false
    payload_open: “open”
    payload_close: “close”
    payload_stop: “stop”
    position_open: 100
    position_closed: 0
    optimistic: false

You can have a look at this article to better understand the QOS