Perhaps you could buy a UPS (uninterrupible power supply) that would keep
the unit running for brief periods during a power glitch.
Google "uninterruptible power supplies"
here is a good "basic explanation" link:
Your challenge will be to try to estimate how long the power is off at a
time.......... 5 seconds or 4 hours ?? and find a UPS with a high
enough rating to power the dehumidifier long enough to prevent the digital
control from resetting to zero (or off). A very small UPS designed for a
computer might not do the job.
Hope this helps !!