When a server is powered off, the consumption is 0 Watt. As a result, the if test would fail, and it would report $METHOD_UNSUPPORTED. Changed if test to only check if value is defined, and assign the value inside the if test.