Control my blinds

I have blinds that i can control with a url. will close the blinds and wil open the blinds.
How can I control the blind in home assistant?
I have tried the next lines in configuration.yaml, but then the blind will open every 30 seconds:


What is the best way to configure the blinds?

Hi and welcome to the forums.

Please read point 11 here about formatting your post correctly.

You need to split the resource into these parts:

  platform: rest
  name: luxaflex open
  body_on: 'ws=50'
  body_off: 'ws=90'

If there is some way you can interrogate the blind for its current state it would also be beneficial to add an is_on_template


I’d suggest adding your blinds as cover entities, so they look a little nicer in the UI (Up and down arrow instead of 2 switches).
For that, we need to do two things:

  1. Add the Open and Close command as a rest_command
  2. Add the cover as a template cover

Number 1:

    url: >-
      {% if direction == "up" %}
      {% elif direction == "down" %}
      {% endif %}

This will create a service rest_command.blinds which we can call. The direction parameter will set the direction.
Now, we have to create a template cover:

  - platform: template
      bedroom_left: # Change this to sth. you like (one word, lowercase)
 # Check for available device classes
        device_class: blind
        friendly_name: "Bedroom Left" # This name will show up in the UI
          service: rest_command.blinds
            direction: up
          service: rest_command.blinds
            direction: down

Home Assistant has more features to offer for blinds, like setting the blinds to a certain percentage, stopping them, etc.
Is there a URL you can go to to fetch the current position?
Also - Which blinds are you using? Maybe there’s a better way of integrating them.

@tom_l Looking at the documentation for a rest switch, I’m wondering if your YAML will work - the URLs seem to require a GET request, which isn’t supported by the switch integration, and the body_on and body_off are the POST payload data, aren’t they? :thinking:
Perhaps I’m getting something wrong though.

1 Like

Yes you are right. I’ve been caught with that before and have obviously learnt nothing :slightly_frowning_face:

Your suggestion is much better. :+1:

Thanks . The cover works great.

The blinds are controlled by a ESP8266. The blinds are not going up or down, but the angle of the sheets are changing by the number giving by ws. (0=sheets are at 20 degrees ,50=sheets are horizontal,90=160 degrees)

Ah, I see :slight_smile:
Well, maybe a bit of a surprise, Home Assistant supports that natively as well :smiley:
Take a look at the tilt position service. To use this effectively, you should have a linear scale of angles (increasing the number by one should add a fixed number of degrees).

If you are the one who programmed the ESPs, you might want to look into using ESPHome, more specifically, one of their Cover components.
ESPHome integrates natively with Home Assistant, if they are on the same network, Home Assistant even auto-discoveres ESPHome devices and presents the entities automatically :slight_smile:
More than that, you don’t even need to install anything on your computer for that, with the ESPHome addon, you can program the ESP8266/ESP32 directly from the Web UI :partying_face:

First I control the blinds by Google Home and IFTTT. But it don’t work so well in dutch anymore, so I will try home assistant.

I will look into ESPHome. Tanks for the tip.

1 Like