Hey,
in my new house i must install Somfy iO-shutters, i was given no choice
I connect them with a KLF200 an now i can control them via HA.
Now i want to control the covers with a KNX-Switch .
And now is the question, how can i realize that?
I installed the KNX-Integration and HA ist talking to the KNX-Bus and the KNX-Bus is talking to HA.
But now I donāt know what to do next?
Can i solve it with a yaml.file or an automation?
I would really be very happy if you could help me
Greetings
Thatās how the shutters / covers will be defined
farmio
(Matthias Alphart)
September 20, 2023, 3:55pm
3
Hi !
You can do that with an automation using a device trigger (KNX Interface device) (or a knx_event
event) with the Group address and payload you like to call the cover.open_cover
or cover.close_cover
service (or maybe a they have device actions, I donāt know).
Here would be a blueprint for that Cover Blueprint how to make destination in KNX work with appended text? and here is another example using knx_event KNX: Expose cover to KNX - #4 by jogie
Thanks for your fast reply @farmio
Oh thatās very difficult for me, iām new @HA
I tried NodeRed, iOBroker and so on, but i with HA iām feeling good at the moment and iām in good spirits that it will work with the KNX-Switch
From the second link:
I have to put this in a knx.yaml:
knx:
event:
- address:
- "0/4/20" # GA for cover going up / down or stop
expose:
- type: percent
entity_id: sensor.cover_04_31_rolladen_fensterlinks_position_invert
address: "0/4/21" # GA for cover state
default: 0
This in the automations.yaml:
- id: 'automation.04_rollo_links_ab'
alias: Steuere Keller Rollo Fenster links
description: ''
trigger:
- platform: event
event_type: knx_event
event_data: {}
condition:
- condition: template
value_template: '{{ trigger.event.data.destination == ''0/4/20'' and trigger.event.data.data == 1 }}'
action:
- service: cover.stop_cover
data: {}
target:
entity_id: cover.04_31_rolladen_fensterlinks
- service: cover.close_cover
data: {}
target:
entity_id: cover.04_31_rolladen_fensterlinks
mode: single
- id: 'automation.04_rollo_links_auf'
alias: Steuere Keller Rollo Fenster links
description: ''
trigger:
- platform: event
event_type: knx_event
event_data: {}
condition:
- condition: template
value_template: '{{ trigger.event.data.destination == ''0/4/20'' and trigger.event.data.data == 0 }}'
action:
- service: cover.stop_cover
data: {}
target:
entity_id: cover.04_31_rolladen_fensterlinks
- service: cover.open_cover
data: {}
target:
entity_id: cover.04_31_rolladen_fensterlinks
mode: single
And where i have to put this?
- sensor:
- name: cover_04_31_rolladen_fensterlinks_position_invert
state: "{{ 100 - (state_attr('cover.04_31_rolladen_fensterlinks', 'current_position') | int) }}"
Thanks in advance
farmio
(Matthias Alphart)
September 20, 2023, 5:59pm
5
Thatās a template sensor. You can configure these from the UI nowadays. See
Hey @farmio ,
i got these errors, also if i put in my GAās and entity_idās
farmio
(Matthias Alphart)
September 22, 2023, 3:27pm
7
These are indentation errors. Remove 2 whitespaces.
Or do the tests in the triggers event_data
, instead of adding a condition.
Or, better yet, use the UI automation builder.
I tried it with the UI automation builder but nothing happend
If i execute the automation from the UI, the shutter move down. But if i push the button on the switch, nothing happend
This is my automation with UI automation builder:
alias: Neue Automatisierung
description: ""
trigger:
- platform: device
domain: knx
device_id: c1b43dda4aa46bdf782d5c3d388476b1
type: telegram
destination:
- 1/6/10
condition: []
action:
- service: cover.close_cover
data: {}
target:
entity_id: cover.kind_2_links
mode: single
And if i put the switch, this will be shown in KNX-Group Monitor, but the shutter doesnāt move
farmio
(Matthias Alphart)
September 22, 2023, 6:51pm
9
this looks fine. Have a look at the automation debugger - maybe youāll find something there.
Or the logsā¦
Heyho @farmio ,
i made it with:
knx.yaml:
event:
- address:
- "1/6/10" # GA for cover going up / down or stop
expose:
- type: percent
entity_id: sensor.cover_04_31_rolladen_fensterlinks_position_invert
address: "1/6/11" # GA for cover state
default: 0
and automations.yaml:
- id: "automation.04_rollo_kind 2_links_ab"
alias: Steuere Kind 2 Rollo Fenster links
description: ""
trigger:
- platform: event
event_type: knx_event
event_data: {}
condition:
- condition: template
value_template: "{{ trigger.event.data.destination == '1/6/10' and trigger.event.data.data== 1 }}"
action:
- service: cover.stop_cover
data: {}
target:
entity_id: cover.kind_2_links
- service: cover.close_cover
data: {}
target:
entity_id: cover.kind_2_links
mode: single
- id: "automation.04_rollo_links_auf"
alias: Steuere Keller Rollo Fenster links
description: ""
trigger:
- platform: event
event_type: knx_event
event_data: {}
condition:
- condition: template
value_template: "{{ trigger.event.data.destination == '1/6/10' and trigger.event.data.data== 0 }}"
action:
- service: cover.stop_cover
data: {}
target:
entity_id: cover.kind_2_links
- service: cover.open_cover
data: {}
target:
entity_id: cover.kind_2_links
mode: single
Now my shutters went up and down
But how can i stop them, if i push the switch again. At the Moment they only went completely up or completely down?
And for the Status / Sensor, what do I have to choose here?
Hey @farmio ,
iām sure you just missed it
Can you please help me with the āStop-Functionā and the Status / Sensor?
Thank you very much in advance
farmio
(Matthias Alphart)
September 29, 2023, 9:00am
12
Sorry, I canāt help you there. Youāll have to try what works best with your specific switches and shutters.
For the status, I donāt know what you are trying to accomplish.
Hey @udgesbou ,
this threat and the answers from @farmio helped me by getting my KLF 200 to work with my KNX switches. And i got the stop funcionality to work to.
For my shutters i have these four adresses in my knx.yaml:
cover:
- name: "Shutter 1"
move_long_address: "1/0/1"
move_short_address: "1/0/2"
position_address: "1/0/3"
position_state_address: "1/0/4"
What i had to do is to add both āmoveā addresses to the event block:
event:
- address:
- "1/0/2" # GA for cover going up / down
- "1/0/1" # GA for cover stop
For my automation i used the code from this blueprint:
- alias: KNX-Velux-Bridge_Shutter_1
description: "KNX to Velux Brindge"
trigger:
- platform: event
event_type: knx_event
event_data:
destination: 1/0/2
data: 0
id: Open
- platform: event
event_type: knx_event
event_data:
destination: 1/0/2
data: 1
id: Close
- platform: event
event_type: knx_event
event_data:
destination: 1/0/1
id: Stop
- platform: event
event_type: knx_event
event_data:
destination: 1/0/3
id: Percentage
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: Open
sequence:
- service: cover.open_cover
data: {}
target:
entity_id: cover.shutter_1
- conditions:
- condition: trigger
id: Close
sequence:
- service: cover.close_cover
data: {}
target:
entity_id: cover.shutter_1
- conditions:
- condition: trigger
id: Stop
sequence:
- service: cover.stop_cover
data: {}
target:
entity_id: cover.shutter_1
- conditions:
- condition: trigger
id: Percentage
sequence:
- service: cover.set_cover_position
data:
position: "{{ trigger.event.data.value }}"
target:
entity_id: cover.shutter_1
Now, when i hold the ābuttonā on my MDT Glastaster for a ālongā second, the move_long_address: "1/0/1"
is used and cover.stop_cover
is triggert.
What is still not working is cover.set_cover_position
. This is not an option when using the MDT Glastaster, but i would like to just use the KNX entities on my dashboard and not have a mix of KNX and Velux entities.
On the dashboard you can use the slider to set a position. Right now the value is sent via the bus, but not picked up again to set this value via the KLF 200. I have to try some more.
I hope this helps.
Greetings