Removed unnecessary code
Added check of the result of the rake task, added sleeps after clicking on the power buttons, it seems that when they weren't there, it didn't apply the request