Unexpected value for condition

Using this condition:

condition: template
value_template: '{{ now().month in [5, 6, 7, 8, 9] }}'

I get the following errors:

Invalid config for [automation]: Unexpected value for condition: ‘{{ now().month in [5, 6, 7, 8, 9] }}’. Expected numeric_state, state, sun, template, time, zone, and, or, not, device @ data[‘condition’][0]. Got None. (See ?, line ?).
Invalid config for [automation]: invalid template (TemplateSyntaxError: expected token ‘:’, got ‘}’) for dictionary value @ data[‘action’][0][‘data’]. Got None. (See ?, line ?).

Best way to fix this?

Show more. The reported errors are not necessarily related to the code fragment shown.