Hi,
You are using the XAPI Python SDK, meant to be used against a host, not XO.
Two choices: keep using that but point it to the pool master directly OR use XO API instead (eg the REST API). I would advise for the option 2.
@olivierlambert Ihave been tryign to get graceful power off to work with my nas whcih is Truenas by the way but i havent gotten it to work yet oddly i cant seem to get them talking yet