I have an automation in which I react to status changes of dropdowns. I would now like to synchronise the status of the dropdown (e.g. input_select.lennard) to my KNX system. To do this, I must first check the status of the entity on the KNX bus and compare it to the value of my dropdown.
I have 6 entities (switches) and I have to find the right one. The entities all have the same structure e.g. ‘switch.lennard_schlafstatus’. In the example, the name lennard is the variable part that must be replaced according to the trigger of the automation.
Get the Status of Person XX from KNX:{% set knx = states(‘switch.XX_schlafstatus’) %}
Trigger (person) of the automation: {{trigger.entity_id.replace(‘input_select.’, ‘’)}}
-
How can I replace XX in “switch.XX_schlafstatus” with the trigger entity_id in this statement to get the value of the switch?
-
The values of the switch must then be mapped from 0 to “Zuhause” and 1 to “Schlafend” in order to compare the status on the KNX bus and the dropdown. How can I do this?