More attributes in a sensor. How to?

I have solved with this sensor, thanks for your template.

in this sensor I set the number of events of the day as status and then the attributes.

- platform: rest
  name: Evento 1
  authentication: basic
  headers: {'Authorization': "Bearer XXX"}
  scan_interval: 60
  resource_template: "https://homeassistant.local:8123/api/calendars/calendar.lavoro?start={{ now().strftime('%Y-%m-%d') }}T00:00:01Z&end={{ now().strftime('%Y-%m-%d') }}T23:59:59Z"
  value_template: '{%- for bd in value_json -%}{%- if loop.last %}{{ loop.index }}{% endif -%}{%- endfor -%}'
  json_attributes_path: "$[0]"
  json_attributes:
    - summary
    - start
1 Like