Help designing Gladys standalone screen

Hello,

I would like to ask for your help in designing a Gladys display.

The chosen technology is based on a 7.5-inch ePaper screen and a battery-powered ESP32. Therefore the device must power on for a short period and then enter deep sleep for at least 15 minutes.

The goal of this screen is to display data from certain sensors that are all registered in Gladys as MQTT and Zigbee2mqtt devices.

I’m wondering how to read the data from Gladys. I see two solutions:

  • Via HTTP API calls (Gladys Plus). I don’t particularly like this solution because I would prefer to stay with local calls.
  • By creating an MQTT device composed of all the features I want to display. Again, this isn’t straightforward because in a scene it’s not easy to populate these features from other devices. This is the solution I’m leaning toward for the moment.

Do you see another solution that would allow reading data from Gladys?

I’m not a developer, I’m experimenting… So please excuse me if there’s an obvious solution.

Thank you for your help.

Philippe

There is an undocumented internal API that you can use locally. I can give you more information this evening.

1 Like

Throughout the post, 192.168.1.11 is the IP address of my Gladys instance. Adapt it to your network.

To authenticate yourself and retrieve an access_token

curl --location --request POST 'http://192.168.1.11/api/v1/login' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"email":"\u003cemail\u003e","password":"\u003cpassword\u003e"}'

Once you have an access_token (which must be renewed every 24h), you can call this API to get the state of a device

curl --location --request GET 'http://192.168.1.11/api/v1/device/\u003cprise-chambre\u003e' \
--header 'Accept: application/json, text/plain, */*' \
--header 'authorization: Bearer \u003caccess_token\u003e'

You should receive a JSON response with an array of features and for each feature, the last_value is the last known value from Gladys.

1 Like

Great, thank you very much! I’ll test it :slight_smile:

We don’t actively promote it but it is well documented :smiley:

2 Likes

I love the project! I had thought about it several times, but a finished product of this kind used to be really expensive.

Will you be able to show us the project afterwards once it’s working?

1 Like

Wow :heart_eyes: I didn’t know. Thanks

1 Like

Hello,

Here is the result. I don’t have time to do more at the moment so the display is not standalone (mains-powered) and I’m not entirely happy with the interface.

The hardware:

You can find the whole setup on Amazon for around €90.

The information displayed comes almost entirely from Gladys except for those relating to wind speed and direction and the weather icon in the bottom left.

Thanks again for your help on the DEV side :wink:

If you have any suggestions on how the displayed information could be better presented, I’m all ears!

10 Likes

Wow… nice and energy-efficient…
That could give some ideas…

1 Like

It’s very, very clean :heart_eyes: can I share it on social media, Gladys?

Hello @PhilippeMA
Waoouh !! Great job !!! :+1: :clap:
Is it possible to have an A to Z tutorial on how to implement it? :stuck_out_tongue_winking_eye:
As for the APIs, yes they are documented but maybe lack a few implementation examples! :thinking: It’s like when you push a broken-down car, the first push is always hard and discouraging but once it’s moving … :blush:

Yes, of course!

Haha, I’ll have to clean up my code. I’ll see what I can do within a reasonable timeframe :wink:

1 Like

Yeah no problem I can wait…until tonight! :rofl: :rofl: :rofl:
No, more seriously it would already be great to share with the community and especially to provide a reproducible tutorial!!! In the meantime, we’ll stay in the :tent: :wink:

I love how it turned out — it looks super clean and elegant!

2 Likes

:+1: :+1:
It looks great!
Well done

2 Likes

By the way, thanks @cicoub13 for the additional explanation about the Gladys HTTP API :slight_smile:

I took inspiration from your post to improve the documentation on the website!

Read it here:

I also took the opportunity to update the package « apidoc » to get the latest UI, and I restored the build process in the API documentation which was apparently broken. From now on, with each Gladys release, a new build will be done on Cloudflare Pages automatically.

I hope this will inspire people to make small projects of this kind with Gladys :raising_hands:

Anyway @PhilippeMA, your project blew up on social media; it’s one of the best posts of the year and had a record engagement of 11% (I’ve rarely seen that)

55 clicks on the link, that’s a lot compared to other posts :grin:

5 Likes