My suggestion as to the best place to start is in that blueprint you linked. It sounds close,and there may be something there that you don’t know about to help you, or you could also take control of that one and make your own changes to it as an automation. Using automation blueprints - Home Assistant.