Add new binary sensor

Can we have some kind “beetween dates” binary sensor?

for example:

start_date: 10/12/2019
end_date: 20/12/2019

if today is 15/12/2019 sensor should be set to true

or better (every year):

start_date: 01/10
end_date: 10/10

if today (day and month) is beetwen sensor sholud be set to true.

I think this will be great solution to every year automation or easy way to check for example holiday time, vacation etc.

Yes, I know, this can be done by python, appdaemon etc but native solution will be simple and easy.

Use an automation to set an input_boolean on/off for the desired dates. Easy-peasy.

What you’re requesting would require the ability to set a binary_sensor’s state. That would normally be done using a service. However, binary_sensor does not have services. So your feature request requires a significant enhancement to binary_sensor.

If you absolutely wish to use a binary_sensor, there is a way to achieve what you want using an MQTT Binary Sensor.

  • Create an MQTT binary_sensor called binary_sensor.vacation that is subscribed to a topic like holidays/vacation.
  • Create an automation that triggers on the day your vacation begins and make it publish ‘ON’ to holidays/vacation. That will make binary_sensor.vacation turn on.
  • The same automation can be used to trigger when your vacation ends. Have it publish OFF to holidays/vacation. That will make binary_sensor.vacation turn off.

Similar but different to https://www.home-assistant.io/components/binary_sensor.tod/