Hello,
I want to combine two if queries in a markdown.
This is my actually code:
{% if is_state('input_boolean.wakestatus_1', 'on') %} ## <font color="#7B3F00"><ha-icon icon="mdi:alarm"></ha-icon></font> gestellt {{ states('input_datetime.waketime_1') }} {% else %}{% endif %}
{% if is_state('input_boolean.wakeweekday_mon_1', 'on') %} (Mo) {% else %}{% endif %}
{% if is_state('input_boolean.wakeweekday_tue_1', 'on') %} (Di) {% else %}{% endif %}
{% if is_state('input_boolean.wakeweekday_wed_1', 'on') %} (Mi) {% else %}{% endif %}
{% if is_state('input_boolean.wakeweekday_thu_1', 'on') %} (Do){% else %}{% endif %}
{% if is_state('input_boolean.wakeweekday_fri_1', 'on') %} (Fr){% else %}{% endif %}
{% if is_state('input_boolean.wakeweekday_sat_1', 'on') %} (Sa){% else %}{% endif %}
{% if is_state('input_boolean.wakeweekday_sun_1', 'on') %} (So){% else %}{% endif %}
Now I will only write the days of the week if the input_boolean.wakestatus_1 is also on
How I can combine this two if queries?
The first querie can of course only be displayed once.
I have found a solution and it works with the following code:
{% if is_state('input_boolean.wakestatus_1', 'on') %} ## <font
color="#7B3F00"><ha-icon icon="mdi:alarm"></ha-icon></font> gestellt {{
states('input_datetime.waketime_1') }} {% else %}{% endif %} {% if
is_state('input_boolean.wakestatus_1', 'on') and
is_state('input_boolean.wakeweekday_mon_1', 'on') %} (Mo){% else %}{% endif %}
{% if is_state('input_boolean.wakestatus_1', 'on') and
is_state('input_boolean.wakeweekday_tue_1', 'on') %} (Di){% else %}{% endif %}
{% if is_state('input_boolean.wakestatus_1', 'on') and
is_state('input_boolean.wakeweekday_wed_1', 'on') %} (Mi){% else %}{% endif %}
{% if is_state('input_boolean.wakestatus_1', 'on') and
is_state('input_boolean.wakeweekday_thu_1', 'on') %} (Do){% else %}{% endif %}
{% if is_state('input_boolean.wakestatus_1', 'on') and
is_state('input_boolean.wakeweekday_fri_1', 'on') %} (Fr){% else %}{% endif %}
{% if is_state('input_boolean.wakestatus_1', 'on') and
is_state('input_boolean.wakeweekday_sat_1', 'on') %} (Sa){% else %}{% endif %}
{% if is_state('input_boolean.wakestatus_1', 'on') and
is_state('input_boolean.wakeweekday_sun_1', 'on') %} (So){% else %}{% endif %}