Hello everyone,
I might be late or out of sync. But I just thought of a use case. But it might already be planned by Pierre-Gilles.
Let’s say the speaker of Gladys is in the living room in Bluetooth for example and that I have AirPods (or similar).
Depending on the time, the presence, the time of day, I may want the information disseminated by Gladys to be on a particular channel.
You can always define this in a script, but I thought a « rule engine » might be useful.
For example, I may want all scenarios that run when I am present with the AirPods detected after a certain time and that must return to an audio device to be directed to my headphones and not to the speaker.
I hope I have been clear enough to make my use case understood.
Actually, if you type your address, it just gives me… your address!
What we want is the latitude/longitude of your home (which allows us to calculate the sunrise on your home + fetch the weather, for example).
What I was saying earlier is that if the user types their address and then we use an online API to convert the address to latitude/longitude, it’s not very respectful of privacy and it’s not necessarily in line with the project’s values, I think!
This was the case in Gladys 3, you could define notification priority rules (e.g., speak to me if I’m at home → Otherwise Telegram).
I haven’t yet defined how to do this in Gladys 4, but it will be something in the same style.
And why not cut the baby in half, and propose a button that would request the national database if the user wishes?
Case 1: the user enters his address and location manually
Case 2: after entering his address he clicks on the button to automatically search for the location
I like this alternative, perhaps by specifying that geolocation connects to the internet and executes a query and that therefore our address data is transmitted. Or, for greater security and privacy, we can geolocate ourselves.
Yes, Gladys V3 manages priority, but I was thinking more of phases where I want the notification to be sent to multiple devices depending on the situation.
Today, if I set all outputs to priority 1, will it be sent everywhere?
Between 8:00 PM - 10:00 PM, I want all the information that Gladys gives me to be in my AirPods if I am there and on the speaker if my partner is there and the information is also intended for her. But after 10:00 PM, I just want the information on the AirPods or on each person’s Telegram.
This ultimately comes down to creating scenarios that could be called within scenarios. Otherwise, you have to manage the times and conditions in each script where you want it to send.
@thierry1 Hmm, it will be complicated if we have to do this country by country. The Gladys community is not just France
According to the site statistics from the last year, visitors come from 182 different countries!
We do have a French dominance, but many other countries that are not negligible! Here are the first 24:
Well, by searching a bit I found a nice and privacy-respecting API!
You didn’t have to look far, OpenStreetMaps, which we already use for the map tiles, provides an open geocoding API ![]()
Example query:
https://nominatim.openstreetmap.org/search?q=tour%20eiffel%20paris&format=json&limit=1
Returns:
[{
"place_id": 257507700,
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
"osm_type": "way",
"osm_id": 5013364,
"boundingbox": [
"48.8574753",
"48.8590465",
"2.2933084",
"2.2956897"
],
"lat": "48.8582602",
"lon": "2.29449905431968",
"display_name": "Eiffel Tower, 5, Avenue Anatole France, Quartier du Gros-Caillou, 7th Arrondissement, Paris, Ile-de-France, Metropolitan France, 75007, France",
"class": "tourism",
"type": "attraction",
"importance": 0.7537721029714171,
"icon": "https://nominatim.openstreetmap.org/images/mapicons/poi_point_of_interest.p.20.png"
}]
So, in principle, no problem to put an address search box
Thanks to everyone for the reflection!
I think for your case, which is very specific, it’s scenes that call scenes. (I’m not even sure that in real life your schedule works, it’s quite rare for days to be alike…)
Hello everyone! I wanted to talk to you today about my focus for this week in Gladys 4: unified camera management.
I will present my implementation here, and you will tell me what you think.
The goal is to have in Gladys 4 a 100% unified management of cameras, that is to say a clean API to fetch the latest image from a camera, and which returns a constant format regardless of the camera brand. The big plus of this unified API is that as long as it goes through the Gladys API, it means that we remove all the problems as soon as we are out of the network, since Gladys server becomes a kind of « camera proxy ». And it’s directly compatible with Gateway!
I think a diagram will make it clearer:
In Gladys 3, the frontend contacted the camera directly. No more in Gladys 4!
It’s no longer up to the frontend to adapt to each camera, it’s up to Gladys server to manage all that.
For now, I haven’t worked on live yet, but just on a clear API for:
- Recording the last image of a camera
- Fetching the last image of a camera
This is already a first step.
I created two API routes:
Update the last image of a camera:
POST /api/v1/camera/:camera_selector/image
Fetch the last image of a camera:
GET /api/v1/camera/:camera_selector/image
This API is solely for the purpose of recording/returning already « processed » images, that is to say in the correct format (we can even say thumbnails). I chose that these images would be saved in base64 in the database (yes, in the database!). Why this choice?
Here, we are not talking about storing gigabytes of data, we are talking about storing only the last image of a camera in a light size, with a maximum size of 50 ko.
If the user has 30 cameras at home, and we store 30 images of 50 ko, we are talking about 1.5 Mo in total.
The advantage of storing in the DB is multiple: Backups include these images, and we don’t bother with the filesystem, it’s the DB that manages all that.
Feel free to give feedback if you have any.
I find that this is a much better way of functioning than v3, with the major advantage of complementing Gladys core, rather than spreading it all over the place (front-end and back-end).
Above all, from a security point of view, this is more interesting. No more risky manipulations by Mr. Everyman who is going to expose his camera on the internet, even though it is full of various critical flaws and all kinds of vulnerabilities!
For the stored photos, are only the latest images stored, or all those that will be requested by the user?
That’s exactly the goal! Whether the user has a simple camera mounted on a Pi Zero, or a Chinese camera bought on Alibaba, they don’t have to worry about it; everything is done in Gladys for the remote access part ![]()
Only the latest ones, there is no history in this first iteration. To keep a history, we would need to think more about the subject and do some tests to see how heavy it becomes to keep too many photos.
That’s great, I’m going to start testing a camera on V3.
Would it be possible to set it up so that:
- The video stream is recorded when it detects motion in the camera’s field of view for a user-defined period of time (saved to a hard drive or SD card or even to the cloud).
I know it’s possible via free software (I don’t remember the name, I’ll put it in a message) but how to set it up in Gladys.
Here we’re getting into technical implementation; it will depend on each camera. It could be a feature for later, yes ![]()
The software is contaCam.
Yes, I understand.
I saw that @PhilippeMA had studied this track.
https://community.gladysassistant.com/t/creation-module-denregistrement-et-lecture-video/1259
Hello everyone!
I have some great news for you: I just reached the first development milestone for Gladys 4! ![]()
![]()
![]()
This milestone means that we now have a first functional backend base, and in my opinion, we have a solid core to start developing Gladys 4 integrations.
The goal now is to see how we can gradually migrate the modules from Gladys 3 to Gladys 4.
I have therefore written a tutorial explaining how to create services (services=modules) for Gladys 4.
The tutorial is available here →
https://gladys-4-docs.gladysassistant.com/en/development
[ANNOUNCEMENT] I am now looking for Gladys v3 module developers who want to migrate their module! The goal is to do this together, speak up on this topic and we will see together how we can do it ![]()
The goal is not to do this under the radar on your side, I think there will be a lot of questions that will arise during the developments and I would like us to think together about the different problems that will be raised so that we do things well ![]()
The first backend milestone has been reached, but not yet the frontend one. On the UI side, not everything is usable yet. However, this is not blocking for developing the services, I think it would be a shame not to advance both subjects in parallel.
I look forward to your feedback!
Hello,
That’s great :)!
So, in addition to migrating modules, is it also possible to develop new modules? And for the development side, is there a Postman or something similar already set up to test the application, especially the development part?
Thanks ![]()
That’s great! ![]()
By the way, do you have a demo module? I thought I understood that you had already developed one to test the APIs.
Thanks
Absolutely
Developing new services or porting existing ones, everything is possible. The tutorial above describes how to develop a service!
On my side, I use Insomnia, if it can help you, I can export my local queries… After that, there’s nothing magical.
I need to publish the API documentation somewhere, for now you can get it locally but it’s true that it would be good to have it online even if Gladys 4 is not yet released. I’ll take care of it!
Yes! I have already developed 7 services that you can find on GitHub here => https://github.com/GladysAssistant/gladys-4-playground/tree/master/server/services
Including the « example » service available here =>
https://github.com/GladysAssistant/gladys-4-playground/tree/master/server/services/example
You will see, it’s very close to v3 ![]()
@damalgos Well, I’ve been working all morning and I have something solid!
The REST API documentation is available online here →
https://gladys-4-apidoc.gladysassistant.com
I’ve entered all the Gladys 4 API routes into Insomnia, it looks like this:
With this, it is very simple to test the Gladys API, everything is already entered!
Small tutorial to import this setup at your place
- Download Insomnia
- Import the insomnia.json file by doing:
Click on « Data » → « Import Data » → « From URL », then copy and paste the URL:
https://raw.githubusercontent.com/GladysAssistant/gladys-4-playground/master/insomnia.json
- You can modify the environment with your parameters (IP of your instance, authentication token) by going to « Manage environment »
There you go ![]()
Wow, you’re not joking at all! LOL!
Seriously, thanks, that’s great, you don’t waste any time ![]()
I know it’s not rocket science, but I thought it would make it easy for anyone who wants to help with development to manipulate the application. I’ll look into setting up a small module for the Apple TV ![]()
Hello everyone,
For those who will undertake the service migration part, it would be interesting if we could synchronize, so as not to work twice on the same subject, and even so that we can work as a team.
Either a new topic on the community, or a Trello, or something else ![]()
I confess that my priority will be Bluetooth ![]()






