Shelly Roller close value

Hi to all, i have one prblem, i’m configure the shelly 2.5 in roller mode with mqtt (create cover.yaml) and set the position_open: 12 - position_close: 95.

but when i call “google” for closed/open the position is not respected.

this my cover

  - platform: mqtt
    name: Tapparella Salone
    command_topic: "shellies/shellyswitch25-TAPPSALONE/roller/0/command"
    position_topic: "shellies/shellyswitch25-TAPPSALONE/roller/0/pos"
    set_position_topic: "shellies/shellyswitch25-TAPPSALONE/roller/0/command/pos"
    availability_topic: "shellies/shellyswitch25-TAPPSALONE/online"
    payload_available: "true"
    payload_not_available: "false"
    qos: 1
    retain: false
    payload_open: "open"
    payload_close: "close"
    payload_stop: "stop"
    position_open: 95
    position_closed: 12

Anyone have this issue?

i don’t know the problem in thi configuration

position_open / positio_closed are inputs. They tell HA that the MQTT cover should considered closed at position 12 and opened at position 95.

If you want to override the open / close commands with specific positions, you’ll need to to define a template switch that, instead of sending open/close commands, sends appropriate set_position commands depending on the state of the template switch.

i would like send comand with google home " hey google close all roller shutter" and the roller go to “position_closed”

I got that.
And I told you above what you’d need to do to achieve that: create a template switch.

Something like:

# Example configuration.yaml entry
switch:
  - platform: template
    switches:
      cover_salon:
        value_template: "{{ state_attr('cover.tapparella_salone', 'current_position ')|int > 12 }}"
        turn_on:
          service: cover.set_cover_position
          target:
            entity_id: cover.tapparella_salone
          data:
            position: 95            
        turn_off:
          service: cover.set_cover_position
          target:
            entity_id: cover.tapparella_salone
          data:
            position: 12            

You can also create a full template cover:

meanwhile, thank you so much for your help. I am a novice and honestly I don’t understand much. I implemented google home without nabucasa and exposed the domains. the roller shutter entity in google home is seen. now I have implemented the template suggested by you and the result is the same, open the shutters goes to 100, close the shutters goes to 0. surely I did something wrong, but I can’t understand how to control the switch template via google home.

this my google home in configuration.yaml

google_assistant:
  project_id: the id
  service_account: !include file.json
#  api_key: !secret api_key_google
  report_state: true
  exposed_domains:
    - light
    - switch
    - climate
    - cover

this my iclude in configuration.yaml

####### FILE CONFIGURAZIONI########
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
light: !include light.yaml
sensor: !include sensor.yaml
cover: !include cover.yaml
binary_sensor: !include binary_sensor.yaml
climate: !include climate.yaml
switch: !include switch.yaml
camera: !include cameras.yaml
group: !include groups.yaml

this my cover.yaml

######### TAPPARELLA SALONE######
  - platform: mqtt
    name: Tapparella Salone
    command_topic: "shellies/shellyswitch25-TAPPSALONE/roller/0/command"
    position_topic: "shellies/shellyswitch25-TAPPSALONE/roller/0/pos"
    set_position_topic: "shellies/shellyswitch25-TAPPSALONE/roller/0/command/pos"
    availability_topic: "shellies/shellyswitch25-TAPPSALONE/online"
    payload_available: "true"
    payload_not_available: "false"
    qos: 1
    retain: false
    payload_open: "open"
    payload_close: "close"
    payload_stop: "stop"
    position_open: 95
    position_closed: 5
    
######## TAPPARELLA CUCINA ########
  - platform: mqtt
    name: Tapparella Cucina
    command_topic: "shellies/shellyswitch25-TAPPCUCINA/roller/0/command"
    position_topic: "shellies/shellyswitch25-TAPPCUCINA/roller/0/pos"
    set_position_topic: "shellies/shellyswitch25-TAPPCUCINA/roller/0/command/pos"
    availability_topic: "shellies/shellyswitch25-TAPPCUCINA/online"
    payload_available: "true"
    payload_not_available: "false"
    qos: 1
    retain: false
    payload_open: "open"
    payload_close: "close"
    payload_stop: "stop"
    position_open: 95
    position_closed: 5

and this my switch.yaml

- platform: template
  switches:
    cover_salone:
      value_template: "{{ state_attr('cover.tapparella_salone', 'current_position ')|int > 5 }}"
      turn_on:
        service: cover.set_cover_position
        target:
          entity_id: cover.tapparella_salone
        data:
          position: 95
      turn_off:
        service: cover.set_cover_position
        target:
          entity_id: cover.tapparella_salone
        data:
          position: 5
  1. Does the switch work?
  2. After syncing, you should have an additional HA item in google home
  3. You can give it a nice name (and aliases) via Google Assistant - Home Assistant and possibly hide the mqtt one

Personal examples:

  entity_config:
    switch.plug_tuya_01:
      expose: false
    switch.venus_wol:
      name: Vénus
      room: Salon
      aliases:
        - PC

when i tap the switch the cover go to 95% open and i retap the switch no have action

on my google home app i see only cover device

i delete and integrate the google home, but gave the same problem.

I don’t understand the reason for not reading the “position_closed”.
Theoretically when I say to close he should go to read the parameter set via mqtt and not bring it to 0

I cannot understand the reason for the problem, the configuration has not changed and for a short time it worked smoothly.

Now it only reads 0% and 100%