Coder Social home page Coder Social logo

Comments (4)

braindead1 avatar braindead1 commented on August 20, 2024

Although I understand your point, I don't think that resetting states based on the online status of a client is the way to go. Which states should be resetted? Only the one you proposed or all? What about devices? Should they be treated the same way?

Instead I'm working on implementing the new state .clients.*.is_online. The state will be calculated for all clients and devices and will reflect the online status.

from iobroker.unifi.

JoschaMiddendorf avatar JoschaMiddendorf commented on August 20, 2024

Instead I'm working on implementing the new state .clients.*.is_online. The state will be calculated for all clients and devices and will reflect the online status.

That would already solve my problem.
I'm planing to keep track of client-devices and their position by signal strength and connected AP. therefor it is misleading to report a connected AP when the client isn't actually connected. But if there will be a is_online state this would make it simple to simply ignore the reported AP.
Furthermore, a Presence checkup would be simplified to the highest extent by your implementation.
What is your time schedule for that?
Can I contribute in any way?
Please keep reporting speed on high priority for that reporting. Preferably monitor uptime stalls instead of waiting for Unifi to report a definitive disconnect. Unify is terribly slow on detecting disconnects in my opinion.

from iobroker.unifi.

braindead1 avatar braindead1 commented on August 20, 2024

I'm planing to keep track of client-devices and their position by signal strength and connected AP. therefor it is misleading to report a connected AP when the client isn't actually connected.

The adapter polls the UniFi controller at a defined intervall. In my tests it turned out, that disconnected clients are not included in the response really fast (usually with the next poll). The adapter uses the response to only update clients that are included in the controllers response. Therefore the adapter is not reporting a connected AP when the client is not connected. It simply does not update/remove existing information.

Furthermore, a Presence checkup would be simplified to the highest extent by your implementation.
What is your time schedule for that?

v0.5.1 is already on it's way into beta testing. It includes WLAN on/off, the creation of vouchers and more states for clients and devices.

Setting the is_online state for connected clients/devices is easy to implement with the underlying JsonLogic. I just need to select the state to use for the calculation (e.g. .clients.*._uptime_by_uap) and find a smart way to update not connected clients/devices. Maybe the state finds it's way into v0.5.1.

Unify is terribly slow on detecting disconnects in my opinion.

As I said above, the UniFi controller is actually really fast in detecting disconnected clients and not including it in the response anymore. You can try it yourself by comparing the update of the states of a connected and a disconnected client in ioBroker. You'll notice that only the states of the connected client will be updated.

I don't know your usecase, but IMHO it is more important to get an instant feedback on connected devices (e.g. to turn on the light), than on disconnected devices as I see a huge risk of false positives (e.g. due to a restarting client/device). Therefore my personal usecase includes a buffer time when triggering an action based on disconnected clients/devices.

Besides that I noticed that many users use the states in their VIS visualization and maybe this is the background of your questions. Everything that is related to VIS visualization is not in scope of the adapter. If states need to be transferred to look nice in a VIS visualization, this has to be done outside of the adapter (e.g. with scripts). The problem is the variety of user demands I don't want to take care of (e.g. User A wants the list of connected clients to appear in red, whereas User B wants blue).

from iobroker.unifi.

braindead1 avatar braindead1 commented on August 20, 2024

Implemented is_online state for clients with 37c4c44 and 90b0d1b.

from iobroker.unifi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.