Anyways… {{ now().minute }} does not reurn 00 ever. So because of that I could see that as an issue.
But I guess since it works in the morning it works anyways.
Just make it simpler using:
alias: Set Spa Pool Automation PM
id: '64827472828'
trigger:
- platform: time
at: '16:00'
id: on
- platform: time
at: '18:00'
id: off
- platform: homeassistant
event: start
action:
- service: >-
switch.turn_{{ trigger.id }}
target:
entity_id: switch.spa_pool
EDIT I see now the start event wont work. Let me think
Another method of doing the if else, could be to use:
{{ 'on' if now().hour in [16,17] else 'off' }}
Not sure if this works better or worse, but it’s an option that you could try
Have you checked if the automation is triggered but the action not executed, or is the automation not even triggered in the first place?
In the automation debug view you should be able to see what now is at the time the automation is triggered.