Either Automation morning is activated and current time is less than the time entered in the helper of morning.
Or
Automation afternoon is active and current time is less than time entered in helper afternoon.
In addition to this check, it should be checked whether today’s weekday is selected by input boolean and matches today’s day.
Something is not working, Monday is not checked.
- name: 'Landroid Mähvorgang heute aktiv'
unique_id: landroid_mahvorgang_heute_aktiv
state: >-
{{ ((is_state('automation.landroid_mahvorgang_vormittag_starten', 'on') and states('sensor.time') < (states('input_datetime.landroid_mahen_vormittag'))))
or ((is_state('automation.landroid_mahvorgang_nachmittag_starten', 'on') and states('sensor.time') < (states('input_datetime.landroid_mahen_nachmittag'))))
and ( is_state('input_boolean.landroid_mahen_montag', 'on') and now().weekday() == 0 )
or ( is_state('input_boolean.landroid_mahen_dienstag', 'on') and now().weekday() == 1 )
or ( is_state('input_boolean.landroid_mahen_mittwoch', 'on') and now().weekday() == 2 )
or ( is_state('input_boolean.landroid_mahen_donnerstag', 'on') and now().weekday() == 3 )
or ( is_state('input_boolean.landroid_mahen_freitag', 'on') and now().weekday() == 4 )
or ( is_state('input_boolean.landroid_mahen_samstag', 'on') and now().weekday() == 5 )
or ( is_state('input_boolean.landroid_mahen_sonntag', 'on') and now().weekday() == 6 ) }}
I looks like you have some brackets in the wrong location.
Does this work for you:
- name: 'Landroid Mähvorgang heute aktiv'
unique_id: landroid_mahvorgang_heute_aktiv
state: >-
{{ ((is_state('automation.landroid_mahvorgang_vormittag_starten', 'on') and states('sensor.time') < (states('input_datetime.landroid_mahen_vormittag')))
or (is_state('automation.landroid_mahvorgang_nachmittag_starten', 'on') and states('sensor.time') < (states('input_datetime.landroid_mahen_nachmittag'))))
and (( is_state('input_boolean.landroid_mahen_montag', 'on') and now().weekday() == 0 )
or ( is_state('input_boolean.landroid_mahen_dienstag', 'on') and now().weekday() == 1 )
or ( is_state('input_boolean.landroid_mahen_mittwoch', 'on') and now().weekday() == 2 )
or ( is_state('input_boolean.landroid_mahen_donnerstag', 'on') and now().weekday() == 3 )
or ( is_state('input_boolean.landroid_mahen_freitag', 'on') and now().weekday() == 4 )
or ( is_state('input_boolean.landroid_mahen_samstag', 'on') and now().weekday() == 5 )
or ( is_state('input_boolean.landroid_mahen_sonntag', 'on') and now().weekday() == 6 )) }}
I did check it again, and am pretty sure the template should be correct.
The base form of the template is:
{{ ( Vo or Na ) and ( Mo or Di or Mi or Do or Fr or Sa or So ) }}
So the template is True when either the vormittag or nachmittag automation is activated, and the current day is allowed.
It could be that the listing of the state changed events in the Developer Tools in unreliable.
Did you check in the Developer Tools Template whether the State of the template is changing when you are modifying the input.boolean states?
For instance: when it is Montag nachmittag and you set the state of both the automation.landroid_mahvorgang_nachmittag_starten and the input_boolean.landroid_mahen_Montag to ON, what is the template state? It should be True.
I have adopted your sensor and I would say it works. Our robotic mower started twice today.
In the Developer Tools, the status also changes according to what I change.
I was just irritated that the entities input booleans with the days of the week are not listed as checked in the Developer Tools.