How to get numeric value from sensors coming from the Waste Collection

Hi,
I am using the Waste Collection Schedule integration to fetch information regarding my local garbage pickup.

These are the sensors that are available via the integration:

Then if click on Appointment Types sensor, see below:

How can I extract the days and types in a separate array/temporary sensors such as “Recycling”, “Organics” and “4” from the data provided by the Appointment Types sensor?

I want to setup automations based on number of days left. For example: If days left = 1, setup an alert based on days = 1 and time in the morning to take out the garbage.

Please let me know how can I achieve this.

Thanks in advance guys.

Is it always a string with numbers, or is it something else, for instance on collection day?

Anyways, a template sensor helper using a template like this would pull out the numbers. You need to set the unit_of_measurement to days in order for it to be a proper number.

{{ states('sensor.mywastesensor') | regex_replace('[^\d]', '') | int(0) }}