how do I trigger a /setblock command without a /testfor?

Solution 1:

You can still use testfor. Here's how it works - set up the device as you would with the testfor, but change the testfor to this command.

/testfor @a {Sleeping:1b}