Night blooming cereus has some kind of bugs.
This has come on suddenly but seems to be affecting the whole plant. There are some tiny bugs that stay around these small cacoon like things and also some long thin white bugs about 3/16" long. Lots of brown patches.
This looks like Scale or Mealy Bug.
Neem Oil is a good treatment.