Closed rvanlieshout closed 7 months ago
Probleem seems that devices don't (always?) have a name
A vscode-restclient file:
@ip = 192.168.0.1
@username = zabbix
@password = ***
@auth_uri = api/auth/login
@uri = proxy/network/api/s/default/stat
# @name login
POST https://{{ip}}/{{auth_uri}}
Content-Type: application/json
{
"username": "{{username}}",
"password": "{{password}}"
}
###
@token = {{login.response.headers.Set-Cookie}}
GET https://{{ip}}/{{uri}}/device-basic
Shows:
{
"meta": {
"rc": "ok"
},
"data": [
{
"mac": "9c:05:d6:53:88:4a",
"state": 1,
"adopted": true,
"disabled": false,
"type": "udm",
"model": "UDRULT",
"in_gateway_mode": true,
"name": "Cloud Gateway Ultra"
},
{
"mac": "d8:b3:70:38:a6:38",
"state": 1,
"adopted": true,
"disabled": false,
"type": "usw",
"model": "USL16PB",
"in_gateway_mode": false
},
{
"mac": "60:22:32:76:4c:05",
"state": 1,
"adopted": true,
"disabled": false,
"type": "uap",
"model": "UAP6MP",
"in_gateway_mode": false
}
]
}
This is fixable by the user, so we might want to update the readme
The interface shows a name, but the api doesn't return one. If one changes the name and saves the api will return that new name. Even if you then change it back to the original (default) name it'll present that via the api
Also poe_good
and poe_mode
are not in the API response for the udm
-device
I've been able to resolve this by disabling some entries and setting a name
Hi @rvanlieshout, this is a duplicated issue, look at #16.
Checklist
Describe the Bug
The discovery rules
Unifi Network: API stat/device-basic: Device USW
andUnifi Network: API stat/device-basic: Device UAP
fail with a message that the name contains an invalid characterMACROS
Context
main
6.4.13
UniFi OS 3.2.12
Cloud Gateway Ultra
It might be because this is running Unifi OS. I'll try to debug in a short future to see what data it produces. Please let me know if you want me to perform some calls