Isaksson / node-red-contrib-unifi

MIT License
51 stars 20 forks source link

Unifi node only shows red, no output #59

Closed daxliniere closed 3 years ago

daxliniere commented 3 years ago

Hi there! I have tried a few times to get this Unifi node working, but unfortunately without luck. The node always shows a 'red light' and debug node shows no output. If I enable Unifi OS, it's still a red light, but also shows the text "app.err.LoginRequired". I have confirmed my username and password are correct.

The Unifi Controller is running on the same RPi as Node-RED, so I tried the RPi's IP address, 127.0.0.1 and localhost. The only other thing that is 'unusual' is that the site is not the Unifi Controller's default site. I have, of course, made sure to type the correct site name (PFSS).

Side note: I think there might be a problem with the Controller software because even if you rename the default site, you can't delete it. The PFSS site I created DOES have a 'Delete Site' button, but the default site, no matter what you rename it to, never shows that button. No idea if this would be affecting this node, but thought I should mention it.

Any help would be greatly appreciated.

All the best, Dax.

daxliniere commented 3 years ago

Anyone? Please?

ozett commented 3 years ago

you did it like this? tried to create a new one?

image

ozett commented 3 years ago

maybe check some wrong config-nodes?

image

daxliniere commented 3 years ago

you did it like this? tried to create a new one?

image

Hi Ozett, thank you so much for your replies. I think you've helped me solve this. It does indeed seem to be a problem with Unifi and the fact that I'm not using the standard Default site as explained above.

This is what I had, which showed the above mentioned error. image

If I change Command from Client Devices to Site Stats, the Unifi node now shows a green 'light' and the debug output is this: TypeError: msg.payload[0].filter is not a function and image

From this I can tell you that the Site Name that you can access in Unifi Controller is just the 'friendly name' and not the true name. I absolutely did not name my site "ndwrr7eu" (is that Elon Musk's new child's name??). This is clearly a random character string that Unifi Controller assigns to a site, hence why I got all screwed up by this. Thank you for putting me on the right path with this.

Incidentally, you can see in the object arrays, there is an attribute "attr_no_delete: true" which would explain why, as I mentioned above, there is no delete button. Grrr, some more really annoying decisions by Ubiquiti. They make great hardware, but their UI/UX is some of the worst I've ever seen in a wide-scale platform (and I'm a UI/UX consultant).

https://ubntwiki.com/guides/changing_the_default_site_in_unifi Why is everything so ridiculously difficult in the UBNT universe?? </rant>

ozett commented 3 years ago

👍

Isaksson commented 3 years ago

Good that you solved this. There is a "Tips" about this in the Readme Use the command SiteStats to get your Unifi Site Name