Client - Set Temperature based on current operation

I have an automation that sets my thermostat temp to 70F at night and 75F, all was well till the temp outside got very low and the heat now has to be on. So my question is:

What would the condition look like to set the temperature ONLY if the current mode of the thermostat is Cool? I’m using the Honeywell platform.

I’ve spent last 20 mins googling/searching forums and not having any luck. Any help would be greatly appreciated.

I use a Nest thermostat, but if the Honeywell platform is similar, it would look like this:

condition:
  condition: template
  value_template: "{{ is_state_attr('climate.XXX', 'operation_mode', 'cool') }}"

Thanks, and for next question as I’ve not had any luck with Templates (I need to read more now that I’m trying to do more with the automation):

Does this go inline of the automation, or do I need to put the template somewhere else, then somehow use it in the automation?

You can find more details starting at this page in the docs. But basically the condition is part of the automation:

- alias: Blah, blah, blah
  trigger:
    ...
  condition:
    condition: template
    value_template: "{{ is_state_attr('climate.XXX', 'operation_mode', 'cool') }}"
  action:
    ...