Help pulling out State Atrribute

I have a calendar entity that has many attributes, I have taken a snapshot below

message: Stage 6
all_day: false
start_time: 2023-04-21 16:00:00
end_time: 2023-04-21 20:30:00
location:
description:
friendly_name: Loadshedding Local Events

I can pull out the state attribute “start_time” however I would like to ignore the first 8 digits the date and would just like it to returm the time, is this possible? Can I create another sensor and reduce the detail I take from the state attribute?

Thanks in advance

The general answer is that you can use a Template sensor

One option for the template is as follows:

{{ state_attr('calendar.EXAMPLE', 'start_time')[-8:]

A more specific answer is dependent on what your actual goal is.

1 Like

This would be perfect thank you very much. I am using it in a template card for a dashboard.

Works perfectly!