Odianosen25 / Monitor-App

Appdaemon App for Andrew's Monitor Presence Detection System
74 stars 9 forks source link

[REQUEST] UI for easier management :) #35

Open skynet01 opened 4 years ago

skynet01 commented 4 years ago

LOVE your app! It really made the setup of the monitor simple! Improvement suggestion:

I know monitor script discoveres devices all the time. It would be awesome to have some GUI or alternatively using some predefined parameters to add new Bluetooth aliases automatically into the config?

Use case scenario: The user has a guest that comes to the house. When Arrival scan is triggered monitor script detects that along with the owner there is a new bluetooth address (it detects that it's an Apple or Android device) and adds those Bluetooth addresses to the config.

If there is a GUI then we can show a list of new users and an ability to rename them. If there is none they can just be added as guest1, guest2 and it's up to the owner to rename them later.

I know there are a few caveats here like detecting neighbor's Bluetooth devices etc. Which we can probably tweak later (like adding them to a blacklist). However, I do believe that this can really be useful for adding guests to the "allowed" list of the house quickly.

Odianosen25 commented 4 years ago

@skynet01 thanks for using the app.

I do like the suggestion and yes it is possible to create a GUI, could use the AD dashboard for that. Now this is how I think it could work, based on the scenario. Do tell me if it didn’t cover what you asking for.

Now the things is, these guest you need to know their MAC addresses anyway, before adding them. Unless you want to use the RSSI values to know that guest is definitely in the house before adding them. My advise is still to check the users MAC address before adding it.

How does that sound?

skynet01 commented 4 years ago

Pretty much. I tweaked your sentences to include the fact that we filter for device's manufacturer id based on Bluetooth mac address... So the process is this

  1. During the arrival scan or upon manual scan request (with -e flag) the node checks for all devices that it sees.
  2. The app picks them all up, check for known devices and processes them as it is now
  3. Those that are not known devices, will be stored locally and displayed on the dashboard. Filtering can be set up to only show Android or Apple devices based on name string that's included in the scan. (This way it's a lot more likely that the new device people are seeing on the list is a phone).
  4. From the dashboard, the user can then view all MAC addresses and add them to known devices and rename them.
  5. So each time the nodes or the entire monitor system reboots or something, that known devices will load up

We can use the RSI values and show them as signal strength bar. We can also maybe show how many times this address been seen. ...This should make the decision of picking the mac address blindly easier. But yes I agree the best is verifying with the actual phone if the address matches.

I think in the real-life situation though you will only have 1-3 new devices max (in a noisy place) when a new guest arrives. If I see that it's an apple device, has a good RSSI strength I can safely assume it's my friend's and add them to the list.

Another cool part about this is that it will make the initial set up faster too. I just install the HACS addon, do a manual scan using GUI then add the devices.

Maybe, later on, there could even be a smarter auto-add logic. Like if device is Apple and it has certain RSI range and it's been detected 3 times (friend visits often) then add them to the list...

Thanks so much for considering all this btw :)

Odianosen25 commented 4 years ago

@skynet01 its alright, I am always up to a little challenge. Just that I am not really into GUI stuffs, but will see how best I can put it into dashboard. I forgot to mention that there will not be any RSSI value, unless the device been paired to the node first.

When I get around to the GUI stuff, will be important to be able to pair from a GUI really.

Regards

skynet01 commented 4 years ago

Oh i didn't think about RSI being paired. I am actually a designer myself I can mockup the UI for you if that will help?

Odianosen25 commented 4 years ago

@skynet01, oh that’s be nice if you could help with that. I assume it’s gonna be dashboard? Or you want to make a standalone web interface? As AD now supports the ability for apps to serve custom web interfaces using the “app” route on the same port (dev only for now). We added this to support such ventures like this.

Anyways when ready, we could discuss your approach so as you build that, I could jump on the backend. If using dashboard (which I think is gonna be easier being inbuilt), I suggest the following:

Just initial thoughts, so let me know what you think. In the mean time, I will turn the above stuffs into service calls in the app, so all the dashboard will do is to call the right service and voila. It should work.

Regards

skynet01 commented 4 years ago

@Odianosen25 hey sorry for the delay on this. I got the first draft of the design ready: https://invis.io/XMYDM6UPTR3#/428112230_No_Nodes_Yet You can click around in the prototype above (navbar) and it will take you to appropriate pages, or you can also click left / right arrows

I tried to make it very simple for development so no fancy design here. I also didn't include a lot of fancy details or options, as we can add that later.

Let me know if you want to add some functionality to combine devices into a single person since I know there is a ticket for that already. I just wasn't sure you wanted to do it all at once :)

Odianosen25 commented 4 years ago

Wow this is really nice, how did you build that? With that, its as easy as service calls into AD using Websockets. i will need to add the other service calls to support things like running command line stuffs. Been busy with other projects so will see what I can muscle out this week.

skynet01 commented 4 years ago

Used sketch to draw it out. If you click on the "</>" icon in the bottom right you can see some of the css parameters for items. You should be able to build this pretty easily using a Bootstrap framework or even from scratch.

Odianosen25 commented 4 years ago

GUI I have been so lazy to learn, but I really want to. Took me so much time to even decide to learn AD dashboard, I am that bad. Will try it

skynet01 commented 4 years ago

Let me know if there is any other way i can help :)