Windowblinds automation based on sun trigger

Hello,

I am a newbie on home assistant, and I have a question.

Could someone of you please help me configuring my window blinds automation.

I have a homemeatic window blind actor called (cover.ieq0148665).

With the following states:

ID: IEQ0148665
RSSI: -83
Working: No
current_position: 100
State: open

I would like to automate them, that they close automaticly 30min after sunset and that they open again at sunrise.

Could someone write me this codesample please ? :slight_smile:

Post what you have so far and we’ll help you figure out the issues.

Hello,

I found this example at: https://home-assistant.io/cookbook/automation_sun/

I tried to adapt it to my needs:


automation:
  - alias: 'close WindowBlinds.'
    trigger:
      platform: sun
      event: sunrise
      offset: '+00:30:00'
    action:
       service: IEQ0148665.close
    - alias: 'Open WindowBlinds'
    trigger:
      platform: sun
      event: sunset
      offset: '+00:00:00'
    action:
     service: IEQ0148665.open

This is what I tried, but I dont know what is wrong.

Thank you for your help.

Couple of things - first, be sure to use preformatted text when posting code so that it’s readable. Indentation is significant.

Also - it looks like you’ve got the wrong services. I don’t have blinds, so I’m not sure what the correct service is, but you can check the available services in the service dev tool in HASS (buttons at bottom of left-sidebar).

It looks like you’re combining services and entity_id’s. Take a look at that example - they’re controlling blinds with switch.turn_off

service: switch.turn_off
entity_id: switch.blind

switch.turn_off is a service available to every HASS install. switch.blind is particular to that users configuration. Use the states dev tool to see a list of all of the entity_id’s that are available in your setup.

thank you for your answer.

  1. Thank you for notice about preformatted text, I edited my post

  2. Thank you too for the hint about the dev service tool, I found out that the cover services uses ( close_cover; open_cover)

  3. the only thing that I dont understand now is, how can I define the entity_id of the cover I want to open/close?

Here my ny config:

automation:
  - alias: 'close WindowBlinds.'
    trigger:
      platform: sun
      event: sunrise
      offset: '+00:30:00'
    action:
       service: close_cover
       entity_id: IEQ0148665
  - alias: 'Open WindowBlinds'
    trigger:
      platform: sun
      event: sunset
      offset: '+00:00:00'
    action:
     service: open_cover
     entity_id: IEQ0148665    

What am I doing wrong? :confused:

What are you using to define the cover? There should be some configuration setting that up.

Look at your states tab for a list of all of your entities. You’re going to find that it’s more likely something like
cover.IEQ0148665

I tested with this config under services, if I click on “Call service” the window blinds are opening, or closing if I choose close_cover.

But with this config:

automation:
  - alias: 'close WindowBlinds.'
    trigger:
      platform: sun
      event: sunrise
      offset: '+00:30:00'
    action:
       service: cover.close_cover
#       entity_id: cover.IEQ0148665
  - alias: 'Open WindowBlinds.'
    trigger:
      platform: sun
      event: sunset
      offset: '+00:00:00'
    action:
     service: cover.open_cover
#     entity_id: cover.IEQ0148665

it still does not work, the web interface shows me the 2 new switches, but If i click on them, nothing happens.
(I commented also the entity_id out, to test if this will help)

Any idea?

You never want to comment out an entity_id. Pretty much every service requires an entity_id. Calling cover.open_cover is like saying “open the door”. Without an entity_id, it doesn’t know which.

When you’re testing the open_cover service, are you passing it the data like this:
{"entity_id":"cover.IEQ0148665"} ?

Also - you should be able to trigger those automations from the UI. IIRC, the switch will enable/disable. Click on an automation and you should see a “trigger” link.

Just a thought - but I wonder if you’ve got a case issue. Have you tried
entity_id: cover.ieq0148665