Climate attribute management

I have a climate integration (evohome) which delivers a range of attributes.

One attribute is not always delivered - depending on the working mode of the heating system.

I have created sensors for all the attributes to make them accessible in lovelace and automations.

This is the one which results in an error in the log whenever the entity does not deliver that attribute.

      value_template: >        
        {{ (as_timestamp(state_attr('climate.wts','status')['setpoint_status']['until'])
Could not render template wts_sp_until: UndefinedError: 'dict object' has no attribute 'until'

Is there a way I can code round this so as to not get the error in the log.?

Check if the attribute is defined in your template.
You can play with it in Dev Tools/templates.