Let's talk about Gladys V4

I don’t record the city in the end :slight_smile:

Just the country + region. It’s actually very very imprecise since it’s just based on the IP. Honestly in Bali it’s wrong by about 1200km…

And to make it even more inaccurate, I round the latitude/longitude given (which is already wrong to begin with) to the nearest integer, so in the end I have a precision of plus or minus 100km on the already imprecise point.

So… the result is really imprecise and no one can do anything with it :face_with_tongue: if you want we can look at each case to see what the system finds with your IP, and see if the system is as imprecise as desired!

Yes, that’s not a bad idea! Especially since if we want all connected objects to connect to our service, it is necessary to set up either a DHCP on the raspberry pi that takes over from the box or to configure the box’s DHCP directly so that it sends to the pi-hole.

Can you easily launch a docker with Gladys?

Yes, in principle. @pierre-gilles found a Node.js package that allows you to control the daemon.

Great! Well, why not? I’d be happy to look into this part if you want! I’m interested in not being spied on by the Chinese :smiley:

By the way, I saw that Pi-Hole manages DHCP, so potentially we can let it handle everything.

Pi-hole is something I use at home, I don’t really see what there is to « automate » with it, once installed and configured, you forget about it.

What would you like in relation to Gladys?

I’m afraid we’ll end up providing Pi-hole support.

Warning, in this case, if the Raspberry crashes or stops responding, no device will have access to the network.
The RPI becomes a SPOF (Single Point of Failure): if it crashes, it has serious consequences.

The idea is simply to limit requests from connected objects to the outside.

In this case, changes need to be made to the box configuration anyway, so logically this should be done by a user who knows what they’re doing. This is a use case that is not necessarily the one to implement.

It’s clear and this could be a discussion topic or even a tutorial, because as it stands, it’s going to pollute the Gladys topic quite a bit…

I’m not sure if this resonates with anyone, but I’ve been having some issues with CodeCov since I switched to CircleCI for branch builds…

On master, CodeCov manages coverage without any issues, but not on branches/PRs, where I get an error:

Yet everything seems fine, the upload of the coverage file in .lcov appears to be okay on the CI.

https://circleci.com/gh/GladysAssistant/gladys-4-playground/67

It’s been several days, and I’m a bit stuck. If anyone has any leads…!

(Maybe I just need a weekend :joy: )

This Saturday I worked on the system management view.

For now, something simple, not yet RAM usage curves, or CPU temperature, but that will be the next step :slight_smile: Let’s keep the basics for this alpha.

The « Containers » tab on the right is optional and will only appear if the user runs Gladys in Docker.

Great!

On my end, the Bluetooth service is starting to work, but I’m missing a few pieces:

  • retrieve already existing devices
  • will a device be linked to a user as before?
  • what is the replacement for checkUserPresence?

I’m trying to create a simple device configuration page for the user.

But time is becoming a scarce commodity :frowning:

Awesome! Great job :slight_smile:

For now, I haven’t thought about this aspect yet :thinking:

Thinking about it now, what we want is:

  • When a device is seen in a home, mark the user as « seen » in the home.
  • A user can have multiple devices.
  • A device belongs to only one user (otherwise it doesn’t make sense).

So the modeling we had until now in Gladys 3 is rather logical. (an attribute in the device table).

However, I think we should give a better name to this attribute, and above all present it in a completely different way in the UI, in Gladys 3 it was really not clear. For me, it should be a small UI dedicated to this presence detection.

The attribute in the device could be presence_detection_user_id (it’s not crazy, if someone has a better idea..)

We could for example make a « Presence Detection » service, which clearly explains:

"Some devices have the possibility of being detected when they are at your home: via a Bluetooth scan, a Wi-Fi network scan, or via their geolocation. Gladys can use this information to deduce whether you are at home, or on the contrary absent.

If you want Gladys to use the detection of certain devices to mark you as present at home, you need to indicate to Gladys the devices it can use to detect you.

For example: if you have a Bluetooth keychain attached to your keys, you can link this keychain to your user, and when it is seen via Bluetooth at your home, you will be marked as « present ». After a certain delay, if the device is no longer seen by Gladys, you will be marked as « absent ».

Select the devices that Gladys can use to detect you:

[List with checkboxes of devices with a presence deviceFeature that has reported information + indication of the last information reported + sort the list by the most recent information reported].

Example:

  • :ballot_box_with_check: Fitbit Charge 2 (seen 2 min ago)
  • :ballot_box_with_check: Nut Mini (seen 12 min ago)

Gladys can automatically mark you as absent if these devices are not detected after a certain time.
Enable automatic absence detection :ballot_box_with_check: (disabled by default)
Delay before absence: 15 minutes (select box with 4-5 options, like 5, 10, 15, 30, 45)

Development level

To summarize:

  • An attribute in the « t_device » table, like presence_detection_user_id, nullable and foreign key on t_user.id.
  • A new category of device_feature that indicates that it is a « presence » device_feature of a device. Example: { category: « detection », type: « push », min: 1, max: 1 }
  • An API route of GET device filtered by category.
  • An API route of PATCH device.
  • Two variables in DB, like « ABSENCE_DETECTION_ENABLED », and « ABSENCE_DETECTION_TIMEOUT ».
  • A task in the scheduler (not yet developed) of Gladys 4 to go check the potential absence of a user. If we do everything in RAM (as is often the case in Gladys 4), a passage every minute should not be a problem.

What do you think? :smiley:

I’m not a big fan of the « user_id » in the device, but it still seems quite logical.
Now for the rest, this does not impact the « device » service devs, so we can take the time to think about it.
I’m rather in agreement with your proposals, except perhaps for the 2 variables in the DB, I think we need them as default values, but also to be able to have the « timeout » per device, and thus to say if the Nut is not visible after one minute, or if my phone is no longer visible on WiFi after 5 minutes, then I’m gone.

I agree. In terms of modeling, I don’t see any other solutions.

I agree, but I think we should also be able to change them. Being able to disable automatic absence is essential!

And wouldn’t it be a timeout per device? We can store that in « t_device_param » otherwise.

Hello everyone,
A bit late on the CalDAV migration, sorry… I have a start of code based on that of v3, but I am facing a problem and some help would be welcome (still in full discovery of the architecture of v4). Before, we could identify each user’s configuration (in the google module of v3 for example) thanks to user variables, today we only have « classic » variables. They can be linked to a service but not to a user (which however seems essential to me for this kind of service linked to an account). @pierre-gilles maybe you had a vision of the thing when you implemented the new architecture?

Hello!

What I had thought until now is that everything that was a user-linked variable, we would simply put it in the t_user table. Look for example at the Telegram chat_id, I store it in the user table.

I think that given the few user variables, it would be overkill to do as in v3. It’s an « excess of cleanliness » I would say, which is also less performant in use ^^

Let me know what you think of it!

Thanks, I hadn’t noticed Telegram. So if I understand correctly, I am allowed to modify t_user? I will do it that way then.

It’s at this point that I’m not sure I follow you. I don’t mind doing it this way at all, especially as you say given the number of modules using user variables, but in the long term, wouldn’t having a t_user that grows in parameters be annoying? And wouldn’t it be simpler for the architecture to have a user_id (which can be null) in the t_variable table?

In my opinion, you won’t be on time to release the Alpha on June 26, you’ll be 24 hours late.
That way, it will be released on my birthday!!! :crazy_face: :birthday: