Just for reference (as may be related): after startup of HA, all lights work correctly and I can action the covers. However the covers’ state is NOT correctly reflected.
Can anyone please provide some guidance how to get rid of the error ?
I apologize: I removed the “expose:” line, as I thought not relevant (I was fiddling around to see if it could solve my issue with the covers not having a correct state, after reboot).
Please find below my full config, related to KNX: configuration.yaml, lights_KNX.yaml, covers_KNX.yaml, expose_KNX.yaml.
# Configuration Variables
# =======================
# name: (string)(Optional) A name for this device used within Home Assistant. Default value: KNX Cover
# move_long_address: (string)(Optional) KNX group address for moving the cover full up or down. DPT 1
# move_short_address: (string)(Optional) KNX group address for moving the cover short time up or down. DPT 1
# stop_address string (string)(Optional) KNX group address for stopping the current movement from the cover. DPT 1
# position_address: (string)(Optional) KNX group address for moving the cover to the dedicated position. DPT 5.001
# position_state_address: (string)(Optional) Separate KNX group address for requesting the current position of the cover. DPT 5.001
# angle_address: (string)(Optional) KNX group address for moving the cover to the dedicated angle. DPT 5.001
# angle_state_address: (string)(Optional) Separate KNX group address for requesting the current angle of cover. DPT 5.001
# travelling_time_down: (integer)(Optional) Time cover needs to travel down in seconds. Needed to calculate the intermediate positions of cover while traveling. Default value: 25
# travelling_time_up: (integer)(Optional) Time cover needs to travel up in seconds. Needed to calculate the intermediate positions of cover while traveling. Default value: 25
# invert_position: (boolean)(Optional) Set this to true if your actuator report fully closed as 0% in KNX. Default value: false
# invert_angle: (boolean)(Optional) Set this to true if your actuator reports tilt fully closed as 0% in KNX. Default value: false
# =====================================
# === Gelijkvloers - BUREAU ===
# =====================================
# Zet rolluik volledig UP (i.e. = 0%) ==> restart HASS
- name: Gelijkvloers - Bureau - Rolluik bij WC
move_long_address: '2/0/0'
move_short_address: '2/0/21'
# position_address: ''
position_state_address: '3/0/0'
travelling_time_up: 25
travelling_time_down: 24
invert_position: false
- name: Gelijkvloers - Bureau - Rolluik in Hoek
move_long_address: '2/0/1'
move_short_address: '2/0/22'
# position_address: ''
position_state_address: '3/0/1'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
# =====================================
# === Gelijkvloers - KEUKEN ===
# =====================================
- name: Gelijkvloers - Keuken - Baantje
move_long_address: '2/0/2'
move_short_address: '2/0/23'
# position_address: ''
position_state_address: '3/0/2'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Gelijkvloers - Keuken - Tuin
move_long_address: '2/0/3'
move_short_address: '2/0/24'
# position_address: ''
position_state_address: '3/0/3'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Gelijkvloers - Keuken - Terras
move_long_address: '2/0/4'
move_short_address: '2/0/25'
# position_address: ''
position_state_address: '3/0/4'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
# =====================================
# === Gelijkvloers - LIVING ===
# =====================================
- name: Gelijkvloers - Living - Links
move_long_address: '2/0/5'
move_short_address: '2/0/26'
# position_address: ''
position_state_address: '3/0/5'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Gelijkvloers - Living - Midden
move_long_address: '2/0/6'
move_short_address: '2/0/27'
# position_address: ''
position_state_address: '3/0/6'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Gelijkvloers - Living - Rechts
move_long_address: '2/0/7'
move_short_address: '2/0/28'
# position_address: ''
position_state_address: '3/0/7'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Gelijkvloers - Living - Padje
move_long_address: '2/0/8'
move_short_address: '2/0/29'
# position_address: ''
position_state_address: '3/0/8'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
# ======================================
# === Gelijkvloers - TV HOEK ===
# ======================================
- name: Gelijkvloers - TV Hoek - Padje
move_long_address: '2/0/9'
move_short_address: '2/0/30'
# position_address: ''
position_state_address: '3/0/9'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Gelijkvloers - TV Hoek - Links
move_long_address: '2/0/10'
move_short_address: '2/0/31'
# position_address: ''
position_state_address: '3/0/10'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Gelijkvloers - TV Hoek - Rechts
move_long_address: '2/0/11'
move_short_address: '2/0/32'
# position_address: ''
position_state_address: '3/0/11'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
# =====================================
# === Verdieping - BADKAMER ===
# =====================================
- name: Verdieping - Badkamer - Links
move_long_address: '2/0/12'
move_short_address: '2/0/33'
# position_address: ''
position_state_address: '3/0/12'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Verdieping - Badkamer - Rechts
move_long_address: '2/0/13'
move_short_address: '2/0/34'
# position_address: ''
position_state_address: '3/0/13'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
# ======================================================
# === Verdieping - SLAAPKAMERS + LOGEERKAMER ===
# ======================================================
- name: Verdieping - Slaapkamer - Ouders
move_long_address: '2/0/14'
move_short_address: '2/0/35'
# position_address: ''
position_state_address: '3/0/14'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Verdieping - Slaapkamer - Tine
move_long_address: '2/0/15'
move_short_address: '2/0/36'
# position_address: ''
position_state_address: '3/0/15'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Verdieping - Slaapkamer - Laure Tuin
move_long_address: '2/0/16'
move_short_address: '2/0/37'
# position_address: ''
position_state_address: '3/0/16'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Verdieping - Slaapkamer - Laure Padje
move_long_address: '2/0/17'
move_short_address: '2/0/38'
# position_address: ''
position_state_address: '3/0/17'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Verdieping - Logeerkamer - Padje
move_long_address: '2/0/18'
move_short_address: '2/0/39'
# position_address: ''
position_state_address: '3/0/18'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
- name: Verdieping - Logeerkamer - Vooraan
move_long_address: '2/0/19'
move_short_address: '2/0/40'
# position_address: ''
position_state_address: '3/0/19'
travelling_time_up: 25
travelling_time_down: 24
invert_position: true
expose_KNX.yaml
# Configuration Variables
# =======================
# - type: (string, required)
# Type of the exposed value. Either ‘binary’, ‘time’, ‘date’, ‘datetime’ or any
# supported type of KNX Sensor (e.g., “temperature” or “humidity”).
# - entity_id: (string, optional)
# Entity id to be exposed. Not needed for types time, date and datetime.
# - attribute: (string, optional)
# Attribute of the entity that shall be sent to the KNX bus.
# If not set (or None) the state will be sent. Eg. for a light the state is
# either “on” or “off” - with attribute you can expose its “brightness”.
# - default: (boolean | string | integer | float, optional, default: None)
# Default value to send to the bus if the state or attribute value is None.
# Eg. a light with state “off” has no brightness attribute so a default value of 0 could be used.
# If not set (or None) no value would be sent to the bus and a GroupReadRequest to
# the address would return the last known value.
# - address: (string, required)
# KNX group address.
# =====================================
# === Gelijkvloers - BUREAU ===
# =====================================
- type: 'percentU8'
entity_id: cover.gelijkvloers_bureau_rolluik_bij_wc
address: '3/0/0'
- type: 'percentU8'
entity_id: cover.gelijkvloers_bureau_rolluik_in_hoek
address: '3/0/1'
Try to use attribute: current_position on your cover exposes.
When you expose just the state it tries to convert “closed” to a % value - which is not possible.
Why are you forwarding a state that is received from knx to knx?
I will firstly remove the “Expose” and see if the error with init.py persists.
If not, I know I need to correct the expose- section.
PS: I merely tried the “Expose” route, to solve an issue I have with my covers, not showing the correct state after a reboot (even though there is a ‘position_state_address’). I am not clear on what this ‘Expose’ section is supposed to do, based on what I could read in the documentation.
Expose is used to forward states or attributes of HA entities to knx.
That said you can always suggest improvements to the documentation via GitHub. This would be much appreciated.
Many thanks for your kind help.
I will install v2020.12.x soon to see if this solves my issues.
As to the documentation: I believe it would be clarifying if the sentence you have written “Expose is used to forward states or attributes of HA entities to knx.” is added at the beginning of the “Expose” section. It provides the right context, in my opinion.
I think this is more or less what is written in the documentation, but I’m no native english speaker.
KNX integration is able to expose entity states or attributes to KNX bus. The integration will broadcast any change of the exposed value to the KNX bus and answer read requests to the specified group address. It is also possible to expose the current time.
If you can rephrase it so it is easier understandable for a broader audience, don’t hesitate to go to KNX - Home Assistant and follow the link on top reading Edit this page on GitHub.
Your help will be appreciated.