Why are you creating calendars and input numbers when I showed you how to do this easily with one template sensor?