I’m all for tangible, tactical solutions to problems that are currently enabled by software. For example, a phone tells the time, but it’s not always as straight forward as looking at a clock.
While it's not exactly the same, there's an app called "Self Control" on macOS that blocks selected websites for chosen amount of time, and after it is engaged it is virtually impossible for you to disable the block until the timer runs out. I use it a lot.
This exists as a commercial product (e.g. Freedom App), but you can just as easily add buttons and switches to a Home Assistant setup that does the same thing.