Detect an Empty Hopper in MC 1.12.2

Solution 1:

In Minecraft 1.12.2, you can detect a hopper with no items in it with the command:

/testforblock <x> <y> <z> hopper -1 {Items:[]}

in one command block, followed by a conditional chain command block to do something when this is true.