I have a couple of IKEA (Tradfri) Fyrtur blinds which I have integrated with home assistant.
They work great as is, but since I have a lot of them throughout the house I wanted a toggle switch for each room.
The first method I tried was to create a an input boolean and two automations, one to roll the blinds up and one for down.
This method worked well aside from one minor issue. When I decide to use the physical hardware switch to control the blinds or roll them up any other way than to use the toggle switch, the toggle switch do not get “refreshed”, it still holds the original value (or position).
First I thought the issue arose because I used several blinds in the switch, but the same happens when I only used one blind per automation
Here’s the code for the automations:
- id: '1650963916399'
alias: Kitchen Blinds Up
description: ''
trigger:
- platform: state
entity_id: input_boolean.kitchen_blinds
to: 'off'
condition: []
action:
- device_id: 7889543acdf0u99b5a4080b4054339ae
domain: cover
entity_id: cover.right_window
type: set_position
position: 100
- device_id: 58ef88abefe98e9f949q90h350844179
domain: cover
entity_id: cover.left_window
type: set_position
position: 100
- device_id: 3fe5aff7ea47fb07598ace743999f2d3
domain: cover
entity_id: cover.small_right_window
type: set_position
position: 100
- device_id: 46d1dc647c92856ae766fe67685fbffe
domain: cover
entity_id: cover.small_left_window
type: set_position
position: 100
mode: single
- id: '1650964403430'
alias: Kitchen Blinds Down
description: ''
trigger:
- platform: state
entity_id: input_boolean.kitchen_blinds
to: 'on'
condition: []
action:
- device_id: 7889543acdf0u99b5a4080b4054339ae
domain: cover
entity_id: cover.right_window
type: set_position
- device_id: 58ef88abefe98e9f949q90h350844179
domain: cover
entity_id: cover.left_window
type: set_position
- device_id: 3fe5aff7ea47fb07598ace743999f2d3
domain: cover
entity_id: cover.small_right_window
type: set_position
- device_id: 46d1dc647c92856ae766fe67685fbffe
domain: cover
entity_id: cover.small_left_window
type: set_position
mode: single
And here’s the helper:
{
"version": 1,
"minor_version": 1,
"key": "input_boolean",
"data": {
"items": [
{
"name": "Kitchen Blinds",
"icon": "mdi:blinds",
"id": "kitchen_blinds"
}
]
}
}
The second method I tried was to create a template switch.
I did this for another room with only one blind as to make things a little easier on myself.
The issue I’m having this time is whenever I click the toggle button it reverts back to “off” after a second or two.
Here’s the code for the template switch:
switch:
- platform: template
switches:
office_blind:
value_template: "{{ is_state('cover.tradfri_blind_7', 'on') }}"
turn_on:
service: homeassistant.toggle
target:
entity_id: cover.tradfri_blind_7
turn_off:
service: homeassistant.toggle
target:
entity_id: cover.tradfri_blind_7
icon_template: >-
{% if is_state('cover.tradfri_blind_7', 'on') %}
mdi:blinds-open
{% else %}
mdi:blinds
{% endif %}
Simply put, what I’m trying to achieve is to have a toggle switch that refresh when you interact with the blinds in any other way than the toggle switch. e.g. if I roll the blinds up one by one, ideally the toggle switch should refresh after the last one has been rolled up.
Is what I’m trying to achieve even possible and if so, which is the preferred method I should continue with?
Also, can anyone spot the error I’ve made with the template switch? Been at that one for hours and it’s starting to drive me slightly insane…