Create a template based binary sensor depending on a date generated from custom integration

Hi Guys. I want to create a binary sensor that turns on when a certain date is reached. E.g., I have my electricity provider data generated using a custom integration.
I get my electricity bill due date from that sensor. So what I want to achieve is that I need to create a binary sensor that will turn on just 2 days before the date approaches and keeps on for 4 days after the due date. How can i achieve this. Please help