Shelly 2 as roller shutter with percentage

Thats great!
The slider should automatically be added by this component. Did you calibrate you Shelly already? First you need to calibrate them with the Shelly App, then you will get the sliders in HA.

Yes on shelly app it works like a charm. I have position information in details of roller entity. I only have up stop down option in the card.
I have to click to have the slider

I want to be able to use the slider below the start stop up buttons like shown in this post.

Click on your roller shutter. When the window pop ups, do you see a slider? Can you post a screenshot?

Yes clicking on the roller it show up but I want to use it below the roller and not need to click on it before

This is also useful to see right on the view where is the rollers position.

Okay, at least we know that everything is fine and how it should be.

You can realize what you want to do with this custom component:

Install it with HACS, and change your entities than in Lovelace.

Have Fun!

That was exactly what I was looking for!
All solutions wore very easy to implement and make all the difference to my HA!!
Many thanks!

Hello, everybody,
I currently have two Shelly 2.5 configured as roles in my home automation.
With normal use everything works fine.

When I restart hass.io the shutters open to the 100% position and the last state is overwritten. Although in shelly the Power on parameter is set to “stop”.

The same happens when I restart the shelly manually.

But as soon as I deactivate mqtt on the shelly it works as desired. So it must be related to the mqtt-broker.
Have you ever had a similar problem?

My configuration:

---
  platform: mqtt
  name: "livingroom_shellyswitch25-xxxxxx"
  command_topic: "shellies/shellyswitch25-xxxxxx/roller/0/command"
  state_topic: "shellies/shellyswitch25-xxxxxx/roller/0"
  position_topic: "shellies/shellyswitch25-xxxxxx/roller/0/pos"
  set_position_topic: "shellies/shellyswitch25-xxxxxx/roller/0/command/pos"
  availability_topic: "shellies/shellyswitch25-xxxxxx/online"
  qos: 0
  retain: false
  payload_open: "open"
  payload_close: "close"
  payload_stop: "stop"
  state_open: "open"
  state_closed: "closed"
  payload_available: 'true'
  payload_not_available: 'false'
  position_open: 100
  position_closed: 0
  optimistic: false

The main problem is when I make the same changes in my configuration and I have to restart hass.io
 that could be a couple of times a day
 and all roles switch on from different positions -> women’s acceptance factor drops sharply :slight_smile:

Looks like there are retained topics on the MQTT broker. The retain flag for the shelly is IMHO only for the topics the shelly is publishing, but there could still be retained command or command/pos topics that the shelly subscribes to.

Other question: why do you even use mqtt for this? Why do you bother? Why don’t you add the shellys automatically with the component ?
I don’t see any benefit of mqtt when you have the component for implementation, and everything works perfect with it.

@hspem:
Do you have any idea how I can best debug this I used the mosquitto mqqt broker

  1. why do you even use mqtt for this?
    Communication via mqtt ist much fast than http request.

  2. Why don’t you add the shellys automatically with the component ?
    As a component you mean “ShellyForHASS”?
    As far as I know, the control there works via http or can be realized via mqtt.

Try

mosquitto_sub -v -h <ip of mqtt broker> -t '#' | grep shellyswitch25

without operating the shelly.

Look for command topics for your shelly

shellies/shellyswitch25-xxxxxx/roller/0/command
shellies/shellyswitch25-xxxxxx/roller/0/command/pos

Then look at this thread how to remove retained messages.

I don’t know how fast your communication should be, but I can tell you that the communication of my devices is as fast as pressing the manual button on the wall. ShellyForHass uses COAP (wich is based on Rest). But the biggest benefit is, that you don’t have to care about the settings or anything of MQTT. It just adds your Shellies to home assistant like a build-in integration. For me that’s the biggest benefit: Wiring my Shelly and have them completely included in home assistant, as soon as they are connect to wifi.

Hi,
I’ve tried everything with my Shelly 2.5 to stop the below error within the home-assistant.log. As per previous posts, it mentions calibrating the shutter. I have a problem with this since my roller shutter has an issue where the motor does not disengage when it is in the up position and I expect that this is leaving the state = -1.

2019-12-22 14:39:18 WARNING (MainThread) [homeassistant.components.mqtt.cover] Payload is not integer within range: -1
2019-12-22 14:39:48 WARNING (MainThread) [homeassistant.components.mqtt.cover] Payload is not integer within range: -1

My covers.yaml looks like this:-

  - platform: mqtt
    name: "Lounge Roller Shutter"
    command_topic: "shellies/shellyswitch25-6883ED/roller/0/command"
    position_topic: "shellies/shellyswitch25-6883ED/roller/0/pos"
    set_position_topic: "shellies/shellyswitch25-6883ED/roller/0/command/pos"
    availability_topic: "shellies/shellyswitch25-6883ED/online"
    qos: 1
    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

Try to write true and false without double quotes


I think I have a problem with the retain flag.

If I monitor the mqtt topic I can see how the commands are sent.

When I retrieve the topic again, there is a different value

monitoring shelly device:

mosquitto_sub -v -h 192.168.xxx.xxx -t '#' | grep shellyswitch25-xxxxxx/roller/

Command:

shellies/shellyswitch25-xxxxxx/roller/0/command close
shellies/shellyswitch25-xxxxxx/roller/0/pos 0

When I call up the topic again, I read the following:

shellies/shellyswitch25-xxxxxx/roller/0/command open
shellies/shellyswitch25-xxxxxx/roller/0/pos 100

How can that be?
I have posted my config above

I have looked at the topics with “MQTT Explorer” and found that the command topic has a retain flag set in the broker.
How this happens I can not explain!
I deleted the flag manually and it is not set anymore So I could solve my problem :slight_smile:

A good hint gave me this video:

MQTT Explorer

Hi

My Shelly 2 worked like a charm until 104.2 (latest) Hass.io. Now they are Unavailable!

Tried to set reatain to false in both configuration.yaml and in Shelly GUI.

Tried to take away the " " in configuration.yaml.

SO my code:

- platform: mqtt
    name: 'Rullgardin dörr'
    command_topic: "shellies/shellyswitch-55BD61/roller/0/command"
    position_topic: "shellies/shellyswitch-55BD61/roller/0/pos"
    set_position_topic: "shellies/shellyswitch-55BD61/roller/0/command/pos"
    availability_topic: "shellies/shellyswitch-55BD61/online"
    payload_available: true
    payload_not_available: false
    qos: 0
    retain: false
    payload_open: "open"
    payload_close: "close"
    payload_stop: "stop"
    position_open: 100
    position_closed: 0
    optimistic: false

And I have automations lite this.

- alias: Shelly Status Info at Start
  initial_state: true
  trigger:
  - platform: homeassistant
    event: start
  action:
  - service: mqtt.publish
    data:
      topic: shellies/command
      payload: update
- alias: Shelly sync at HA start
  initial_state: true
  trigger:
  - platform: homeassistant
    event: start
  action:
  - delay: 00:00:20
  - service: mqtt.publish
    data:
      topic: shellies/command
      payload: announce
  id: 291fccda42614c799e02288d56e07224
- alias: 'Shellies Discovery'
  trigger:
    - platform: mqtt
      topic: shellies/announce
  action:
    service: python_script.shellies_discovery
    data_template:
      id: '{{ trigger.payload_json.id }}'
      mac: '{{ trigger.payload_json.mac }}'
      fw_ver: '{{ trigger.payload_json.fw_ver }}'

I have tried all night yesterday to fix this but no luck,

Can someone help understand a couple of things.

When I run mosquitto add on I use my regular user. I only have one. It works almost great except the problem with shelly 2 above.

Are there any problems with using it this way? My user is administrator.

This *ucking reain flag?

I have 3 shelly 2 as roller shutter
I have 2 Shelly 1 has garage door cover
I have 5 shelly 1 as light
I have 2 shelly plug S as engergy and binary_template for dishwasher and laundry machine

All are configured in configuration . yaml.

All except the roller shutters have the retain set to true

What are the correct way here?

Mqtt was the most stable part of my system until 104.2 version it seems, would like to configure this right.

I don’t know if that has been solved yet. My Shelly 2.5 never sent something to the availability topic like the shelly1 switches do. Therefore shellies/shellyswitch-XXX/online" won’t be sent and Homeassistant will mark it as offline. I commented out the availability topic and both related payloads and the Shelly 2.5 works fine