Did I do something wrong? It’s not working

You need to use elseif instead of having separate if blocks. Each of those three if blocks gets evaluated separately. But you only want to check if the current hour is ≤ 17 if it’s greater than 11. If you replace the if blocks with a single if/elseif/elseif…/else block, it should work.