Closed madkatz01 closed 1 year ago
I second this!
I third this! Came here to submit enhancement! Cheers!
After 2 hours of struggle (I'm no JS developper) I have a working widget that display the number of active AP and the number of clients connected to the wifi.
because I only use Omada soft controler (version 3.2.17) with 4 AP
Thats amazing work! I look forward to the commit.
Get this man a beer and a JS developer!
For now, I am really not ready for the pull request, my code is really ugly (even to my low standards) and I can't get the labels to display properly.
For now, I am really not ready for the pull request, my code is really ugly (even to my low standards) and I can't get the labels to display properly.
Oh for sure no rush, it’s awesome someone is looking into this, it’s a huge leap forward from nothing haha, I for one have no clue how to do any of that.. so you are miles ahead of me.
If you post it somewhere accessible someone (yes maybe me) might have some time to look. only if you want to, of course.
Also, since I dont have one of these would need some help getting fake API output from the device
Let me first try to find out how I could possibly have fucked the translation system up on my local copy and I get back to you.
The code is here : https://github.com/Oupsman/homepage
It doesnt look so bad =)
For translation files you only edit en
, the rest come through a translation service we use.
And for displaying those strings it should look like <Block label="omada.connectedAp" value={t("common.number", { value: omadaData.connectedAp })} />
like you had it before
Thanks.
I added the translations in both en and fr (because I'm French). I've removed the translations from the french file but I still have problems :
I'll try to fix it tomorrow.
I have fixed the code this morning, and it seems to work fine on my old controller. But I've tested it against a modern one and it doesn't work. So for now, no PR because I don't think anyone else uses an old controller.
When you say Old/New controller, is the new one Version:5.7.4? That's the one I am running at the moment.
Also, good job! excellent work mate.
Yes, the old controller is version 3.x.x the new controller is version 4 and more.
I have a code that seems to work for these controllers, can I submit the PR ?
I reckon you do, I don’t know though, if you’re confident with the code, I don’t see why not.
The Omada API is hell on earth ! Between versions, the fields needed for stats are changing. So I closed my pull request until I have a code working on the three versions I can test on.
Sorry
No worries mate, don’t be sorry :) getting it working on 3 different versions sounds light a nightmare!
@shamoon could you please give me your feedback on the code I pushed on my repo ?
PS : I setup a few controllers for me to test on : I've deployed 2 controllers, one in 4.4.8 and one in 5.7.4 so I can have real tests.
Wow, I see what a pain it is to support the two APIs. Not sure when I'll have time to test, youre saying they can be easily deployed as docker containers (I dont have the hardware ofc)?
Also, what does a widget with 8 blocks look like?
A widget with 8 blocks is quite difficult to read, but I think that all data can be important. Maybe create two widgets and filter the fields ? I've tested it because on a V3 controller, all fields are not available.
Here is a screenshot of my homepage :
To deploy an omada controller as a docker container : https://github.com/mbentley/docker-omada-controller
yea messy. So youre trying to support v3, v4 and v5?
Yea 8 blocks is too much =)
I want to support v3 to v5, yes. Because I'm still using v3 :)
Do you think I should split the blocks in two lines ?
EDIT : but I don't understand how to do it.
I may have another idea, and I'd like feedback : I can also divide the widget in two parts : one for WLAN and the other one pour LAN/WAN. Because I think most people are interested in WLAN metrics. Beside, the V3 code is only useful for WLAN as V3 controllers can't manage switches and gateways.
What do you all think about that ?
Splitting into WLAN/LAN/WAN would be amazing!
Ok, I've split the widget in two, the tests are good so far.
@shamoon : I did not duplicate the code, did not touch anything in the omada widget (except removing the unwanted fields). The omadalan widget imports the proxy from the omada widget. But I'm not sure that's the best way to do so, so feel free to give me ANY feedback you see fit.
TBH I would just choose the 4/5 stats you think are most important. If not, make it a configuration option on the widget instead of two separate widgets.
TBH I would just choose the 4/5 stats you think are most important. If not, make it a configuration option on the widget instead of two separate widgets.
Why make a configuration option when the user can select the wanted fields ? I mean, the code will be the same, because all the data are collected with a single API call.
Because the widget should work "out-of-the-box" and not be unusable if the user doesnt specify anything
OK then, a setting "mode" with two choices : WLAN and LAN and a default value of WLAN. That seems to be the less bad option to me.
Yes sure, or just chose 2/3 of each. Almost all widgets make some choices about what data to show. Homepage isn’t meant to be a comprehensive tool for monitoring every service / device it’s supposed to summarize important / useful info, briefly. For example the unifi widgets pare down the data quite a bit…
Thanks, I took inspiration from the unifi widget and my code will display the number of connected switches and the number of connected gateways only if there is something to display (aka, the number is greater than 0)
When I first opened the PR, you mentioned minor issues with the code, could you please give them to me so I can correct my code ?
When I first opened the PR, you mentioned minor issues with the code, could you please give them to me so I can correct my code ?
Your code has increased in complexity quite a bit since then with the supporting of multiple versions etc. and it won’t be trivial to test (don’t have hardware, have to spin up multiple containers etc). The last time I looked it seemed it now needs a bit more but I don’t have specifics. Please get the PR to where you are happy with it and when we have time one of us will review, not sure exactly when.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns.
TPLink Omada is a becoming popular home networking hardware (similar to Ubiquiti's UniFi system) and they have a pretty extensive API for retrieving information on the network status. Would be awesome to have this added as a widget.
Here is a link to their published API for their current v5.0+ controllers: https://static-community.tp-link.com/attach/8/2/2022/78d3f067ac0c491d931426e040188632.zip