UndefinedError: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current' error

Hi I was using this code and a month or so ago it stopped working, possibly with a core update. I cant find help on automation attributes, can someone post a link to them?

The error: UndefinedError: ‘homeassistant.util.read_only_dict.ReadOnlyDict object’ has no attribute ‘current’

The code (in a markdown card):

|D|H|M|S||Name|
|----:|----:|----:|----:|:--:|:----|
{% for state in states.automation
   |selectattr('attributes.current', 'eq', 1)
   |selectattr('attributes.last_triggered')
   |sort(attribute='attributes.last_triggered', reverse=true) -%}
  {%- set t = now() - state.attributes.last_triggered -%}
  {%- set days = t.days if t.days > 0 else ' ' -%}
  {%- set hrs = t.seconds//3600 %}
  {%- set hrs = hrs if hrs > 0 else ' ' -%}
  |{{days}}|{{hrs}}|{{(t.seconds//60)%60}}||_{{state.name}}_|
{% endfor %}

Add

| selectattr('attributes.current','defined')

Seems that you got unavailable / restored automations.