code: def set_state(self, onoff, channel=None):
          
          try:
              onoff = bool(onoff)
          except Exception as err:
              LOG.debug("HelperActorState.set_state: Exception %s" % (err,))
              return False
  
          self.writeNodeData("STATE", onoff, channel)
docs: Turn state on/off