NRCHKB / node-red-contrib-unifi-os

Nodes to access UniFi data using endpoints and websockets
Apache License 2.0
26 stars 2 forks source link

unifi request returns nothing useful (or i am doing something wrong) #14

Closed lassealfastsen closed 3 years ago

lassealfastsen commented 3 years ago

Hi,

Just getting started and i cant seem to get anything working.

I Added a Unifi request node and thought i would start off simple and just getting the result from the "self" endpoint. image

it only returns the below if i output to a debug node.

<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link href="/2.css" rel="stylesheet"></head><body><div id="root"></div><script type="text/javascript" src="/vendor.0306759b.chunk.js"></script><script type="text/javascript" src="/main.d8e6c715.js"></script></body></html>
crxporter commented 3 years ago

I see you're running a cloudkey. Does the cloud key run Unifi os? You're the first person to reach out to us running this hardware so, congratulations! You can be our first cloudkey tester if you'd like!

I haven't run the /api/self endpoint yet, have you tried any others?

you might need to run it like /proxy/network/api/self

here are some I've tested:

/proxy/network/api/s/default/stat/device/
/proxy/network/api/s/default/stat/health
/proxy/network/api/s/default/stat/sta
lassealfastsen commented 3 years ago

Sure, i can test a few things for you if you'd like :)

Yes it is running Unifi OS i believe :)

I tried the /proxy/network/api/self endpint and that returned a lot of info :)

and i just tried this endpoint as well: /proxy/network/api/s/default/stat/device

so it seems on the cloud key that the endpoints listed in the Unifi community post should be prefixed with '/proxy/network/api/s/[site]' to work properly.

Let me know if i can help with testing, ill do what little i can to help out :)

lassealfastsen commented 3 years ago

NB: Filtering also seems to work by posting the below to /proxy/network/api/s/default/stat/device/

{
"macs": [
    "b4:fb:e4:57:57:7e"
]
}