Shelly 2.5 Roller mode get the buttons state as cover entities

Hello

Currently, the Shelly integration does not get the information about the buttons position for Shelly 2.5 in roller mode.
This is sometimes important, because the buttons can be overwritten by a later command from the phone or APIs, so that the button position will not match with the Shutter/Blinds position.

Adding the buttons position(already available through shelly APIs) would enable us to create automations which check and ensure the correct position based on the button position.

The status of the buttons are reported on the shelly /status page at {inputs: {input: 0/1…}, {input: 0/1…} }

Thank you.

Did you look at the device the shelly integration creates and see if it has any disabled entities?

My shelly has some disabled-by-default entities called “input”, maybe that is what you are looking for.

Hi Tim

Yes I’ve looked there, but I have no “input” entities on my 2.5, and that’s because it’s in roller mode. If you have it in switch mode you have the input available, but not in roller mode.

The properties are not defined in code, for rollers/cover, and I have double checked it here:

See the line 161,166, 174, 179… those are python class properties… basically the status of the device entities. There is nothing related to inputs… it’s just missing.

Hi, I’m having the same issue and would also need these inputs.

My simple use case: My kitchen light switch is not actually in the kitchen (makes sense, I know :crazy_face:) but the roller is right at the countertop. So I would like to “double use” the switches for opening and closing the shutter: When the shutter Is already fully closed and I flip the switch to close it, I would like that to toggle the kitchen lights (and the same for when the cover is open and I hit the open-switch again). This would give me a physical switch right inside the kitchen where I’m working that I could use to toggle the lights.

Hey,
Same problem here. but I found a solution doing an automation.

In my case I want to use the same button to open and close the blind with double click. (I use the single click to turn on/off the light)

This code is to configure a Swith with 4 physical buttons to your ESP8266/Nodemcu

esphome:
  name: dormitorio_cabecera
  platform: ESP8266 
  board: nodemcuv2

wifi:
  ssid: "your_ssid"
  password: "your_password"
  manual_ip:
    static_ip: 192.168.1.99
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Cabecera_Fallback_Hotspot"
    password: "password"


captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

# ********** Pulsadores ********** #

text_sensor:
  - platform: template
    name: Scene Button 1
    id: scene_button_1
    lambda: |-
      return {"Released"};
  - platform: template
    name: Scene Button 2
    id: scene_button_2
    lambda: |-
      return {"Released"};
  - platform: template
    name: Scene Button 3
    id: scene_button_3
    lambda: |-
      return {"Released"};
  - platform: template
    name: Scene Button 4
    id: scene_button_4
    lambda: |-
      return {"Released"};

### BotĂłn 1 ###      
 
binary_sensor:
  - platform: gpio
    pin:
     number: D4
     mode: INPUT_PULLUP
     inverted: true
    name: "Scene Button 1"
    internal: true
   
    filters:
     delayed_on_off: 50 ms

    on_multi_click:
    
    - timing:
        - ON for at least 1s
        - OFF for at least 1s
      then:
      - text_sensor.template.publish:
            id: scene_button_1
            state: "Hold"
      -  delay: 2 s
      - text_sensor.template.publish:
            id: scene_button_1
            state: "Released"
       
    - timing:
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
        - text_sensor.template.publish:
            id: scene_button_1
            state: "Clicked"
        -  delay: 2 s
        - text_sensor.template.publish:
            id: scene_button_1
            state: "Released"
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
      - text_sensor.template.publish:
            id: scene_button_1
            state: "Double Clicked"
      -  delay: 2 s
      - text_sensor.template.publish:
            id: scene_button_1
            state: "Released"     
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
       - text_sensor.template.publish:
            id: scene_button_1
            state: "Tripple Clicked"
       -  delay: 2 s
       - text_sensor.template.publish:
            id: scene_button_1
            state: "Released"
        
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
         - text_sensor.template.publish:
            id: scene_button_1
            state: "Fourth Clicked"
         -  delay: 2 s
         - text_sensor.template.publish:
            id: scene_button_1
            state: "Released"

### BotĂłn 2 ###

  - platform: gpio
    pin:
     number: D2
     mode: INPUT_PULLUP
     inverted: true
    name: "Scene Button 2"
    internal: true
   
    filters:
     delayed_on_off: 50 ms

    on_multi_click:
    
    - timing:
        - ON for at least 1s
        - OFF for at least 1s
      then:
      - text_sensor.template.publish:
            id: scene_button_2
            state: "Hold"
      -  delay: 2 s
      - text_sensor.template.publish:
            id: scene_button_2
            state: "Released"
       
    - timing:
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
        - text_sensor.template.publish:
            id: scene_button_2
            state: "Clicked"
        -  delay: 2 s
        - text_sensor.template.publish:
            id: scene_button_2
            state: "Released"
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
      - text_sensor.template.publish:
            id: scene_button_2
            state: "Double Clicked"
      -  delay: 2 s
      - text_sensor.template.publish:
            id: scene_button_2
            state: "Released"     
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
       - text_sensor.template.publish:
            id: scene_button_2
            state: "Tripple Clicked"
       -  delay: 2 s
       - text_sensor.template.publish:
            id: scene_button_2
            state: "Released"
        
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
         - text_sensor.template.publish:
            id: scene_button_2
            state: "Fourth Clicked"
         -  delay: 2 s
         - text_sensor.template.publish:
            id: scene_button_2
            state: "Released"


### BotĂłn 3 ###

  - platform: gpio
    pin:
     number: D3
     mode: INPUT_PULLUP
     inverted: true
    name: "Scene Button 3"
    internal: true
   
    filters:
     delayed_on_off: 50 ms

    on_multi_click:
    
    - timing:
        - ON for at least 1s
        - OFF for at least 1s
      then:
      - text_sensor.template.publish:
            id: scene_button_3
            state: "Hold"
      -  delay: 2 s
      - text_sensor.template.publish:
            id: scene_button_3
            state: "Released"
       
    - timing:
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
        - text_sensor.template.publish:
            id: scene_button_3
            state: "Clicked"
        -  delay: 2 s
        - text_sensor.template.publish:
            id: scene_button_3
            state: "Released"
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
      - text_sensor.template.publish:
            id: scene_button_3
            state: "Double Clicked"
      -  delay: 2 s
      - text_sensor.template.publish:
            id: scene_button_3
            state: "Released"     
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
       - text_sensor.template.publish:
            id: scene_button_3
            state: "Tripple Clicked"
       -  delay: 2 s
       - text_sensor.template.publish:
            id: scene_button_3
            state: "Released"
        
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
         - text_sensor.template.publish:
            id: scene_button_3
            state: "Fourth Clicked"
         -  delay: 2 s
         - text_sensor.template.publish:
            id: scene_button_3
            state: "Released"


### BotĂłn 4 ###

  - platform: gpio
    pin:
     number: D1
     mode: INPUT_PULLUP
     inverted: true
    name: "Scene Button 4"
    internal: true
   
    filters:
     delayed_on_off: 50 ms

    on_multi_click:
    
    - timing:
        - ON for at least 1s
        - OFF for at least 1s
      then:
      - text_sensor.template.publish:
            id: scene_button_4
            state: "Hold"
      -  delay: 2 s
      - text_sensor.template.publish:
            id: scene_button_4
            state: "Released"
       
    - timing:
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
        - text_sensor.template.publish:
            id: scene_button_4
            state: "Clicked"
        -  delay: 2 s
        - text_sensor.template.publish:
            id: scene_button_4
            state: "Released"
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
      - text_sensor.template.publish:
            id: scene_button_4
            state: "Double Clicked"
      -  delay: 2 s
      - text_sensor.template.publish:
            id: scene_button_4
            state: "Released"     
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
       - text_sensor.template.publish:
            id: scene_button_4
            state: "Tripple Clicked"
       -  delay: 2 s
       - text_sensor.template.publish:
            id: scene_button_4
            state: "Released"
        
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 1s
      then:
         - text_sensor.template.publish:
            id: scene_button_4
            state: "Fourth Clicked"
         -  delay: 2 s
         - text_sensor.template.publish:
            id: scene_button_4
            state: "Released"

Once your arduino is connected to your hassio. Go to Automations and create 2 different automations.

1st automatition to open the roller with double click:

actions:

2nd Automatization to stop the roller if the status is opening.

actions + condition:

I hope this can be usefull for someone. It takes me hours to find the solution.

If you need further information feel free to contact me.

Load “”

1 Like