Hi everyone,
I recently started using Home Assistant and I am an absolute beginner. I use the floorplan card to display status information (doors, windows, roller shutter, …). It works perfectly with doors and windows. However, I have problems with the roller shutter and the attribute current_position. The attribute exists and also has a value (see screenshots).
In the YAML code, however, the attribute does not seem to be assigned a value: it fires “if position is none” with class test-case (marked with color red in the screenshot).
rules:
- element: Button-Steckdose-Brunnen-Symbol
entity: switch.knx_brunnen
state_action:
service: floorplan.class_set
service_data: switch-${entity.state}
tap_action: toggle
- element: floorplan.eg-az-fenster
entity: binary_sensor.eg_az_fenster
state_action:
service: floorplan.class_set
service_data:
class: '${(entity.state === "on") ? "window-open" : "window-closed"}'
- element: floorplan.eg-az-rolo
entity: cover.eg_arbeit_rolo
state_action:
service: floorplan.class_set
service_data:
class: >
{% set position = state_attr(cover.eg_arbeit_rolo, 'current_position') %}
{% if position is none %}
test-case
{% elif position == 0 %}
cover-closed
{% elif position == 100 %}
cover-open
{% else %}
cover-mid
{% endif %}
Does anyone have an idea what I am doing wrong? Seems that my way to access the elements attribute is wrong - even if it works in the Template-Editor … Any idea to solve this?
Thanks and best regards
Tom