Blinds controll

Hi

Do someone know how I can create this buttons? To control some blinds (I don´t know the name to search it)

error

Your entity needs to be a cover.

Then simply add it to an entities card.

If you already have seperate switches you would like to make into a cover, use this:

Thanks!

But how can I controlled with MQTT?

What mqtt entities do you have?

I don´t have mqtt entities ( I only have ESP8285 listening their topics), I think that this would work:

cover:
  - platform: template
    covers:
      garage_door:
        friendly_name: "Garage Door"
        value_template: "{{ states('sensor.garage_door')|float > 0 }}"
        open_cover:
          service: mqtt.publish
          data:
            topic: "LV-Automation/luis/cover"
            payload: Up
        close_cover:
          service: mqtt.publish
          data:
            topic: "LV-Automation/luis/cover"
            payload: Down
        stop_cover:
          service: mqtt.publish
          data:
            topic: "LV-Automation/luis/cover"
            payload: Stop
1 Like

Ad the blind device_class too. https://www.home-assistant.io/integrations/cover.template/#device_class

is says error…

Invalid config for [cover.template]: [device_class] is an invalid option for [cover.template]. Check: cover.template->device_class. (See ?, line ?). 
cover:
  - platform: template
    device_class: curtain
    covers:
      garage_door:
        friendly_name: "Garage Door"
        value_template: "{{ states('sensor.garage_door')|float > 0 }}"
        open_cover:
          service: mqtt.publish
          data:
            topic: "LV-Automation/luis/cover"
            payload: Up
        close_cover:
          service: mqtt.publish
          data:
            topic: "LV-Automation/luis/cover"
            payload: Down
        stop_cover:
          service: mqtt.publish
          data:
            topic: "LV-Automation/luis/cover"
            payload: Stop

Also do you know why it´s blocked the down arrow?

image

Because it is down/closed already?

This depends on your state template:

value_template: "{{ states('sensor.garage_door')|float > 0 }}"

You have the device class in the wrong place. Put it here:

cover:
  - platform: template
    covers:
      garage_door:
        friendly_name: "Garage Door"
        device_class: curtain
        value_template: "{{ states('sensor.garage_door')|float > 0 }}"

Why do you want a curtain device class for a garage door?

Haha I only copy the example, I need to change the name.

About the state… in this moment the ESP that I´m using doesn´t publish the state, do you know how catch the state from a MQTT Topic?

I just relalised there is an MQTT cover. You should use this instead of the template cover. It may be a lot easier:

I did look for one last night but obviously not well enough.

Alternatively if you use ESPHome (and it’s API) on your ESP instead of mqtt you get sensors integrated into home assistant without having to make them (discovery). Then you would use the template cover.

Thanks!

Yes I know about ESPHome, but I like to have a little bit more controll of the hardware, it´s why I like to program it from cero hehe

Do you know why with the mqtt cover the icon doesn´t update according to the state that the blind send? if I´m sending “opening”, “open”, “closing” and “closed” in the state topic according to the realtime state